Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 1 | /* |
| 2 | * Copyright 2001-2003 Pavel Machek <pavel@suse.cz> |
| 3 | * Based on code |
| 4 | * Copyright 2001 Patrick Mochel <mochel@osdl.org> |
| 5 | */ |
Rafael J. Wysocki | 0de80bc | 2007-10-23 22:37:24 +0200 | [diff] [blame] | 6 | #ifndef __ASM_X86_64_SUSPEND_H |
| 7 | #define __ASM_X86_64_SUSPEND_H |
| 8 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 9 | #include <asm/desc.h> |
| 10 | #include <asm/i387.h> |
| 11 | |
| 12 | static inline int |
| 13 | arch_prepare_suspend(void) |
| 14 | { |
| 15 | return 0; |
| 16 | } |
| 17 | |
Rafael J. Wysocki | 0de80bc | 2007-10-23 22:37:24 +0200 | [diff] [blame] | 18 | /* Image of the saved processor state. If you touch this, fix acpi/wakeup.S. */ |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 19 | struct saved_context { |
Rafael J. Wysocki | 0de80bc | 2007-10-23 22:37:24 +0200 | [diff] [blame] | 20 | struct pt_regs regs; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 21 | u16 ds, es, fs, gs, ss; |
| 22 | unsigned long gs_base, gs_kernel_base, fs_base; |
Pavel Machek | 8d783b3 | 2005-06-25 14:55:14 -0700 | [diff] [blame] | 23 | unsigned long cr0, cr2, cr3, cr4, cr8; |
Vivek Goyal | 3c321bc | 2007-05-02 19:27:07 +0200 | [diff] [blame] | 24 | unsigned long efer; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 25 | u16 gdt_pad; |
| 26 | u16 gdt_limit; |
| 27 | unsigned long gdt_base; |
| 28 | u16 idt_pad; |
| 29 | u16 idt_limit; |
| 30 | unsigned long idt_base; |
| 31 | u16 ldt; |
| 32 | u16 tss; |
| 33 | unsigned long tr; |
| 34 | unsigned long safety; |
| 35 | unsigned long return_address; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 36 | } __attribute__((packed)); |
| 37 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 38 | #define loaddebug(thread,register) \ |
Jan Beulich | 2b514e7 | 2006-03-25 16:29:22 +0100 | [diff] [blame] | 39 | set_debugreg((thread)->debugreg##register, register) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 40 | |
| 41 | extern void fix_processor_context(void); |
| 42 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 43 | /* routines for saving/restoring kernel state */ |
| 44 | extern int acpi_save_state_mem(void); |
Rafael J. Wysocki | d158cbd | 2007-10-18 03:04:53 -0700 | [diff] [blame] | 45 | extern char core_restore_code; |
| 46 | extern char restore_registers; |
Rafael J. Wysocki | 0de80bc | 2007-10-23 22:37:24 +0200 | [diff] [blame] | 47 | |
| 48 | #endif /* __ASM_X86_64_SUSPEND_H */ |