--- linux-2.4.26-pre2/drivers/acpi/system.c.orig 2004-03-26 00:47:29.000000000 +0000 +++ linux-2.4.26-pre2/drivers/acpi/system.c 2004-03-26 00:57:11.000000000 +0000 @@ -46,14 +46,16 @@ #include #include #include +#endif /* CONFIG_ACPI_SLEEP */ +#ifdef CONFIG_PM acpi_status acpi_system_save_state(u32); #else static inline acpi_status acpi_system_save_state(u32 state) { return AE_OK; } -#endif /* !CONFIG_ACPI_SLEEP */ +#endif /* CONFIG_PM */ #define _COMPONENT ACPI_SYSTEM_COMPONENT ACPI_MODULE_NAME ("acpi_system") @@ -110,62 +112,6 @@ printk(KERN_EMERG "ACPI: can not power off machine\n"); } -#endif /*CONFIG_PM*/ - - -#ifdef CONFIG_ACPI_SLEEP - -/** - * acpi_system_restore_state - OS-specific restoration of state - * @state: sleep state we're exiting - * - * Note that if we're coming back from S4, the memory image should have - * already been loaded from the disk and is already in place. (Otherwise how - * else would we be here?). - */ -acpi_status -acpi_system_restore_state( - u32 state) -{ - /* - * We should only be here if we're coming back from STR or STD. - * And, in the case of the latter, the memory image should have already - * been loaded from disk. - */ - if (state > ACPI_STATE_S1) { - acpi_restore_state_mem(); - - /* Do _early_ resume for irqs. Required by - * ACPI specs. - */ - /* TBD: call arch dependant reinitialization of the - * interrupts. - */ -#ifdef CONFIG_X86 - init_8259A(0); -#endif - /* wait for power to come back */ - mdelay(1000); - - } - - /* Be really sure that irqs are disabled. */ - ACPI_DISABLE_IRQS(); - - /* Wait a little again, just in case... */ - mdelay(1000); - - /* enable interrupts once again */ - ACPI_ENABLE_IRQS(); - - /* turn all the devices back on */ - if (state > ACPI_STATE_S1) - pm_send_all(PM_RESUME, (void *)0); - - return AE_OK; -} - - /** * acpi_system_save_state - save OS specific state and power down devices * @state: sleep state we're entering. @@ -259,6 +205,63 @@ return error ? AE_ERROR : AE_OK; } +#endif /*CONFIG_PM*/ + + +#ifdef CONFIG_ACPI_SLEEP + +/** + * acpi_system_restore_state - OS-specific restoration of state + * @state: sleep state we're exiting + * + * Note that if we're coming back from S4, the memory image should have + * already been loaded from the disk and is already in place. (Otherwise how + * else would we be here?). + */ +acpi_status +acpi_system_restore_state( + u32 state) +{ + /* + * We should only be here if we're coming back from STR or STD. + * And, in the case of the latter, the memory image should have already + * been loaded from disk. + */ + if (state > ACPI_STATE_S1) { + acpi_restore_state_mem(); + + /* Do _early_ resume for irqs. Required by + * ACPI specs. + */ + /* TBD: call arch dependant reinitialization of the + * interrupts. + */ +#ifdef CONFIG_X86 + init_8259A(0); +#endif + /* wait for power to come back */ + mdelay(1000); + + } + + /* Be really sure that irqs are disabled. */ + ACPI_DISABLE_IRQS(); + + /* Wait a little again, just in case... */ + mdelay(1000); + + /* enable interrupts once again */ + ACPI_ENABLE_IRQS(); + + /* turn all the devices back on */ + if (state > ACPI_STATE_S1) + pm_send_all(PM_RESUME, (void *)0); + + return AE_OK; +} + + + /**************************************************************************** *