2 * Copyright 2001-2002 Pavel Machek <pavel@suse.cz>
4 * Copyright 2001 Patrick Mochel <mochel@osdl.org>
10 arch_prepare_suspend(void)
12 /* If you want to make non-PSE machine work, turn off paging
13 in swsusp_arch_suspend. swsusp_pg_dir should have identity mapping, so
16 printk(KERN_ERR
"PSE is required for swsusp.\n");
22 /* image of the saved processor state */
23 struct saved_context
{
25 unsigned long cr0
, cr2
, cr3
, cr4
;
28 unsigned long gdt_base
;
31 unsigned long idt_base
;
36 unsigned long return_address
;
37 } __attribute__((packed
));
39 #ifdef CONFIG_ACPI_SLEEP
40 extern unsigned long saved_eip
;
41 extern unsigned long saved_esp
;
42 extern unsigned long saved_ebp
;
43 extern unsigned long saved_ebx
;
44 extern unsigned long saved_esi
;
45 extern unsigned long saved_edi
;
47 static inline void acpi_save_register_state(unsigned long return_point
)
49 saved_eip
= return_point
;
50 asm volatile ("movl %%esp,%0" : "=m" (saved_esp
));
51 asm volatile ("movl %%ebp,%0" : "=m" (saved_ebp
));
52 asm volatile ("movl %%ebx,%0" : "=m" (saved_ebx
));
53 asm volatile ("movl %%edi,%0" : "=m" (saved_edi
));
54 asm volatile ("movl %%esi,%0" : "=m" (saved_esi
));
57 #define acpi_restore_register_state() do {} while (0)
59 /* routines for saving/restoring kernel state */
60 extern int acpi_save_state_mem(void);