Skip to contentSkip to conversation

ppc/boot: Put flush_{instruction,data}_cache back in .relocate_code section

PATCH New Paul Janzen 1 participant 1 message Jan 6, 2006

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ppc/boot: Put flush_{instruction,data}_cache back in .relocate_code section

As part of the Great PowerPC Include Merge, the _GLOBAL() assembler macro was changed to force code declared using _GLOBAL() to be in the .text section. As a result, two symbols defined in arch/ppc/boot/common/util.S which are intended to be in the .relocate_code section are being placed in .text instead, which causes booting to fail.

There's another suspicious-looking usage at arch/ppc/kernel/swsusp.S:37 (swsusp_save_area) that should be looked into. I did not exhaustively search the source tree, though.

This is the minimal patch that fixes the immediate problem. I could easily be convinced that the _GLOBAL macro should be modified to remove the ".text;" line either instead of, or in addition to, this fix.

arch/ppc/boot/common/util.S +4 -2
@@ -234,7 +234,8 @@ udelay:
  * First, flush the data cache in case it was enabled and may be
  * holding instructions for copy back.
  */
-_GLOBAL(flush_instruction_cache)
+        .globl flush_instruction_cache
+flush_instruction_cache:
 	mflr	r6
 	bl	flush_data_cache
 
@@ -279,7 +280,8 @@ _GLOBAL(flush_instruction_cache)
  * Flush data cache
  * Do this by just reading lots of stuff into the cache.
  */
-_GLOBAL(flush_data_cache)
+        .globl flush_data_cache
+flush_data_cache:
 	lis	r3,cache_flush_buffer@h
 	ori	r3,r3,cache_flush_buffer@l
 	li	r4,NUM_CACHE_LINES