--- linux-2.6.9/kernel/power/main.c.org 2004-10-22 11:11:58.000000000 -0700 +++ linux-2.6.9/kernel/power/main.c 2004-10-22 11:15:45.000000000 -0700 @@ -93,6 +93,19 @@ static int suspend_enter(u32 state) return error; } +int vgapost_usermode(void) +{ + char *argv[3] = {NULL, NULL, NULL}; + char *envp[3] = {NULL, NULL, NULL}; + + argv[0] = "/root/emu/video_post"; + + /* minimal command environment */ + envp[0] = "HOME=/"; + envp[1] = "PATH=/sbin:/bin:/usr/sbin:/usr/bin"; + + return call_usermodehelper(argv[0], argv, envp, 1); +} /** * suspend_finish - Do final work before exiting suspend sequence. @@ -107,6 +120,10 @@ static void suspend_finish(u32 state) device_resume(); if (pm_ops && pm_ops->finish) pm_ops->finish(state); + + thaw_processes_kernel(); + vgapost_usermode(); + thaw_processes(); pm_restore_console(); } --- linux-2.6.9/kernel/power/process.c.org 2004-10-22 11:12:14.000000000 -0700 +++ linux-2.6.9/kernel/power/process.c 2004-10-22 11:20:37.000000000 -0700 @@ -97,6 +97,29 @@ int freeze_processes(void) return 0; } +void thaw_processes_kernel(void) +{ + struct task_struct *g, *p; + + printk( "Restarting kernel tasks..." ); + read_lock(&tasklist_lock); + do_each_thread(g, p) { + if (!freezeable(p)) + continue; + if (p->parent->pid != 1) + continue; + if (p->flags & PF_FROZEN) { + p->flags &= ~PF_FROZEN; + wake_up_process(p); + } else + printk(KERN_INFO " Strange, %s not stopped\n", p->comm ); + } while_each_thread(g, p); + + read_unlock(&tasklist_lock); + schedule(); + printk( " done\n" ); +} + void thaw_processes(void) { struct task_struct *g, *p; @@ -106,6 +129,8 @@ void thaw_processes(void) do_each_thread(g, p) { if (!freezeable(p)) continue; + if (p->parent->pid == 1) + continue; if (p->flags & PF_FROZEN) { p->flags &= ~PF_FROZEN; wake_up_process(p);