x86_64: Missing a volatile on a struct used for spinning

Before we're initialized and can use proper synchronization, the CPU
initialization path spins on the thread entry function to be non-null.
But the data wasn't tagged volatile, and with gcc 8.2.1 (but not
6.2.0) the optimizer was hoisting the reads to SMP init would spin
forever.

Signed-off-by: Andy Ross <andrew.j.ross@intel.com>
This commit is contained in:
Andy Ross 2019-02-14 19:40:54 -08:00 committed by Anas Nashif
commit 02a1e21c3d

View file

@ -69,7 +69,7 @@ void *_isr_exit_restore_stack(void *interrupted)
return (nested || next == interrupted) ? NULL : next; return (nested || next == interrupted) ? NULL : next;
} }
struct { volatile struct {
void (*fn)(int, void*); void (*fn)(int, void*);
void *arg; void *arg;
} cpu_init[CONFIG_MP_NUM_CPUS]; } cpu_init[CONFIG_MP_NUM_CPUS];