2005-04-17 00:20:36 +02:00
|
|
|
/*
|
|
|
|
* Copyright 2001-2003 Pavel Machek <pavel@suse.cz>
|
|
|
|
* Based on code
|
|
|
|
* Copyright 2001 Patrick Mochel <mochel@osdl.org>
|
|
|
|
*/
|
2007-10-23 22:37:24 +02:00
|
|
|
#ifndef __ASM_X86_64_SUSPEND_H
|
|
|
|
#define __ASM_X86_64_SUSPEND_H
|
|
|
|
|
2005-04-17 00:20:36 +02:00
|
|
|
#include <asm/desc.h>
|
|
|
|
#include <asm/i387.h>
|
|
|
|
|
2008-03-23 09:03:36 +01:00
|
|
|
static inline int arch_prepare_suspend(void)
|
2005-04-17 00:20:36 +02:00
|
|
|
{
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
2008-01-30 13:30:04 +01:00
|
|
|
/*
|
|
|
|
* Image of the saved processor state, used by the low level ACPI suspend to
|
|
|
|
* RAM code and by the low level hibernation code.
|
|
|
|
*
|
|
|
|
* If you modify it, fix arch/x86/kernel/acpi/wakeup_64.S and make sure that
|
|
|
|
* __save/__restore_processor_state(), defined in arch/x86/kernel/suspend_64.c,
|
|
|
|
* still work as required.
|
|
|
|
*/
|
2005-04-17 00:20:36 +02:00
|
|
|
struct saved_context {
|
2007-10-23 22:37:24 +02:00
|
|
|
struct pt_regs regs;
|
2008-03-23 09:03:36 +01:00
|
|
|
u16 ds, es, fs, gs, ss;
|
2005-04-17 00:20:36 +02:00
|
|
|
unsigned long gs_base, gs_kernel_base, fs_base;
|
2005-06-25 23:55:14 +02:00
|
|
|
unsigned long cr0, cr2, cr3, cr4, cr8;
|
2007-05-02 19:27:07 +02:00
|
|
|
unsigned long efer;
|
2005-04-17 00:20:36 +02:00
|
|
|
u16 gdt_pad;
|
|
|
|
u16 gdt_limit;
|
|
|
|
unsigned long gdt_base;
|
|
|
|
u16 idt_pad;
|
|
|
|
u16 idt_limit;
|
|
|
|
unsigned long idt_base;
|
|
|
|
u16 ldt;
|
|
|
|
u16 tss;
|
|
|
|
unsigned long tr;
|
|
|
|
unsigned long safety;
|
|
|
|
unsigned long return_address;
|
|
|
|
} __attribute__((packed));
|
|
|
|
|
|
|
|
#define loaddebug(thread,register) \
|
2006-03-25 16:29:22 +01:00
|
|
|
set_debugreg((thread)->debugreg##register, register)
|
2005-04-17 00:20:36 +02:00
|
|
|
|
|
|
|
/* routines for saving/restoring kernel state */
|
|
|
|
extern int acpi_save_state_mem(void);
|
2007-10-18 12:04:53 +02:00
|
|
|
extern char core_restore_code;
|
|
|
|
extern char restore_registers;
|
2007-10-23 22:37:24 +02:00
|
|
|
|
|
|
|
#endif /* __ASM_X86_64_SUSPEND_H */
|