summaryrefslogtreecommitdiff
path: root/kernel
diff options
context:
space:
mode:
authorPatrick Mochel <mochel@osdl.org>2003-09-17 23:26:01 -0700
committerPatrick Mochel <mochel@osdl.org>2003-09-17 23:26:01 -0700
commitea98e14b921c6174b35e4becdf85dc0033e7bc71 (patch)
tree25a5642c1aef4ed2c690708da971af8fd16a5012 /kernel
parent98ad92228ff7e15ae86ba6ff8af897e3c4f7bc94 (diff)
[power] Optimize pmdisk assembly.
- No need to save %ebx, since we replace it with saved version after we restore image. - No need to use long long for the loop counters, since they can't conceivably exeed 32 bits. We can then fit them in general registers, and don't actually have to write them back after each iteration. - Use rep ; movsl to copy each page, instead of copying a byte at a time. This actually makes a noticable improvment when restoring the saved image. This also relieves register pressure by using %esi and %edi, which allows us to kill the loop variables altogether. - Call {save,restore}_processor_state() from the pmdisk C functions. We need to make sure all the counters are set appropriately before and after each path, and we don't _have_ to call them from assembly.
Diffstat (limited to 'kernel')
-rw-r--r--kernel/power/pmdisk.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/kernel/power/pmdisk.c b/kernel/power/pmdisk.c
index 58a5a6afaaa4..51029739af3d 100644
--- a/kernel/power/pmdisk.c
+++ b/kernel/power/pmdisk.c
@@ -1126,7 +1126,9 @@ int pmdisk_save(void)
if ((error = arch_prepare_suspend()))
return error;
local_irq_disable();
+ save_processor_state();
error = pmdisk_arch_suspend(0);
+ restore_processor_state();
local_irq_enable();
return error;
}
@@ -1186,7 +1188,9 @@ int __init pmdisk_restore(void)
{
int error;
local_irq_disable();
+ save_processor_state();
error = pmdisk_arch_suspend(1);
+ restore_processor_state();
local_irq_enable();
return error;
}