]> pilppa.com Git - linux-2.6-omap-h63xx.git/commitdiff
sh: Fix up unaligned current_text_addr().
authorPaul Mundt <lethal@linux-sh.org>
Mon, 28 Jul 2008 13:32:03 +0000 (22:32 +0900)
committerPaul Mundt <lethal@linux-sh.org>
Mon, 28 Jul 2008 21:32:05 +0000 (06:32 +0900)
As noted by Adrian:

Commit 3ab83521378268044a448113c6aa9a9e245f4d2f (kexec jump)
causes the following build error on sh:

<--  snip  -->

...
  CC      kernel/kexec.o
{standard input}: Assembler messages:
{standard input}:1518: Error: offset to unaligned destination
make[2]: *** [kernel/kexec.o] Error 1

<--  snip  -->

If I understand the assembler correctly it fails at
include/asm-sh/kexec.h:59

The issue here is that the mova reference lacks an explicit alignment,
and previous code paths would end up with this on a 16-bit boundary,
so we make the alignment explicit.

Reported-by: Adrian Bunk <bunk@kernel.org>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
include/asm-sh/processor_32.h

index c6583f2670715fc3e12f396bc2b17c1d4100c508..0dadd75bd93c8cb8720e5129ed1975fc4e3517a7 100644 (file)
@@ -19,7 +19,7 @@
  * Default implementation of macro that returns current
  * instruction pointer ("program counter").
  */
-#define current_text_addr() ({ void *pc; __asm__("mova 1f, %0\n1:":"=z" (pc)); pc; })
+#define current_text_addr() ({ void *pc; __asm__("mova 1f, %0\n.align 2\n1:":"=z" (pc)); pc; })
 
 /* Core Processor Version Register */
 #define CCN_PVR                0xff000030