diff options
author | Paul Janzen <pcj@linux.sez.to> | 2006-01-05 00:40:48 -0500 |
---|---|---|
committer | Paul Mackerras <paulus@samba.org> | 2006-01-08 23:47:08 -0500 |
commit | aed9c6ccb87d96c333bd6ae631d9e90f3b6d7271 (patch) | |
tree | 65366c1ddedfbec62cb422686a5c6b0d734ce5e5 /arch | |
parent | 2fb9d2063626374dd8a2514b3a730facac8235d8 (diff) |
[PATCH] ppc32: Put cache flush routines back into .relocate_code section
In 2.6.14, we had the following definition of _GLOBAL() in
include/asm-ppc/processor.h:
#define _GLOBAL(n)\
.stabs __stringify(n:F-1),N_FUN,0,0,n;\
.globl n;\
n:
In 2.6.15, as part of the great powerpc merge, we moved this definition to
include/asm-powerpc/ppc_asm.h, where it appears (to 32-bit code) as:
#define _GLOBAL(n) \
.text; \
.stabs __stringify(n:F-1),N_FUN,0,0,n;\
.globl n; \
n:
Mostly, this is fine. However, we also have the following, in
arch/ppc/boot/common/util.S:
.section ".relocate_code","xa"
[...]
_GLOBAL(flush_instruction_cache)
[...]
_GLOBAL(flush_data_cache)
[...]
The addition of the .text section definition in the definition of
_GLOBAL overrides the .relocate_code section definition. As a result,
these two functions don't end up in .relocate_code, so they don't get
relocated correctly, and the boot fails.
There's another suspicious-looking usage at kernel/swsusp.S:37 that
someone should look into. I did not exhaustively search the source
tree, though.
The following is the minimal patch that fixes the immediate problem.
I could easily be convinced that the _GLOBAL definition should be
modified to remove the ".text;" line either instead of, or in addition
to, this fix.
Signed-off-by: Paul Janzen <pcj@linux.sez.to>
Signed-off-by: Paul Mackerras <paulus@samba.org>
Diffstat (limited to 'arch')
-rw-r--r-- | arch/ppc/boot/common/util.S | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/arch/ppc/boot/common/util.S b/arch/ppc/boot/common/util.S index c96c9f80521e..368ec035e6cd 100644 --- a/arch/ppc/boot/common/util.S +++ b/arch/ppc/boot/common/util.S | |||
@@ -234,7 +234,8 @@ udelay: | |||
234 | * First, flush the data cache in case it was enabled and may be | 234 | * First, flush the data cache in case it was enabled and may be |
235 | * holding instructions for copy back. | 235 | * holding instructions for copy back. |
236 | */ | 236 | */ |
237 | _GLOBAL(flush_instruction_cache) | 237 | .globl flush_instruction_cache |
238 | flush_instruction_cache: | ||
238 | mflr r6 | 239 | mflr r6 |
239 | bl flush_data_cache | 240 | bl flush_data_cache |
240 | 241 | ||
@@ -279,7 +280,8 @@ _GLOBAL(flush_instruction_cache) | |||
279 | * Flush data cache | 280 | * Flush data cache |
280 | * Do this by just reading lots of stuff into the cache. | 281 | * Do this by just reading lots of stuff into the cache. |
281 | */ | 282 | */ |
282 | _GLOBAL(flush_data_cache) | 283 | .globl flush_data_cache |
284 | flush_data_cache: | ||
283 | lis r3,cache_flush_buffer@h | 285 | lis r3,cache_flush_buffer@h |
284 | ori r3,r3,cache_flush_buffer@l | 286 | ori r3,r3,cache_flush_buffer@l |
285 | li r4,NUM_CACHE_LINES | 287 | li r4,NUM_CACHE_LINES |