suspend_64.h 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  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_64_SUSPEND_H
  7. #define __ASM_X86_64_SUSPEND_H
  8. #include <asm/desc.h>
  9. #include <asm/i387.h>
  10. static inline int
  11. arch_prepare_suspend(void)
  12. {
  13. return 0;
  14. }
  15. /*
  16. * Image of the saved processor state, used by the low level ACPI suspend to
  17. * RAM code and by the low level hibernation code.
  18. *
  19. * If you modify it, fix arch/x86/kernel/acpi/wakeup_64.S and make sure that
  20. * __save/__restore_processor_state(), defined in arch/x86/kernel/suspend_64.c,
  21. * still work as required.
  22. */
  23. struct saved_context {
  24. struct pt_regs regs;
  25. u16 ds, es, fs, gs, ss;
  26. unsigned long gs_base, gs_kernel_base, fs_base;
  27. unsigned long cr0, cr2, cr3, cr4, cr8;
  28. unsigned long efer;
  29. u16 gdt_pad;
  30. u16 gdt_limit;
  31. unsigned long gdt_base;
  32. u16 idt_pad;
  33. u16 idt_limit;
  34. unsigned long idt_base;
  35. u16 ldt;
  36. u16 tss;
  37. unsigned long tr;
  38. unsigned long safety;
  39. unsigned long return_address;
  40. } __attribute__((packed));
  41. #define loaddebug(thread,register) \
  42. set_debugreg((thread)->debugreg##register, register)
  43. /* routines for saving/restoring kernel state */
  44. extern int acpi_save_state_mem(void);
  45. extern char core_restore_code;
  46. extern char restore_registers;
  47. #endif /* __ASM_X86_64_SUSPEND_H */