freertos: Make xPortGetCoreID() volatile

When xPortGetCoreID() is called twice within a function,
it might only be called once after compilation. This
commit makes the inline assembly of the function volatile.

Closes #3093
This commit is contained in:
Darian Leung 2019-02-26 20:58:02 +08:00 committed by bot
parent 9d48cdb6f3
commit 66a0b64e54

View file

@ -205,7 +205,7 @@ BaseType_t xPortInterruptedFromISRContext();
/* Multi-core: get current core ID */
static inline uint32_t IRAM_ATTR xPortGetCoreID() {
int id;
__asm__ (
__asm__ __volatile__ (
"rsr.prid %0\n"
" extui %0,%0,13,1"
:"=r"(id));