|
Lines 922-932
static int swsusp_alloc(void)
Link Here
|
| 922 |
pr_debug("suspend: (pages needed: %d + %d free: %d)\n", |
922 |
pr_debug("suspend: (pages needed: %d + %d free: %d)\n", |
| 923 |
nr_copy_pages, PAGES_FOR_IO, nr_free_pages()); |
923 |
nr_copy_pages, PAGES_FOR_IO, nr_free_pages()); |
| 924 |
|
924 |
|
| 925 |
if (!enough_free_mem()) |
925 |
if (!enough_free_mem()) { |
|
|
926 |
printk(KERN_ERR "swsusp: Not enough free memory\n"); |
| 926 |
return -ENOMEM; |
927 |
return -ENOMEM; |
|
|
928 |
} |
| 927 |
|
929 |
|
| 928 |
if (!enough_swap()) |
930 |
if (!enough_swap()) { |
|
|
931 |
printk(KERN_ERR "swsusp: Not enough free swap\n"); |
| 929 |
return -ENOSPC; |
932 |
return -ENOSPC; |
|
|
933 |
} |
| 934 |
|
| 930 |
|
935 |
|
| 931 |
if (!(pagedir_save = alloc_pagedir(nr_copy_pages))) { |
936 |
if (!(pagedir_save = alloc_pagedir(nr_copy_pages))) { |
| 932 |
printk(KERN_ERR "suspend: Allocating pagedir failed.\n"); |
937 |
printk(KERN_ERR "suspend: Allocating pagedir failed.\n"); |
|
Lines 1037-1043
int swsusp_suspend(void)
Link Here
|
| 1037 |
printk(KERN_ERR "Error %d suspending\n", error); |
1042 |
printk(KERN_ERR "Error %d suspending\n", error); |
| 1038 |
/* Restore control flow magically appears here */ |
1043 |
/* Restore control flow magically appears here */ |
| 1039 |
restore_processor_state(); |
1044 |
restore_processor_state(); |
| 1040 |
BUG_ON (nr_copy_pages_check != nr_copy_pages); |
1045 |
BUG_ON (!error && (nr_copy_pages_check != nr_copy_pages)); |
| 1041 |
restore_highmem(); |
1046 |
restore_highmem(); |
| 1042 |
device_power_up(); |
1047 |
device_power_up(); |
| 1043 |
local_irq_enable(); |
1048 |
local_irq_enable(); |