suspend_64.h 1.3 KB
Newer Older
L
Linus Torvalds 已提交
1 2 3 4 5
/*
 * Copyright 2001-2003 Pavel Machek <pavel@suse.cz>
 * Based on code
 * Copyright 2001 Patrick Mochel <mochel@osdl.org>
 */
V
Vegard Nossum 已提交
6 7
#ifndef ASM_X86__SUSPEND_64_H
#define ASM_X86__SUSPEND_64_H
8

L
Linus Torvalds 已提交
9 10 11
#include <asm/desc.h>
#include <asm/i387.h>

12
static inline int arch_prepare_suspend(void)
L
Linus Torvalds 已提交
13 14 15 16
{
	return 0;
}

17 18 19 20 21 22 23 24
/*
 * 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.
 */
L
Linus Torvalds 已提交
25
struct saved_context {
26
	struct pt_regs regs;
27
	u16 ds, es, fs, gs, ss;
L
Linus Torvalds 已提交
28
	unsigned long gs_base, gs_kernel_base, fs_base;
29
	unsigned long cr0, cr2, cr3, cr4, cr8;
30
	unsigned long efer;
L
Linus Torvalds 已提交
31 32 33 34 35 36 37 38 39 40 41 42 43 44
	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) \
45
	set_debugreg((thread)->debugreg##register, register)
L
Linus Torvalds 已提交
46 47 48

/* routines for saving/restoring kernel state */
extern int acpi_save_state_mem(void);
49 50
extern char core_restore_code;
extern char restore_registers;
51

V
Vegard Nossum 已提交
52
#endif /* ASM_X86__SUSPEND_64_H */