suspend_64.h 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. /*
  2. * Copyright 2001-2003 Pavel Machek <pavel@suse.cz>
  3. * Based on code
  4. * Copyright 2001 Patrick Mochel <mochel@osdl.org>
  5. */
  6. #ifndef _ASM_X86_SUSPEND_64_H
  7. #define _ASM_X86_SUSPEND_64_H
  8. #include <asm/desc.h>
  9. #include <asm/i387.h>
  10. /*
  11. * Image of the saved processor state, used by the low level ACPI suspend to
  12. * RAM code and by the low level hibernation code.
  13. *
  14. * If you modify it, fix arch/x86/kernel/acpi/wakeup_64.S and make sure that
  15. * __save/__restore_processor_state(), defined in arch/x86/kernel/suspend_64.c,
  16. * still work as required.
  17. */
  18. struct saved_context {
  19. struct pt_regs regs;
  20. u16 ds, es, fs, gs, ss;
  21. unsigned long gs_base, gs_kernel_base, fs_base;
  22. unsigned long cr0, cr2, cr3, cr4, cr8;
  23. u64 misc_enable;
  24. bool misc_enable_saved;
  25. unsigned long efer;
  26. u16 gdt_pad;
  27. u16 gdt_limit;
  28. unsigned long gdt_base;
  29. u16 idt_pad;
  30. u16 idt_limit;
  31. unsigned long idt_base;
  32. u16 ldt;
  33. u16 tss;
  34. unsigned long tr;
  35. unsigned long safety;
  36. unsigned long return_address;
  37. } __attribute__((packed));
  38. #define loaddebug(thread,register) \
  39. set_debugreg((thread)->debugreg##register, register)
  40. /* routines for saving/restoring kernel state */
  41. extern int acpi_save_state_mem(void);
  42. extern char core_restore_code;
  43. extern char restore_registers;
  44. #endif /* _ASM_X86_SUSPEND_64_H */