X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=arch%2Fi386%2Fkernel%2Facpi%2Fsleep.c;fp=arch%2Fi386%2Fkernel%2Facpi%2Fsleep.c;h=1cb2b186a3aff9ac0cbdc8f4540154a4f5e78e26;hb=64ba3f394c830ec48a1c31b53dcae312c56f1604;hp=4ee83577bf6191e93b25666671752c573d1aa7d1;hpb=be1e6109ac94a859551f8e1774eb9a8469fe055c;p=linux-2.6.git diff --git a/arch/i386/kernel/acpi/sleep.c b/arch/i386/kernel/acpi/sleep.c index 4ee83577b..1cb2b186a 100644 --- a/arch/i386/kernel/acpi/sleep.c +++ b/arch/i386/kernel/acpi/sleep.c @@ -8,17 +8,30 @@ #include #include #include -#include - #include +#include /* address in low memory of the wakeup routine. */ unsigned long acpi_wakeup_address = 0; unsigned long acpi_video_flags; extern char wakeup_start, wakeup_end; +extern void zap_low_mappings(void); + extern unsigned long FASTCALL(acpi_copy_wakeup_routine(unsigned long)); +static void init_low_mapping(pgd_t * pgd, int pgd_limit) +{ + int pgd_ofs = 0; + + while ((pgd_ofs < pgd_limit) + && (pgd_ofs + USER_PTRS_PER_PGD < PTRS_PER_PGD)) { + set_pgd(pgd, *(pgd + USER_PTRS_PER_PGD)); + pgd_ofs++, pgd++; + } + flush_tlb_all(); +} + /** * acpi_save_state_mem - save kernel state * @@ -29,6 +42,7 @@ int acpi_save_state_mem(void) { if (!acpi_wakeup_address) return 1; + init_low_mapping(swapper_pg_dir, USER_PTRS_PER_PGD); memcpy((void *)acpi_wakeup_address, &wakeup_start, &wakeup_end - &wakeup_start); acpi_copy_wakeup_routine(acpi_wakeup_address); @@ -41,6 +55,7 @@ int acpi_save_state_mem(void) */ void acpi_restore_state_mem(void) { + zap_low_mappings(); } /**