Skip to content

Commit

Permalink
sh: Fix up unaligned current_text_addr().
Browse files Browse the repository at this point in the history
As noted by Adrian:

	Commit 3ab8352 (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>
  • Loading branch information
Paul Mundt committed Jul 28, 2008
1 parent 11325f0 commit 103340c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion include/asm-sh/processor_32.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 103340c

Please sign in to comment.