diff options
author | Will Deacon <will.deacon@arm.com> | 2011-06-08 16:29:00 +0200 |
---|---|---|
committer | Will Deacon <will.deacon@arm.com> | 2011-12-12 17:07:35 +0100 |
commit | 2d81f1fe81b753a5744fd2deceafab3e62ba02d5 (patch) | |
tree | a5660d357bb9920f34751dd3ab39298e3e7cb33e /arch/arm/lib/Makefile | |
parent | ARM: 7183/1: vic: register the VIC for ST-modified VIC's (diff) | |
download | linux-2d81f1fe81b753a5744fd2deceafab3e62ba02d5.tar.xz linux-2d81f1fe81b753a5744fd2deceafab3e62ba02d5.zip |
ARM: lib: add call_with_stack function for safely changing stack
When disabling the MMU, it is necessary to take out a 1:1 identity map
of the reset code so that it can safely be executed with and without
the MMU active. To avoid the situation where the physical address of the
reset code aliases with the virtual address of the active stack (which
cannot be included in the 1:1 mapping), it is desirable to change to a
new stack at a location which is less likely to alias.
This code adds a new lib function, call_with_stack:
void call_with_stack(void (*fn)(void *), void *arg, void *sp);
which changes the stack to point at the sp parameter, before invoking
fn(arg) with the new stack selected.
Reviewed-by: Nicolas Pitre <nicolas.pitre@linaro.org>
Reviewed-by: Catalin Marinas <catalin.marinas@arm.com>
Signed-off-by: Dave Martin <dave.martin@linaro.org>
Signed-off-by: Will Deacon <will.deacon@arm.com>
Diffstat (limited to 'arch/arm/lib/Makefile')
-rw-r--r-- | arch/arm/lib/Makefile | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/arch/arm/lib/Makefile b/arch/arm/lib/Makefile index cf73a7f742dd..0ade0acc1ed9 100644 --- a/arch/arm/lib/Makefile +++ b/arch/arm/lib/Makefile @@ -13,7 +13,8 @@ lib-y := backtrace.o changebit.o csumipv6.o csumpartial.o \ testchangebit.o testclearbit.o testsetbit.o \ ashldi3.o ashrdi3.o lshrdi3.o muldi3.o \ ucmpdi2.o lib1funcs.o div64.o \ - io-readsb.o io-writesb.o io-readsl.o io-writesl.o + io-readsb.o io-writesb.o io-readsl.o io-writesl.o \ + call_with_stack.o mmu-y := clear_user.o copy_page.o getuser.o putuser.o |