--- linux-2.6.5-1.358/arch/i386/mm/init.c.orig 2004-05-08 22:56:42.000000000 +1000 +++ linux-2.6.5-1.358/arch/i386/mm/init.c 2004-05-16 21:21:45.000000000 +1000 @@ -324,6 +324,12 @@ void zap_low_mappings(void) { +#ifdef CONFIG_SOFTWARE_SUSPEND + { + extern char swsusp_pg_dir[PAGE_SIZE]; + memcpy(swsusp_pg_dir, swapper_pg_dir, PAGE_SIZE); + } +#endif printk("zapping low mappings.\n"); /* * Zap initial low-memory mappings. --- linux-2.6.5-1.358/arch/i386/power/cpu.c.orig 2004-05-16 21:32:57.000000000 +1000 +++ linux-2.6.5-1.358/arch/i386/power/cpu.c 2004-05-16 21:33:02.000000000 +1000 @@ -35,6 +35,10 @@ unsigned long saved_context_esi, saved_context_edi; unsigned long saved_context_eflags; +/* Special page directory for resume */ +char __nosavedata swsusp_pg_dir[PAGE_SIZE] + __attribute__ ((aligned (PAGE_SIZE))); + extern void enable_sep_cpu(void *); void save_processor_state(void) --- linux-2.6.5-1.358/arch/i386/power/swsusp.S.orig 2004-05-16 21:34:00.000000000 +1000 +++ linux-2.6.5-1.358/arch/i386/power/swsusp.S 2004-05-16 21:34:32.000000000 +1000 @@ -36,7 +36,7 @@ jmp .L1449 .p2align 4,,7 .L1450: - movl $swapper_pg_dir-__PAGE_OFFSET,%ecx + movl $swsusp_pg_dir-__PAGE_OFFSET,%ecx movl %ecx,%cr3 call do_magic_resume_1 --- linux-2.6.5-1.358/include/asm-i386/suspend.h.orig 2004-05-16 21:35:50.000000000 +1000 +++ linux-2.6.5-1.358/include/asm-i386/suspend.h 2004-05-16 21:35:52.000000000 +1000 @@ -9,6 +9,9 @@ static inline int arch_prepare_suspend(void) { + /* If you want to make non-PSE machine work, turn off paging + in do_magic. swsusp_pg_dir should have identity mapping, so + it could work... */ if (!cpu_has_pse) return -EPERM; return 0;