summaryrefslogtreecommitdiff
path: root/kexec/arch/sh/kexec-sh.c
diff options
context:
space:
mode:
Diffstat (limited to 'kexec/arch/sh/kexec-sh.c')
-rw-r--r--kexec/arch/sh/kexec-sh.c29
1 files changed, 29 insertions, 0 deletions
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);
+}