1 /* SPDX-License-Identifier: GPL-2.0 */
2 #ifndef _ARCH_X86_REALMODE_H
3 #define _ARCH_X86_REALMODE_H
6 * Flag bit definitions for use with the flags field of the trampoline header
7 * in the CONFIG_X86_64 variant.
9 #define TH_FLAGS_SME_ACTIVE_BIT 0
10 #define TH_FLAGS_SME_ACTIVE BIT(TH_FLAGS_SME_ACTIVE_BIT)
14 #include <linux/types.h>
17 /* This must match data at realmode/rm/header.S */
18 struct real_mode_header
{
23 u32 trampoline_header
;
28 #ifdef CONFIG_ACPI_SLEEP
33 u32 machine_real_restart_asm
;
35 u32 machine_real_restart_seg
;
39 /* This must match data at realmode/rm/trampoline_{32,64}.S */
40 struct trampoline_header
{
54 extern struct real_mode_header
*real_mode_header
;
55 extern unsigned char real_mode_blob_end
[];
57 extern unsigned long initial_code
;
58 extern unsigned long initial_gs
;
59 extern unsigned long initial_stack
;
61 extern unsigned char real_mode_blob
[];
62 extern unsigned char real_mode_relocs
[];
65 extern unsigned char startup_32_smp
[];
66 extern unsigned char boot_gdt
[];
68 extern unsigned char secondary_startup_64
[];
71 static inline size_t real_mode_size_needed(void)
74 return 0; /* already allocated. */
76 return ALIGN(real_mode_blob_end
- real_mode_blob
, PAGE_SIZE
);
79 static inline void set_real_mode_mem(phys_addr_t mem
)
81 real_mode_header
= (struct real_mode_header
*) __va(mem
);
84 void reserve_real_mode(void);
86 #endif /* __ASSEMBLY__ */
88 #endif /* _ARCH_X86_REALMODE_H */