diff options
author | Sascha Hauer <s.hauer@pengutronix.de> | 2019-07-16 14:32:34 +0200 |
---|---|---|
committer | Sascha Hauer <s.hauer@pengutronix.de> | 2019-08-07 09:41:28 +0200 |
commit | 0e284efa85a85e148d6c506763603398d68ba937 (patch) | |
tree | 47fa8cc72473008635b19da58ee613bbf22746e0 /arch/arm/include | |
parent | 3ce644784995c3e5778cca075208e4f72b77cfd5 (diff) | |
download | barebox-0e284efa85a85e148d6c506763603398d68ba937.tar.gz barebox-0e284efa85a85e148d6c506763603398d68ba937.tar.xz |
ARM: access __boot_cpu_mode with a function
__boot_cpu_mode is accessed from barebox_multi_pbl_start() and
barebox_single_pbl_start(). These functions may be called at an
address different from the address they are linked at. Calculating
the address of global variables can yield wrong results when it
is done before setup_c() is called. We can't make sure when the
address is calculated, OSELAS.Toolchain-2018.12.0 indeed calculates
the address after setup_c() is called, but Debian
arm-linux-gnueabihf-gcc 8.3.0 does it before setup_c() is called
and thus doesn't work.
This is solved by accessing __boot_cpu_mode with a wrapper function
which we call explicitly after setup_c() is done.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'arch/arm/include')
-rw-r--r-- | arch/arm/include/asm/secure.h | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/arch/arm/include/asm/secure.h b/arch/arm/include/asm/secure.h index 663d81ea27..e0c2623723 100644 --- a/arch/arm/include/asm/secure.h +++ b/arch/arm/include/asm/secure.h @@ -10,7 +10,8 @@ void armv7_switch_to_hyp(void); void armv7_hyp_install(void); extern unsigned char secure_monitor_init_vectors[]; -extern int __boot_cpu_mode; + +int boot_cpu_mode(void); enum arm_security_state { ARM_STATE_SECURE, |