21 #include <asm/uaccess.h>
26 #define DBG(fmt...) udbg_printf(fmt)
31 #ifndef CONFIG_NONSTATIC_KERNEL
37 static void __init create_trampoline(
unsigned long addr)
39 unsigned int *
p = (
unsigned int *)addr;
57 DBG(
" -> setup_kdump_trampoline()\n");
59 for (i = KDUMP_TRAMPOLINE_START; i < KDUMP_TRAMPOLINE_END; i += 8) {
63 #ifdef CONFIG_PPC_PSERIES
68 DBG(
" <- setup_kdump_trampoline()\n");
72 static int __init parse_savemaxmem(
char *
p)
79 __setup(
"savemaxmem=", parse_savemaxmem);
82 static size_t copy_oldmem_vaddr(
void *
vaddr,
char *
buf,
size_t csize,
83 unsigned long offset,
int userbuf)
86 if (
copy_to_user((
char __user *)buf, (vaddr + offset), csize))
89 memcpy(buf, (vaddr + offset), csize);
108 size_t csize,
unsigned long offset,
int userbuf)
119 csize = copy_oldmem_vaddr(vaddr, buf, csize, offset, userbuf);
122 csize = copy_oldmem_vaddr(vaddr, buf, csize, offset, userbuf);
129 #ifdef CONFIG_PPC_RTAS
137 const u32 *basep, *sizep;
138 unsigned int rtas_start = 0, rtas_end = 0;
143 if (basep && sizep) {
145 rtas_end = *basep + *sizep;
150 if (addr <= rtas_end && ((addr +
PAGE_SIZE) > rtas_start))