diff options
-rw-r--r-- | kexec/arch/sh/Makefile | 4 | ||||
-rw-r--r-- | kexec/arch/sh/kexec-sh.c | 29 | ||||
-rw-r--r-- | kexec/arch/sh/kexec-zImage-sh.c | 4 |
3 files changed, 35 insertions, 2 deletions
diff --git a/kexec/arch/sh/Makefile b/kexec/arch/sh/Makefile index 1595ed3..9076d69 100644 --- a/kexec/arch/sh/Makefile +++ b/kexec/arch/sh/Makefile @@ -7,6 +7,10 @@ sh_KEXEC_SRCS += kexec/arch/sh/kexec-netbsd-sh.c sh_KEXEC_SRCS += kexec/arch/sh/kexec-elf-rel-sh.c sh_KEXEC_SRCS += kexec/arch/sh/netbsd_booter.S +sh_ADD_BUFFER = +sh_ADD_SEGMENT = +sh_VIRT_TO_PHYS = + dist += kexec/arch/sh/Makefile $(sh_KEXEC_SRCS) \ kexec/arch/sh/kexec-sh.h \ kexec/arch/sh/include/arch/options.h diff --git a/kexec/arch/sh/kexec-sh.c b/kexec/arch/sh/kexec-sh.c index ebac77f..117f3e8 100644 --- a/kexec/arch/sh/kexec-sh.c +++ b/kexec/arch/sh/kexec-sh.c @@ -168,3 +168,32 @@ int is_crashkernel_mem_reserved(void) return 0; /* kdump is not supported on this platform (yet) */ } +unsigned long virt_to_phys(unsigned long addr) +{ + unsigned long seg = addr & 0xe0000000; + if (seg != 0x80000000 && seg != 0xc0000000) + die("Virtual address %p is not in P1 or P2\n", (void *)addr); + + return addr - seg; +} + +/* + * add_segment() should convert base to a physical address on superh, + * while the default is just to work with base as is */ +void add_segment(struct kexec_info *info, const void *buf, size_t bufsz, + unsigned long base, size_t memsz) +{ + add_segment_phys_virt(info, buf, bufsz, base, memsz, 1); +} + +/* + * add_buffer() should convert base to a physical address on superh, + * while the default is just to work with base as is */ +unsigned long add_buffer(struct kexec_info *info, const void *buf, + unsigned long bufsz, unsigned long memsz, + unsigned long buf_align, unsigned long buf_min, + unsigned long buf_max, int buf_end) +{ + return add_buffer_phys_virt(info, buf, bufsz, memsz, buf_align, + buf_min, buf_max, buf_end, 1); +} diff --git a/kexec/arch/sh/kexec-zImage-sh.c b/kexec/arch/sh/kexec-zImage-sh.c index 35a2a68..6db91a9 100644 --- a/kexec/arch/sh/kexec-zImage-sh.c +++ b/kexec/arch/sh/kexec-zImage-sh.c @@ -96,8 +96,8 @@ int zImage_sh_load(int argc, char **argv, const char *buf, off_t len, paraml = (unsigned long *)param; // paraml[0] = 1; // readonly flag is set as default - add_segment(info, param, 4096, empty_zero, 4096); - add_segment(info, buf, len, (area | 0x00210000), len); + add_segment(info, param, 4096, 0x80000000 | empty_zero, 4096); + add_segment(info, buf, len, (area | 0x80210000), len); /* For now we don't have arguments to pass :( */ info->entry = (void *)(0x80210000 | area); |