wakeup.h 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. /* SPDX-License-Identifier: GPL-2.0 */
  2. /*
  3. * Definitions for the wakeup data structure at the head of the
  4. * wakeup code.
  5. */
  6. #ifndef ARCH_X86_KERNEL_ACPI_RM_WAKEUP_H
  7. #define ARCH_X86_KERNEL_ACPI_RM_WAKEUP_H
  8. #ifndef __ASSEMBLY__
  9. #include <linux/types.h>
  10. /* This must match data at wakeup.S */
  11. struct wakeup_header {
  12. u16 video_mode; /* Video mode number */
  13. u32 pmode_entry; /* Protected mode resume point, 32-bit only */
  14. u16 pmode_cs;
  15. u32 pmode_cr0; /* Protected mode cr0 */
  16. u32 pmode_cr3; /* Protected mode cr3 */
  17. u32 pmode_cr4; /* Protected mode cr4 */
  18. u32 pmode_efer_low; /* Protected mode EFER */
  19. u32 pmode_efer_high;
  20. u64 pmode_gdt;
  21. u32 pmode_misc_en_low; /* Protected mode MISC_ENABLE */
  22. u32 pmode_misc_en_high;
  23. u32 pmode_behavior; /* Wakeup routine behavior flags */
  24. u32 realmode_flags;
  25. u32 real_magic;
  26. u32 signature; /* To check we have correct structure */
  27. } __attribute__((__packed__));
  28. extern struct wakeup_header wakeup_header;
  29. #endif
  30. #define WAKEUP_HEADER_OFFSET 8
  31. #define WAKEUP_HEADER_SIGNATURE 0x51ee1111
  32. /* Wakeup behavior bits */
  33. #define WAKEUP_BEHAVIOR_RESTORE_MISC_ENABLE 0
  34. #define WAKEUP_BEHAVIOR_RESTORE_CR4 1
  35. #define WAKEUP_BEHAVIOR_RESTORE_EFER 2
  36. #endif /* ARCH_X86_KERNEL_ACPI_RM_WAKEUP_H */