kexec.h 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. #ifndef _ARM_KEXEC_H
  2. #define _ARM_KEXEC_H
  3. #ifdef CONFIG_KEXEC
  4. /* Maximum physical address we can use pages from */
  5. #define KEXEC_SOURCE_MEMORY_LIMIT (-1UL)
  6. /* Maximum address we can reach in physical address mode */
  7. #define KEXEC_DESTINATION_MEMORY_LIMIT (-1UL)
  8. /* Maximum address we can use for the control code buffer */
  9. #define KEXEC_CONTROL_MEMORY_LIMIT (-1UL)
  10. #define KEXEC_CONTROL_PAGE_SIZE 4096
  11. #define KEXEC_ARCH KEXEC_ARCH_ARM
  12. #define KEXEC_ARM_ATAGS_OFFSET 0x1000
  13. #define KEXEC_ARM_ZIMAGE_OFFSET 0x8000
  14. #ifndef __ASSEMBLY__
  15. /**
  16. * crash_setup_regs() - save registers for the panic kernel
  17. * @newregs: registers are saved here
  18. * @oldregs: registers to be saved (may be %NULL)
  19. *
  20. * Function copies machine registers from @oldregs to @newregs. If @oldregs is
  21. * %NULL then current registers are stored there.
  22. */
  23. static inline void crash_setup_regs(struct pt_regs *newregs,
  24. struct pt_regs *oldregs)
  25. {
  26. if (oldregs) {
  27. memcpy(newregs, oldregs, sizeof(*newregs));
  28. } else {
  29. __asm__ __volatile__ ("stmia %0, {r0 - r15}"
  30. : : "r" (&newregs->ARM_r0));
  31. __asm__ __volatile__ ("mrs %0, cpsr"
  32. : "=r" (newregs->ARM_cpsr));
  33. }
  34. }
  35. #endif /* __ASSEMBLY__ */
  36. #endif /* CONFIG_KEXEC */
  37. #endif /* _ARM_KEXEC_H */