diff options
Diffstat (limited to 'arch/i386')
-rw-r--r-- | arch/i386/kernel/setup.c | 106 |
1 files changed, 0 insertions, 106 deletions
diff --git a/arch/i386/kernel/setup.c b/arch/i386/kernel/setup.c index 6c1639836e06..6bef9273733e 100644 --- a/arch/i386/kernel/setup.c +++ b/arch/i386/kernel/setup.c | |||
@@ -48,7 +48,6 @@ | |||
48 | #include <linux/crash_dump.h> | 48 | #include <linux/crash_dump.h> |
49 | #include <linux/dmi.h> | 49 | #include <linux/dmi.h> |
50 | #include <linux/pfn.h> | 50 | #include <linux/pfn.h> |
51 | #include <linux/suspend.h> | ||
52 | 51 | ||
53 | #include <video/edid.h> | 52 | #include <video/edid.h> |
54 | 53 | ||
@@ -1427,111 +1426,6 @@ static void set_mca_bus(int x) | |||
1427 | static void set_mca_bus(int x) { } | 1426 | static void set_mca_bus(int x) { } |
1428 | #endif | 1427 | #endif |
1429 | 1428 | ||
1430 | #ifdef CONFIG_SOFTWARE_SUSPEND | ||
1431 | static void __init mark_nosave_page_range(unsigned long start, unsigned long end) | ||
1432 | { | ||
1433 | struct page *page; | ||
1434 | while (start <= end) { | ||
1435 | page = pfn_to_page(start); | ||
1436 | SetPageNosave(page); | ||
1437 | start++; | ||
1438 | } | ||
1439 | } | ||
1440 | |||
1441 | static void __init e820_nosave_reserved_pages(void) | ||
1442 | { | ||
1443 | int i; | ||
1444 | unsigned long r_start = 0, r_end = 0; | ||
1445 | |||
1446 | /* Assume e820 map is sorted */ | ||
1447 | for (i = 0; i < e820.nr_map; i++) { | ||
1448 | struct e820entry *ei = &e820.map[i]; | ||
1449 | unsigned long start, end; | ||
1450 | |||
1451 | start = PFN_DOWN(ei->addr); | ||
1452 | end = PFN_UP(ei->addr + ei->size); | ||
1453 | if (start >= end) | ||
1454 | continue; | ||
1455 | if (ei->type == E820_RESERVED) | ||
1456 | continue; | ||
1457 | r_end = start; | ||
1458 | /* | ||
1459 | * Highmem 'Reserved' pages are marked as reserved, swsusp | ||
1460 | * will not save/restore them, so we ignore these pages here. | ||
1461 | */ | ||
1462 | if (r_end > max_low_pfn) | ||
1463 | r_end = max_low_pfn; | ||
1464 | if (r_end > r_start) | ||
1465 | mark_nosave_page_range(r_start, r_end-1); | ||
1466 | if (r_end >= max_low_pfn) | ||
1467 | break; | ||
1468 | r_start = end; | ||
1469 | } | ||
1470 | } | ||
1471 | |||
1472 | static void __init e820_save_acpi_pages(void) | ||
1473 | { | ||
1474 | int i; | ||
1475 | |||
1476 | /* Assume e820 map is sorted */ | ||
1477 | for (i = 0; i < e820.nr_map; i++) { | ||
1478 | struct e820entry *ei = &e820.map[i]; | ||
1479 | unsigned long start, end; | ||
1480 | |||
1481 | start = ei->addr; | ||
1482 | end = ei->addr + ei->size; | ||
1483 | if (start >= end) | ||
1484 | continue; | ||
1485 | if (ei->type != E820_ACPI && ei->type != E820_NVS) | ||
1486 | continue; | ||
1487 | /* | ||
1488 | * If the region is below max_low_pfn, it will be | ||
1489 | * saved/restored by swsusp follow 'RAM' type. | ||
1490 | */ | ||
1491 | if (start < (max_low_pfn << PAGE_SHIFT)) | ||
1492 | start = max_low_pfn << PAGE_SHIFT; | ||
1493 | /* | ||
1494 | * Highmem pages (ACPI NVS/Data) are reserved, but swsusp | ||
1495 | * highmem save/restore will not save/restore them. We marked | ||
1496 | * them as arch saveable pages here | ||
1497 | */ | ||
1498 | if (end > start) | ||
1499 | swsusp_add_arch_pages(start, end); | ||
1500 | } | ||
1501 | } | ||
1502 | |||
1503 | extern char __start_rodata, __end_rodata; | ||
1504 | /* | ||
1505 | * BIOS reserved region/hole - no save/restore | ||
1506 | * ACPI NVS - save/restore | ||
1507 | * ACPI Data - this is a little tricky, the mem could be used by OS after OS | ||
1508 | * reads tables from the region, but anyway save/restore the memory hasn't any | ||
1509 | * side effect and Linux runtime module load/unload might use it. | ||
1510 | * kernel rodata - no save/restore (kernel rodata isn't changed) | ||
1511 | */ | ||
1512 | static int __init mark_nosave_pages(void) | ||
1513 | { | ||
1514 | unsigned long pfn_start, pfn_end; | ||
1515 | |||
1516 | /* FIXME: provide a version for efi BIOS */ | ||
1517 | if (efi_enabled) | ||
1518 | return 0; | ||
1519 | /* BIOS reserved regions & holes */ | ||
1520 | e820_nosave_reserved_pages(); | ||
1521 | |||
1522 | /* kernel rodata */ | ||
1523 | pfn_start = PFN_UP(virt_to_phys(&__start_rodata)); | ||
1524 | pfn_end = PFN_DOWN(virt_to_phys(&__end_rodata)); | ||
1525 | mark_nosave_page_range(pfn_start, pfn_end-1); | ||
1526 | |||
1527 | /* record ACPI Data/NVS as saveable */ | ||
1528 | e820_save_acpi_pages(); | ||
1529 | |||
1530 | return 0; | ||
1531 | } | ||
1532 | core_initcall(mark_nosave_pages); | ||
1533 | #endif | ||
1534 | |||
1535 | /* | 1429 | /* |
1536 | * Determine if we were loaded by an EFI loader. If so, then we have also been | 1430 | * Determine if we were loaded by an EFI loader. If so, then we have also been |
1537 | * passed the efi memmap, systab, etc., so we should use these data structures | 1431 | * passed the efi memmap, systab, etc., so we should use these data structures |