kernel: add compiler barrier in k_is_pre_kernel between...
...checking whether we are in user context and accessing
a kernel mode only variable.
For some unknown reasons only knew to Cadence engineers,
the Cadence toolchain will always read z_sys_boot_kernel
at the beginning of k_is_pre_kernel() instead of after
k_is_user_context() is called. So it would always result
in access violation if this is called in user mode.
Forcing a compiler barrier seems to fix that. So force it
here.
Signed-off-by: Daniel Leung <daniel.leung@intel.com>
1 file changed