1 /* SPDX-License-Identifier: GPL-2.0 */
5 * Copyright (C) 2022 Loongson Technology Corporation Limited
11 #include <asm/stacktrace.h>
14 /* Maximum physical address we can use pages from */
15 #define KEXEC_SOURCE_MEMORY_LIMIT (-1UL)
16 /* Maximum address we can reach in physical address mode */
17 #define KEXEC_DESTINATION_MEMORY_LIMIT (-1UL)
18 /* Maximum address we can use for the control code buffer */
19 #define KEXEC_CONTROL_MEMORY_LIMIT (-1UL)
21 /* Reserve a page for the control code buffer */
22 #define KEXEC_CONTROL_PAGE_SIZE PAGE_SIZE
24 /* The native architecture */
25 #define KEXEC_ARCH KEXEC_ARCH_LOONGARCH
27 static inline void crash_setup_regs(struct pt_regs
*newregs
,
28 struct pt_regs
*oldregs
)
31 memcpy(newregs
, oldregs
, sizeof(*newregs
));
33 prepare_frametrace(newregs
);
36 #define ARCH_HAS_KIMAGE_ARCH
39 unsigned long efi_boot
;
40 unsigned long cmdline_ptr
;
41 unsigned long systable_ptr
;
44 typedef void (*do_kexec_t
)(unsigned long efi_boot
,
45 unsigned long cmdline_ptr
,
46 unsigned long systable_ptr
,
47 unsigned long start_addr
,
48 unsigned long first_ind_entry
);
51 extern const unsigned char relocate_new_kernel
[];
52 extern const size_t relocate_new_kernel_size
;
53 extern void kexec_reboot(void);
56 extern atomic_t kexec_ready_to_reboot
;
57 extern const unsigned char kexec_smp_wait
[];
60 #endif /* !_ASM_KEXEC_H */