blob: c1da5caafaf753a96ce01e6fbf91ad5f9081b71f [file] [log] [blame]
Linus Torvalds1da177e2005-04-16 15:20:36 -07001/*
2 * Copyright 2001-2002 Pavel Machek <pavel@suse.cz>
3 * Based on code
4 * Copyright 2001 Patrick Mochel <mochel@osdl.org>
5 */
6#include <asm/desc.h>
7#include <asm/i387.h>
8
Rafael J. Wysocki2d4a34c2006-12-06 20:34:29 -08009static inline int arch_prepare_suspend(void) { return 0; }
Linus Torvalds1da177e2005-04-16 15:20:36 -070010
11/* image of the saved processor state */
12struct saved_context {
13 u16 es, fs, gs, ss;
14 unsigned long cr0, cr2, cr3, cr4;
15 u16 gdt_pad;
16 u16 gdt_limit;
17 unsigned long gdt_base;
18 u16 idt_pad;
19 u16 idt_limit;
20 unsigned long idt_base;
21 u16 ldt;
22 u16 tss;
23 unsigned long tr;
24 unsigned long safety;
25 unsigned long return_address;
26} __attribute__((packed));
27
Linus Torvalds1da177e2005-04-16 15:20:36 -070028#ifdef CONFIG_ACPI_SLEEP
29extern unsigned long saved_eip;
30extern unsigned long saved_esp;
31extern unsigned long saved_ebp;
32extern unsigned long saved_ebx;
33extern unsigned long saved_esi;
34extern unsigned long saved_edi;
35
36static inline void acpi_save_register_state(unsigned long return_point)
37{
38 saved_eip = return_point;
39 asm volatile ("movl %%esp,%0" : "=m" (saved_esp));
40 asm volatile ("movl %%ebp,%0" : "=m" (saved_ebp));
41 asm volatile ("movl %%ebx,%0" : "=m" (saved_ebx));
42 asm volatile ("movl %%edi,%0" : "=m" (saved_edi));
43 asm volatile ("movl %%esi,%0" : "=m" (saved_esi));
44}
45
46#define acpi_restore_register_state() do {} while (0)
47
48/* routines for saving/restoring kernel state */
49extern int acpi_save_state_mem(void);
50#endif