diff options
author | Nobuhiro Iwamatsu <iwamatsu@rahute.(none)> | 2007-05-13 15:58:00 +0400 |
---|---|---|
committer | Nobuhiro Iwamatsu <iwamatsu@rahute.(none)> | 2007-05-13 15:58:00 +0400 |
commit | 0b135cfc2e524dc249b75057b55dd4cc09842e27 (patch) | |
tree | a342e571738e4777bbb2b66246412e9d9aaa81c2 /examples | |
parent | abca901869c3760b6c5fecb825db6c1d91a78a93 (diff) | |
download | u-boot-0b135cfc2e524dc249b75057b55dd4cc09842e27.tar.xz |
sh: First support code of SuperH.
Signed-off-by: Nobuhiro Iwamatsu <iwamatsu@nigauri.org>
Diffstat (limited to 'examples')
-rw-r--r-- | examples/Makefile | 5 | ||||
-rw-r--r-- | examples/stubs.c | 16 |
2 files changed, 21 insertions, 0 deletions
diff --git a/examples/Makefile b/examples/Makefile index e9b4974be4..71a8c7f3ab 100644 --- a/examples/Makefile +++ b/examples/Makefile @@ -61,6 +61,11 @@ ifeq ($(ARCH),avr32) LOAD_ADDR = 0x00000000 endif +ifeq ($(ARCH),sh) +LOAD_ADDR = 0x8C000000 +endif + + include $(TOPDIR)/config.mk ELF = hello_world diff --git a/examples/stubs.c b/examples/stubs.c index 26df6e06a1..263dd8c3de 100644 --- a/examples/stubs.c +++ b/examples/stubs.c @@ -151,6 +151,22 @@ gd_t *global_data; : \ : "i"(offsetof(gd_t, jt)), "i"(XF_ ##x) \ : "r8"); +#elif defined(CONFIG_SH) +/* + * r13 holds the pointer to the global_data. r1 is a call clobbered. + */ +#define EXPORT_FUNC(x) \ + asm volatile ( \ + " .align 2\n" \ + " .globl " #x "\n" \ + #x ":\n" \ + " mov r13, r1\n" \ + " add %0, r1\n" \ + " add %1, r1\n" \ + " jmp @r1\n" \ + " nop\n" \ + " nop\n" \ + : : "i"(offsetof(gd_t, jt)), "i"(XF_ ## x * sizeof(void *)) : "r1"); #else #error stubs definition missing for this architecture #endif |