From 63d701e1905e2afbe77a4bf89ffa8d3893ac8079 Mon Sep 17 00:00:00 2001 From: Will Deacon Date: Wed, 8 Jun 2011 15:29:00 +0100 Subject: [PATCH] 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 Reviewed-by: Catalin Marinas Signed-off-by: Dave Martin Signed-off-by: Will Deacon --- Reading git-format-patch failed