summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorIngo Molnar <mingo@kernel.org>2017-01-28 11:09:33 -0500
committerIngo Molnar <mingo@kernel.org>2017-01-28 16:55:22 -0500
commit09821ff1d50a1ecade182c2a68a90f835e257eef (patch)
tree040a51657852db7300a8ebf2acb8a838252ce1bf
parent6afc03b86470f602d118825d09addfeeaef535f0 (diff)
x86/boot/e820: Prefix the E820_* type names with "E820_TYPE_"
So there's a number of constants that start with "E820" but which are not types - these create a confusing mixture when seen together with 'enum e820_type' values: E820MAP E820NR E820_X_MAX E820MAX To better differentiate the 'enum e820_type' values prefix them with E820_TYPE_. No change in functionality. Cc: Alex Thorlton <athorlton@sgi.com> Cc: Andy Lutomirski <luto@kernel.org> Cc: Borislav Petkov <bp@alien8.de> Cc: Brian Gerst <brgerst@gmail.com> Cc: Dan Williams <dan.j.williams@intel.com> Cc: Denys Vlasenko <dvlasenk@redhat.com> Cc: H. Peter Anvin <hpa@zytor.com> Cc: Huang, Ying <ying.huang@intel.com> Cc: Josh Poimboeuf <jpoimboe@redhat.com> Cc: Juergen Gross <jgross@suse.com> Cc: Linus Torvalds <torvalds@linux-foundation.org> Cc: Paul Jackson <pj@sgi.com> Cc: Peter Zijlstra <peterz@infradead.org> Cc: Rafael J. Wysocki <rjw@sisk.pl> Cc: Tejun Heo <tj@kernel.org> Cc: Thomas Gleixner <tglx@linutronix.de> Cc: Wei Yang <richard.weiyang@gmail.com> Cc: Yinghai Lu <yinghai@kernel.org> Cc: linux-kernel@vger.kernel.org Signed-off-by: Ingo Molnar <mingo@kernel.org>
-rw-r--r--arch/x86/boot/compressed/eboot.c12
-rw-r--r--arch/x86/boot/compressed/kaslr.c2
-rw-r--r--arch/x86/include/asm/gart.h2
-rw-r--r--arch/x86/include/uapi/asm/e820/types.h16
-rw-r--r--arch/x86/kernel/acpi/boot.c2
-rw-r--r--arch/x86/kernel/aperture_64.c4
-rw-r--r--arch/x86/kernel/cpu/mtrr/cleanup.c2
-rw-r--r--arch/x86/kernel/crash.c10
-rw-r--r--arch/x86/kernel/e820.c104
-rw-r--r--arch/x86/kernel/early-quirks.c2
-rw-r--r--arch/x86/kernel/kexec-bzimage64.c2
-rw-r--r--arch/x86/kernel/setup.c20
-rw-r--r--arch/x86/kernel/tboot.c8
-rw-r--r--arch/x86/mm/init.c2
-rw-r--r--arch/x86/mm/init_64.c12
-rw-r--r--arch/x86/pci/mmconfig-shared.c2
-rw-r--r--arch/x86/platform/efi/efi.c14
-rw-r--r--arch/x86/platform/efi/quirks.c6
-rw-r--r--arch/x86/xen/setup.c22
-rw-r--r--tools/lguest/lguest.c2
20 files changed, 123 insertions, 123 deletions
diff --git a/arch/x86/boot/compressed/eboot.c b/arch/x86/boot/compressed/eboot.c
index 04c406f9aee3..4cfba2f79dfd 100644
--- a/arch/x86/boot/compressed/eboot.c
+++ b/arch/x86/boot/compressed/eboot.c
@@ -944,15 +944,15 @@ static efi_status_t setup_e820(struct boot_params *params,
944 case EFI_MEMORY_MAPPED_IO: 944 case EFI_MEMORY_MAPPED_IO:
945 case EFI_MEMORY_MAPPED_IO_PORT_SPACE: 945 case EFI_MEMORY_MAPPED_IO_PORT_SPACE:
946 case EFI_PAL_CODE: 946 case EFI_PAL_CODE:
947 e820_type = E820_RESERVED; 947 e820_type = E820_TYPE_RESERVED;
948 break; 948 break;
949 949
950 case EFI_UNUSABLE_MEMORY: 950 case EFI_UNUSABLE_MEMORY:
951 e820_type = E820_UNUSABLE; 951 e820_type = E820_TYPE_UNUSABLE;
952 break; 952 break;
953 953
954 case EFI_ACPI_RECLAIM_MEMORY: 954 case EFI_ACPI_RECLAIM_MEMORY:
955 e820_type = E820_ACPI; 955 e820_type = E820_TYPE_ACPI;
956 break; 956 break;
957 957
958 case EFI_LOADER_CODE: 958 case EFI_LOADER_CODE:
@@ -960,15 +960,15 @@ static efi_status_t setup_e820(struct boot_params *params,
960 case EFI_BOOT_SERVICES_CODE: 960 case EFI_BOOT_SERVICES_CODE:
961 case EFI_BOOT_SERVICES_DATA: 961 case EFI_BOOT_SERVICES_DATA:
962 case EFI_CONVENTIONAL_MEMORY: 962 case EFI_CONVENTIONAL_MEMORY:
963 e820_type = E820_RAM; 963 e820_type = E820_TYPE_RAM;
964 break; 964 break;
965 965
966 case EFI_ACPI_MEMORY_NVS: 966 case EFI_ACPI_MEMORY_NVS:
967 e820_type = E820_NVS; 967 e820_type = E820_TYPE_NVS;
968 break; 968 break;
969 969
970 case EFI_PERSISTENT_MEMORY: 970 case EFI_PERSISTENT_MEMORY:
971 e820_type = E820_PMEM; 971 e820_type = E820_TYPE_PMEM;
972 break; 972 break;
973 973
974 default: 974 default:
diff --git a/arch/x86/boot/compressed/kaslr.c b/arch/x86/boot/compressed/kaslr.c
index a47f832664f2..e8155eab5474 100644
--- a/arch/x86/boot/compressed/kaslr.c
+++ b/arch/x86/boot/compressed/kaslr.c
@@ -435,7 +435,7 @@ static void process_e820_entry(struct e820_entry *entry,
435 unsigned long start_orig; 435 unsigned long start_orig;
436 436
437 /* Skip non-RAM entries. */ 437 /* Skip non-RAM entries. */
438 if (entry->type != E820_RAM) 438 if (entry->type != E820_TYPE_RAM)
439 return; 439 return;
440 440
441 /* On 32-bit, ignore entries entirely above our maximum. */ 441 /* On 32-bit, ignore entries entirely above our maximum. */
diff --git a/arch/x86/include/asm/gart.h b/arch/x86/include/asm/gart.h
index 2a3ff2ac4686..1d268098ac2e 100644
--- a/arch/x86/include/asm/gart.h
+++ b/arch/x86/include/asm/gart.h
@@ -97,7 +97,7 @@ static inline int aperture_valid(u64 aper_base, u32 aper_size, u32 min_size)
97 printk(KERN_INFO "Aperture beyond 4GB. Ignoring.\n"); 97 printk(KERN_INFO "Aperture beyond 4GB. Ignoring.\n");
98 return 0; 98 return 0;
99 } 99 }
100 if (e820__mapped_any(aper_base, aper_base + aper_size, E820_RAM)) { 100 if (e820__mapped_any(aper_base, aper_base + aper_size, E820_TYPE_RAM)) {
101 printk(KERN_INFO "Aperture pointing to e820 RAM. Ignoring.\n"); 101 printk(KERN_INFO "Aperture pointing to e820 RAM. Ignoring.\n");
102 return 0; 102 return 0;
103 } 103 }
diff --git a/arch/x86/include/uapi/asm/e820/types.h b/arch/x86/include/uapi/asm/e820/types.h
index 65c7a1beab22..29391386b63f 100644
--- a/arch/x86/include/uapi/asm/e820/types.h
+++ b/arch/x86/include/uapi/asm/e820/types.h
@@ -7,12 +7,12 @@
7#ifndef __ASSEMBLY__ 7#ifndef __ASSEMBLY__
8 8
9enum e820_type { 9enum e820_type {
10 E820_RAM = 1, 10 E820_TYPE_RAM = 1,
11 E820_RESERVED = 2, 11 E820_TYPE_RESERVED = 2,
12 E820_ACPI = 3, 12 E820_TYPE_ACPI = 3,
13 E820_NVS = 4, 13 E820_TYPE_NVS = 4,
14 E820_UNUSABLE = 5, 14 E820_TYPE_UNUSABLE = 5,
15 E820_PMEM = 7, 15 E820_TYPE_PMEM = 7,
16 16
17 /* 17 /*
18 * This is a non-standardized way to represent ADR or 18 * This is a non-standardized way to represent ADR or
@@ -25,7 +25,7 @@ enum e820_type {
25 * type of memory, but newer versions switched to 12 as 25 * type of memory, but newer versions switched to 12 as
26 * 6 was assigned differently. Some time they will learn... ) 26 * 6 was assigned differently. Some time they will learn... )
27 */ 27 */
28 E820_PRAM = 12, 28 E820_TYPE_PRAM = 12,
29 29
30 /* 30 /*
31 * Reserved RAM used by the kernel itself if 31 * Reserved RAM used by the kernel itself if
@@ -34,7 +34,7 @@ enum e820_type {
34 * and so should not include any memory that the BIOS 34 * and so should not include any memory that the BIOS
35 * might alter over the S3 transition: 35 * might alter over the S3 transition:
36 */ 36 */
37 E820_RESERVED_KERN = 128, 37 E820_TYPE_RESERVED_KERN = 128,
38}; 38};
39 39
40/* 40/*
diff --git a/arch/x86/kernel/acpi/boot.c b/arch/x86/kernel/acpi/boot.c
index 31b350c6a3b1..873552718270 100644
--- a/arch/x86/kernel/acpi/boot.c
+++ b/arch/x86/kernel/acpi/boot.c
@@ -1715,6 +1715,6 @@ int __acpi_release_global_lock(unsigned int *lock)
1715 1715
1716void __init arch_reserve_mem_area(acpi_physical_address addr, size_t size) 1716void __init arch_reserve_mem_area(acpi_physical_address addr, size_t size)
1717{ 1717{
1718 e820__range_add(addr, size, E820_ACPI); 1718 e820__range_add(addr, size, E820_TYPE_ACPI);
1719 e820__update_table_print(); 1719 e820__update_table_print();
1720} 1720}
diff --git a/arch/x86/kernel/aperture_64.c b/arch/x86/kernel/aperture_64.c
index 883485684435..ef2859f9fcce 100644
--- a/arch/x86/kernel/aperture_64.c
+++ b/arch/x86/kernel/aperture_64.c
@@ -307,11 +307,11 @@ void __init early_gart_iommu_check(void)
307 307
308 if (gart_fix_e820 && !fix && aper_enabled) { 308 if (gart_fix_e820 && !fix && aper_enabled) {
309 if (e820__mapped_any(aper_base, aper_base + aper_size, 309 if (e820__mapped_any(aper_base, aper_base + aper_size,
310 E820_RAM)) { 310 E820_TYPE_RAM)) {
311 /* reserve it, so we can reuse it in second kernel */ 311 /* reserve it, so we can reuse it in second kernel */
312 pr_info("e820: reserve [mem %#010Lx-%#010Lx] for GART\n", 312 pr_info("e820: reserve [mem %#010Lx-%#010Lx] for GART\n",
313 aper_base, aper_base + aper_size - 1); 313 aper_base, aper_base + aper_size - 1);
314 e820__range_add(aper_base, aper_size, E820_RESERVED); 314 e820__range_add(aper_base, aper_size, E820_TYPE_RESERVED);
315 e820__update_table_print(); 315 e820__update_table_print();
316 } 316 }
317 } 317 }
diff --git a/arch/x86/kernel/cpu/mtrr/cleanup.c b/arch/x86/kernel/cpu/mtrr/cleanup.c
index 244aaa988ecd..765afd599039 100644
--- a/arch/x86/kernel/cpu/mtrr/cleanup.c
+++ b/arch/x86/kernel/cpu/mtrr/cleanup.c
@@ -860,7 +860,7 @@ real_trim_memory(unsigned long start_pfn, unsigned long limit_pfn)
860 trim_size <<= PAGE_SHIFT; 860 trim_size <<= PAGE_SHIFT;
861 trim_size -= trim_start; 861 trim_size -= trim_start;
862 862
863 return e820__range_update(trim_start, trim_size, E820_RAM, E820_RESERVED); 863 return e820__range_update(trim_start, trim_size, E820_TYPE_RAM, E820_TYPE_RESERVED);
864} 864}
865 865
866/** 866/**
diff --git a/arch/x86/kernel/crash.c b/arch/x86/kernel/crash.c
index 11f7eb1e2506..5feba9a21130 100644
--- a/arch/x86/kernel/crash.c
+++ b/arch/x86/kernel/crash.c
@@ -575,17 +575,17 @@ int crash_setup_memmap_entries(struct kimage *image, struct boot_params *params)
575 /* Add first 640K segment */ 575 /* Add first 640K segment */
576 ei.addr = image->arch.backup_src_start; 576 ei.addr = image->arch.backup_src_start;
577 ei.size = image->arch.backup_src_sz; 577 ei.size = image->arch.backup_src_sz;
578 ei.type = E820_RAM; 578 ei.type = E820_TYPE_RAM;
579 add_e820_entry(params, &ei); 579 add_e820_entry(params, &ei);
580 580
581 /* Add ACPI tables */ 581 /* Add ACPI tables */
582 cmd.type = E820_ACPI; 582 cmd.type = E820_TYPE_ACPI;
583 flags = IORESOURCE_MEM | IORESOURCE_BUSY; 583 flags = IORESOURCE_MEM | IORESOURCE_BUSY;
584 walk_iomem_res_desc(IORES_DESC_ACPI_TABLES, flags, 0, -1, &cmd, 584 walk_iomem_res_desc(IORES_DESC_ACPI_TABLES, flags, 0, -1, &cmd,
585 memmap_entry_callback); 585 memmap_entry_callback);
586 586
587 /* Add ACPI Non-volatile Storage */ 587 /* Add ACPI Non-volatile Storage */
588 cmd.type = E820_NVS; 588 cmd.type = E820_TYPE_NVS;
589 walk_iomem_res_desc(IORES_DESC_ACPI_NV_STORAGE, flags, 0, -1, &cmd, 589 walk_iomem_res_desc(IORES_DESC_ACPI_NV_STORAGE, flags, 0, -1, &cmd,
590 memmap_entry_callback); 590 memmap_entry_callback);
591 591
@@ -593,7 +593,7 @@ int crash_setup_memmap_entries(struct kimage *image, struct boot_params *params)
593 if (crashk_low_res.end) { 593 if (crashk_low_res.end) {
594 ei.addr = crashk_low_res.start; 594 ei.addr = crashk_low_res.start;
595 ei.size = crashk_low_res.end - crashk_low_res.start + 1; 595 ei.size = crashk_low_res.end - crashk_low_res.start + 1;
596 ei.type = E820_RAM; 596 ei.type = E820_TYPE_RAM;
597 add_e820_entry(params, &ei); 597 add_e820_entry(params, &ei);
598 } 598 }
599 599
@@ -610,7 +610,7 @@ int crash_setup_memmap_entries(struct kimage *image, struct boot_params *params)
610 if (ei.size < PAGE_SIZE) 610 if (ei.size < PAGE_SIZE)
611 continue; 611 continue;
612 ei.addr = cmem->ranges[i].start; 612 ei.addr = cmem->ranges[i].start;
613 ei.type = E820_RAM; 613 ei.type = E820_TYPE_RAM;
614 add_e820_entry(params, &ei); 614 add_e820_entry(params, &ei);
615 } 615 }
616 616
diff --git a/arch/x86/kernel/e820.c b/arch/x86/kernel/e820.c
index 79673843dc42..90dcd240a389 100644
--- a/arch/x86/kernel/e820.c
+++ b/arch/x86/kernel/e820.c
@@ -148,14 +148,14 @@ void __init e820__range_add(u64 start, u64 size, enum e820_type type)
148static void __init e820_print_type(enum e820_type type) 148static void __init e820_print_type(enum e820_type type)
149{ 149{
150 switch (type) { 150 switch (type) {
151 case E820_RAM: /* Fall through: */ 151 case E820_TYPE_RAM: /* Fall through: */
152 case E820_RESERVED_KERN: pr_cont("usable"); break; 152 case E820_TYPE_RESERVED_KERN: pr_cont("usable"); break;
153 case E820_RESERVED: pr_cont("reserved"); break; 153 case E820_TYPE_RESERVED: pr_cont("reserved"); break;
154 case E820_ACPI: pr_cont("ACPI data"); break; 154 case E820_TYPE_ACPI: pr_cont("ACPI data"); break;
155 case E820_NVS: pr_cont("ACPI NVS"); break; 155 case E820_TYPE_NVS: pr_cont("ACPI NVS"); break;
156 case E820_UNUSABLE: pr_cont("unusable"); break; 156 case E820_TYPE_UNUSABLE: pr_cont("unusable"); break;
157 case E820_PMEM: /* Fall through: */ 157 case E820_TYPE_PMEM: /* Fall through: */
158 case E820_PRAM: pr_cont("persistent (type %u)", type); break; 158 case E820_TYPE_PRAM: pr_cont("persistent (type %u)", type); break;
159 default: pr_cont("type %u", type); break; 159 default: pr_cont("type %u", type); break;
160 } 160 }
161} 161}
@@ -340,7 +340,7 @@ int __init e820__update_table(struct e820_entry *biosmap, int max_nr_map, u32 *p
340 } 340 }
341 341
342 /* Continue building up new BIOS map based on this information: */ 342 /* Continue building up new BIOS map based on this information: */
343 if (current_type != last_type || current_type == E820_PRAM) { 343 if (current_type != last_type || current_type == E820_TYPE_PRAM) {
344 if (last_type != 0) { 344 if (last_type != 0) {
345 new_bios[new_bios_entry].size = change_point[chgidx]->addr - last_addr; 345 new_bios[new_bios_entry].size = change_point[chgidx]->addr - last_addr;
346 /* Move forward only if the new size was non-zero: */ 346 /* Move forward only if the new size was non-zero: */
@@ -704,7 +704,7 @@ void __init e820_mark_nosave_regions(unsigned long limit_pfn)
704 704
705 pfn = PFN_DOWN(entry->addr + entry->size); 705 pfn = PFN_DOWN(entry->addr + entry->size);
706 706
707 if (entry->type != E820_RAM && entry->type != E820_RESERVED_KERN) 707 if (entry->type != E820_TYPE_RAM && entry->type != E820_TYPE_RESERVED_KERN)
708 register_nosave_region(PFN_UP(entry->addr), pfn); 708 register_nosave_region(PFN_UP(entry->addr), pfn);
709 709
710 if (pfn >= limit_pfn) 710 if (pfn >= limit_pfn)
@@ -724,7 +724,7 @@ static int __init e820_mark_nvs_memory(void)
724 for (i = 0; i < e820_table->nr_entries; i++) { 724 for (i = 0; i < e820_table->nr_entries; i++) {
725 struct e820_entry *entry = &e820_table->entries[i]; 725 struct e820_entry *entry = &e820_table->entries[i];
726 726
727 if (entry->type == E820_NVS) 727 if (entry->type == E820_TYPE_NVS)
728 acpi_nvs_register(entry->addr, entry->size); 728 acpi_nvs_register(entry->addr, entry->size);
729 } 729 }
730 730
@@ -747,7 +747,7 @@ u64 __init e820__memblock_alloc_reserved(u64 size, u64 align)
747 747
748 addr = __memblock_alloc_base(size, align, MEMBLOCK_ALLOC_ACCESSIBLE); 748 addr = __memblock_alloc_base(size, align, MEMBLOCK_ALLOC_ACCESSIBLE);
749 if (addr) { 749 if (addr) {
750 e820__range_update_firmware(addr, size, E820_RAM, E820_RESERVED); 750 e820__range_update_firmware(addr, size, E820_TYPE_RAM, E820_TYPE_RESERVED);
751 pr_info("e820: update e820_table_firmware for e820__memblock_alloc_reserved()\n"); 751 pr_info("e820: update e820_table_firmware for e820__memblock_alloc_reserved()\n");
752 e820__update_table_firmware(); 752 e820__update_table_firmware();
753 } 753 }
@@ -805,12 +805,12 @@ static unsigned long __init e820_end_pfn(unsigned long limit_pfn, enum e820_type
805 805
806unsigned long __init e820_end_of_ram_pfn(void) 806unsigned long __init e820_end_of_ram_pfn(void)
807{ 807{
808 return e820_end_pfn(MAX_ARCH_PFN, E820_RAM); 808 return e820_end_pfn(MAX_ARCH_PFN, E820_TYPE_RAM);
809} 809}
810 810
811unsigned long __init e820_end_of_low_ram_pfn(void) 811unsigned long __init e820_end_of_low_ram_pfn(void)
812{ 812{
813 return e820_end_pfn(1UL << (32 - PAGE_SHIFT), E820_RAM); 813 return e820_end_pfn(1UL << (32 - PAGE_SHIFT), E820_TYPE_RAM);
814} 814}
815 815
816static void __init early_panic(char *msg) 816static void __init early_panic(char *msg)
@@ -846,7 +846,7 @@ static int __init parse_memopt(char *p)
846 if (mem_size == 0) 846 if (mem_size == 0)
847 return -EINVAL; 847 return -EINVAL;
848 848
849 e820__range_remove(mem_size, ULLONG_MAX - mem_size, E820_RAM, 1); 849 e820__range_remove(mem_size, ULLONG_MAX - mem_size, E820_TYPE_RAM, 1);
850 850
851 return 0; 851 return 0;
852} 852}
@@ -882,18 +882,18 @@ static int __init parse_memmap_one(char *p)
882 userdef = 1; 882 userdef = 1;
883 if (*p == '@') { 883 if (*p == '@') {
884 start_at = memparse(p+1, &p); 884 start_at = memparse(p+1, &p);
885 e820__range_add(start_at, mem_size, E820_RAM); 885 e820__range_add(start_at, mem_size, E820_TYPE_RAM);
886 } else if (*p == '#') { 886 } else if (*p == '#') {
887 start_at = memparse(p+1, &p); 887 start_at = memparse(p+1, &p);
888 e820__range_add(start_at, mem_size, E820_ACPI); 888 e820__range_add(start_at, mem_size, E820_TYPE_ACPI);
889 } else if (*p == '$') { 889 } else if (*p == '$') {
890 start_at = memparse(p+1, &p); 890 start_at = memparse(p+1, &p);
891 e820__range_add(start_at, mem_size, E820_RESERVED); 891 e820__range_add(start_at, mem_size, E820_TYPE_RESERVED);
892 } else if (*p == '!') { 892 } else if (*p == '!') {
893 start_at = memparse(p+1, &p); 893 start_at = memparse(p+1, &p);
894 e820__range_add(start_at, mem_size, E820_PRAM); 894 e820__range_add(start_at, mem_size, E820_TYPE_PRAM);
895 } else { 895 } else {
896 e820__range_remove(mem_size, ULLONG_MAX - mem_size, E820_RAM, 1); 896 e820__range_remove(mem_size, ULLONG_MAX - mem_size, E820_TYPE_RAM, 1);
897 } 897 }
898 898
899 return *p == '\0' ? 0 : -EINVAL; 899 return *p == '\0' ? 0 : -EINVAL;
@@ -926,7 +926,7 @@ void __init e820_reserve_setup_data(void)
926 926
927 while (pa_data) { 927 while (pa_data) {
928 data = early_memremap(pa_data, sizeof(*data)); 928 data = early_memremap(pa_data, sizeof(*data));
929 e820__range_update(pa_data, sizeof(*data)+data->len, E820_RAM, E820_RESERVED_KERN); 929 e820__range_update(pa_data, sizeof(*data)+data->len, E820_TYPE_RAM, E820_TYPE_RESERVED_KERN);
930 pa_data = data->next; 930 pa_data = data->next;
931 early_memunmap(data, sizeof(*data)); 931 early_memunmap(data, sizeof(*data));
932 } 932 }
@@ -956,42 +956,42 @@ void __init e820__finish_early_params(void)
956static const char *__init e820_type_to_string(struct e820_entry *entry) 956static const char *__init e820_type_to_string(struct e820_entry *entry)
957{ 957{
958 switch (entry->type) { 958 switch (entry->type) {
959 case E820_RESERVED_KERN: /* Fall-through: */ 959 case E820_TYPE_RESERVED_KERN: /* Fall-through: */
960 case E820_RAM: return "System RAM"; 960 case E820_TYPE_RAM: return "System RAM";
961 case E820_ACPI: return "ACPI Tables"; 961 case E820_TYPE_ACPI: return "ACPI Tables";
962 case E820_NVS: return "ACPI Non-volatile Storage"; 962 case E820_TYPE_NVS: return "ACPI Non-volatile Storage";
963 case E820_UNUSABLE: return "Unusable memory"; 963 case E820_TYPE_UNUSABLE: return "Unusable memory";
964 case E820_PRAM: return "Persistent Memory (legacy)"; 964 case E820_TYPE_PRAM: return "Persistent Memory (legacy)";
965 case E820_PMEM: return "Persistent Memory"; 965 case E820_TYPE_PMEM: return "Persistent Memory";
966 default: return "Reserved"; 966 default: return "Reserved";
967 } 967 }
968} 968}
969 969
970static unsigned long __init e820_type_to_iomem_type(struct e820_entry *entry) 970static unsigned long __init e820_type_to_iomem_type(struct e820_entry *entry)
971{ 971{
972 switch (entry->type) { 972 switch (entry->type) {
973 case E820_RESERVED_KERN: /* Fall-through: */ 973 case E820_TYPE_RESERVED_KERN: /* Fall-through: */
974 case E820_RAM: return IORESOURCE_SYSTEM_RAM; 974 case E820_TYPE_RAM: return IORESOURCE_SYSTEM_RAM;
975 case E820_ACPI: /* Fall-through: */ 975 case E820_TYPE_ACPI: /* Fall-through: */
976 case E820_NVS: /* Fall-through: */ 976 case E820_TYPE_NVS: /* Fall-through: */
977 case E820_UNUSABLE: /* Fall-through: */ 977 case E820_TYPE_UNUSABLE: /* Fall-through: */
978 case E820_PRAM: /* Fall-through: */ 978 case E820_TYPE_PRAM: /* Fall-through: */
979 case E820_PMEM: /* Fall-through: */ 979 case E820_TYPE_PMEM: /* Fall-through: */
980 default: return IORESOURCE_MEM; 980 default: return IORESOURCE_MEM;
981 } 981 }
982} 982}
983 983
984static unsigned long __init e820_type_to_iores_desc(struct e820_entry *entry) 984static unsigned long __init e820_type_to_iores_desc(struct e820_entry *entry)
985{ 985{
986 switch (entry->type) { 986 switch (entry->type) {
987 case E820_ACPI: return IORES_DESC_ACPI_TABLES; 987 case E820_TYPE_ACPI: return IORES_DESC_ACPI_TABLES;
988 case E820_NVS: return IORES_DESC_ACPI_NV_STORAGE; 988 case E820_TYPE_NVS: return IORES_DESC_ACPI_NV_STORAGE;
989 case E820_PMEM: return IORES_DESC_PERSISTENT_MEMORY; 989 case E820_TYPE_PMEM: return IORES_DESC_PERSISTENT_MEMORY;
990 case E820_PRAM: return IORES_DESC_PERSISTENT_MEMORY_LEGACY; 990 case E820_TYPE_PRAM: return IORES_DESC_PERSISTENT_MEMORY_LEGACY;
991 case E820_RESERVED_KERN: /* Fall-through: */ 991 case E820_TYPE_RESERVED_KERN: /* Fall-through: */
992 case E820_RAM: /* Fall-through: */ 992 case E820_TYPE_RAM: /* Fall-through: */
993 case E820_UNUSABLE: /* Fall-through: */ 993 case E820_TYPE_UNUSABLE: /* Fall-through: */
994 default: return IORES_DESC_NONE; 994 default: return IORES_DESC_NONE;
995 } 995 }
996} 996}
997 997
@@ -1006,9 +1006,9 @@ static bool __init do_mark_busy(u32 type, struct resource *res)
1006 * for exclusive use of a driver 1006 * for exclusive use of a driver
1007 */ 1007 */
1008 switch (type) { 1008 switch (type) {
1009 case E820_RESERVED: 1009 case E820_TYPE_RESERVED:
1010 case E820_PRAM: 1010 case E820_TYPE_PRAM:
1011 case E820_PMEM: 1011 case E820_TYPE_PMEM:
1012 return false; 1012 return false;
1013 default: 1013 default:
1014 return true; 1014 return true;
@@ -1102,7 +1102,7 @@ void __init e820_reserve_resources_late(void)
1102 struct e820_entry *entry = &e820_table->entries[i]; 1102 struct e820_entry *entry = &e820_table->entries[i];
1103 u64 start, end; 1103 u64 start, end;
1104 1104
1105 if (entry->type != E820_RAM) 1105 if (entry->type != E820_TYPE_RAM)
1106 continue; 1106 continue;
1107 1107
1108 start = entry->addr + entry->size; 1108 start = entry->addr + entry->size;
@@ -1148,8 +1148,8 @@ char *__init e820__memory_setup_default(void)
1148 } 1148 }
1149 1149
1150 e820_table->nr_entries = 0; 1150 e820_table->nr_entries = 0;
1151 e820__range_add(0, LOWMEMSIZE(), E820_RAM); 1151 e820__range_add(0, LOWMEMSIZE(), E820_TYPE_RAM);
1152 e820__range_add(HIGH_MEMORY, mem_size << 10, E820_RAM); 1152 e820__range_add(HIGH_MEMORY, mem_size << 10, E820_TYPE_RAM);
1153 } 1153 }
1154 1154
1155 return who; 1155 return who;
@@ -1198,7 +1198,7 @@ void __init e820__memblock_setup(void)
1198 if (end != (resource_size_t)end) 1198 if (end != (resource_size_t)end)
1199 continue; 1199 continue;
1200 1200
1201 if (entry->type != E820_RAM && entry->type != E820_RESERVED_KERN) 1201 if (entry->type != E820_TYPE_RAM && entry->type != E820_TYPE_RESERVED_KERN)
1202 continue; 1202 continue;
1203 1203
1204 memblock_add(entry->addr, entry->size); 1204 memblock_add(entry->addr, entry->size);
diff --git a/arch/x86/kernel/early-quirks.c b/arch/x86/kernel/early-quirks.c
index 81a10ab15be9..2220a4c03adf 100644
--- a/arch/x86/kernel/early-quirks.c
+++ b/arch/x86/kernel/early-quirks.c
@@ -546,7 +546,7 @@ intel_graphics_stolen(int num, int slot, int func,
546 &base, &end); 546 &base, &end);
547 547
548 /* Mark this space as reserved */ 548 /* Mark this space as reserved */
549 e820__range_add(base, size, E820_RESERVED); 549 e820__range_add(base, size, E820_TYPE_RESERVED);
550 e820__update_table(e820_table->entries, ARRAY_SIZE(e820_table->entries), &e820_table->nr_entries); 550 e820__update_table(e820_table->entries, ARRAY_SIZE(e820_table->entries), &e820_table->nr_entries);
551} 551}
552 552
diff --git a/arch/x86/kernel/kexec-bzimage64.c b/arch/x86/kernel/kexec-bzimage64.c
index a8c9563557c9..3e43a7d3b191 100644
--- a/arch/x86/kernel/kexec-bzimage64.c
+++ b/arch/x86/kernel/kexec-bzimage64.c
@@ -232,7 +232,7 @@ setup_boot_parameters(struct kimage *image, struct boot_params *params,
232 nr_e820_entries = params->e820_entries; 232 nr_e820_entries = params->e820_entries;
233 233
234 for (i = 0; i < nr_e820_entries; i++) { 234 for (i = 0; i < nr_e820_entries; i++) {
235 if (params->e820_table[i].type != E820_RAM) 235 if (params->e820_table[i].type != E820_TYPE_RAM)
236 continue; 236 continue;
237 start = params->e820_table[i].addr; 237 start = params->e820_table[i].addr;
238 end = params->e820_table[i].addr + params->e820_table[i].size - 1; 238 end = params->e820_table[i].addr + params->e820_table[i].size - 1;
diff --git a/arch/x86/kernel/setup.c b/arch/x86/kernel/setup.c
index 0e70a7bbeeef..074c86a0ee86 100644
--- a/arch/x86/kernel/setup.c
+++ b/arch/x86/kernel/setup.c
@@ -119,7 +119,7 @@
119 * max_low_pfn_mapped: highest direct mapped pfn under 4GB 119 * max_low_pfn_mapped: highest direct mapped pfn under 4GB
120 * max_pfn_mapped: highest direct mapped pfn over 4GB 120 * max_pfn_mapped: highest direct mapped pfn over 4GB
121 * 121 *
122 * The direct mapping only covers E820_RAM regions, so the ranges and gaps are 122 * The direct mapping only covers E820_TYPE_RAM regions, so the ranges and gaps are
123 * represented by pfn_mapped 123 * represented by pfn_mapped
124 */ 124 */
125unsigned long max_low_pfn_mapped; 125unsigned long max_low_pfn_mapped;
@@ -731,14 +731,14 @@ static void __init trim_bios_range(void)
731 * since some BIOSes are known to corrupt low memory. See the 731 * since some BIOSes are known to corrupt low memory. See the
732 * Kconfig help text for X86_RESERVE_LOW. 732 * Kconfig help text for X86_RESERVE_LOW.
733 */ 733 */
734 e820__range_update(0, PAGE_SIZE, E820_RAM, E820_RESERVED); 734 e820__range_update(0, PAGE_SIZE, E820_TYPE_RAM, E820_TYPE_RESERVED);
735 735
736 /* 736 /*
737 * special case: Some BIOSen report the PC BIOS 737 * special case: Some BIOSen report the PC BIOS
738 * area (640->1Mb) as ram even though it is not. 738 * area (640->1Mb) as ram even though it is not.
739 * take them out. 739 * take them out.
740 */ 740 */
741 e820__range_remove(BIOS_BEGIN, BIOS_END - BIOS_BEGIN, E820_RAM, 1); 741 e820__range_remove(BIOS_BEGIN, BIOS_END - BIOS_BEGIN, E820_TYPE_RAM, 1);
742 742
743 e820__update_table(e820_table->entries, ARRAY_SIZE(e820_table->entries), &e820_table->nr_entries); 743 e820__update_table(e820_table->entries, ARRAY_SIZE(e820_table->entries), &e820_table->nr_entries);
744} 744}
@@ -750,18 +750,18 @@ static void __init e820_add_kernel_range(void)
750 u64 size = __pa_symbol(_end) - start; 750 u64 size = __pa_symbol(_end) - start;
751 751
752 /* 752 /*
753 * Complain if .text .data and .bss are not marked as E820_RAM and 753 * Complain if .text .data and .bss are not marked as E820_TYPE_RAM and
754 * attempt to fix it by adding the range. We may have a confused BIOS, 754 * attempt to fix it by adding the range. We may have a confused BIOS,
755 * or the user may have used memmap=exactmap or memmap=xxM$yyM to 755 * or the user may have used memmap=exactmap or memmap=xxM$yyM to
756 * exclude kernel range. If we really are running on top non-RAM, 756 * exclude kernel range. If we really are running on top non-RAM,
757 * we will crash later anyways. 757 * we will crash later anyways.
758 */ 758 */
759 if (e820__mapped_all(start, start + size, E820_RAM)) 759 if (e820__mapped_all(start, start + size, E820_TYPE_RAM))
760 return; 760 return;
761 761
762 pr_warn(".text .data .bss are not marked as E820_RAM!\n"); 762 pr_warn(".text .data .bss are not marked as E820_TYPE_RAM!\n");
763 e820__range_remove(start, size, E820_RAM, 0); 763 e820__range_remove(start, size, E820_TYPE_RAM, 0);
764 e820__range_add(start, size, E820_RAM); 764 e820__range_add(start, size, E820_TYPE_RAM);
765} 765}
766 766
767static unsigned reserve_low = CONFIG_X86_RESERVE_LOW << 10; 767static unsigned reserve_low = CONFIG_X86_RESERVE_LOW << 10;
@@ -1031,8 +1031,8 @@ void __init setup_arch(char **cmdline_p)
1031 trim_bios_range(); 1031 trim_bios_range();
1032#ifdef CONFIG_X86_32 1032#ifdef CONFIG_X86_32
1033 if (ppro_with_ram_bug()) { 1033 if (ppro_with_ram_bug()) {
1034 e820__range_update(0x70000000ULL, 0x40000ULL, E820_RAM, 1034 e820__range_update(0x70000000ULL, 0x40000ULL, E820_TYPE_RAM,
1035 E820_RESERVED); 1035 E820_TYPE_RESERVED);
1036 e820__update_table(e820_table->entries, ARRAY_SIZE(e820_table->entries), &e820_table->nr_entries); 1036 e820__update_table(e820_table->entries, ARRAY_SIZE(e820_table->entries), &e820_table->nr_entries);
1037 printk(KERN_INFO "fixed physical RAM map:\n"); 1037 printk(KERN_INFO "fixed physical RAM map:\n");
1038 e820__print_table("bad_ppro"); 1038 e820__print_table("bad_ppro");
diff --git a/arch/x86/kernel/tboot.c b/arch/x86/kernel/tboot.c
index 0e2dc3831970..ccccd335ae01 100644
--- a/arch/x86/kernel/tboot.c
+++ b/arch/x86/kernel/tboot.c
@@ -69,8 +69,8 @@ void __init tboot_probe(void)
69 * set_fixmap(), to reduce chance of garbage value causing crash 69 * set_fixmap(), to reduce chance of garbage value causing crash
70 */ 70 */
71 if (!e820__mapped_any(boot_params.tboot_addr, 71 if (!e820__mapped_any(boot_params.tboot_addr,
72 boot_params.tboot_addr, E820_RESERVED)) { 72 boot_params.tboot_addr, E820_TYPE_RESERVED)) {
73 pr_warning("non-0 tboot_addr but it is not of type E820_RESERVED\n"); 73 pr_warning("non-0 tboot_addr but it is not of type E820_TYPE_RESERVED\n");
74 return; 74 return;
75 } 75 }
76 76
@@ -189,8 +189,8 @@ static int tboot_setup_sleep(void)
189 tboot->num_mac_regions = 0; 189 tboot->num_mac_regions = 0;
190 190
191 for (i = 0; i < e820_table->nr_entries; i++) { 191 for (i = 0; i < e820_table->nr_entries; i++) {
192 if ((e820_table->entries[i].type != E820_RAM) 192 if ((e820_table->entries[i].type != E820_TYPE_RAM)
193 && (e820_table->entries[i].type != E820_RESERVED_KERN)) 193 && (e820_table->entries[i].type != E820_TYPE_RESERVED_KERN))
194 continue; 194 continue;
195 195
196 add_mac_region(e820_table->entries[i].addr, e820_table->entries[i].size); 196 add_mac_region(e820_table->entries[i].addr, e820_table->entries[i].size);
diff --git a/arch/x86/mm/init.c b/arch/x86/mm/init.c
index 922671d3af85..158dfecdab72 100644
--- a/arch/x86/mm/init.c
+++ b/arch/x86/mm/init.c
@@ -430,7 +430,7 @@ unsigned long __ref init_memory_mapping(unsigned long start,
430 430
431/* 431/*
432 * We need to iterate through the E820 memory map and create direct mappings 432 * We need to iterate through the E820 memory map and create direct mappings
433 * for only E820_RAM and E820_KERN_RESERVED regions. We cannot simply 433 * for only E820_TYPE_RAM and E820_KERN_RESERVED regions. We cannot simply
434 * create direct mappings for all pfns from [0 to max_low_pfn) and 434 * create direct mappings for all pfns from [0 to max_low_pfn) and
435 * [4GB to max_pfn) because of possible memory holes in high addresses 435 * [4GB to max_pfn) because of possible memory holes in high addresses
436 * that cannot be marked as UC by fixed/variable range MTRRs. 436 * that cannot be marked as UC by fixed/variable range MTRRs.
diff --git a/arch/x86/mm/init_64.c b/arch/x86/mm/init_64.c
index cfb119e4c4d1..94e033085f60 100644
--- a/arch/x86/mm/init_64.c
+++ b/arch/x86/mm/init_64.c
@@ -338,9 +338,9 @@ phys_pte_init(pte_t *pte_page, unsigned long paddr, unsigned long paddr_end,
338 if (paddr >= paddr_end) { 338 if (paddr >= paddr_end) {
339 if (!after_bootmem && 339 if (!after_bootmem &&
340 !e820__mapped_any(paddr & PAGE_MASK, paddr_next, 340 !e820__mapped_any(paddr & PAGE_MASK, paddr_next,
341 E820_RAM) && 341 E820_TYPE_RAM) &&
342 !e820__mapped_any(paddr & PAGE_MASK, paddr_next, 342 !e820__mapped_any(paddr & PAGE_MASK, paddr_next,
343 E820_RESERVED_KERN)) 343 E820_TYPE_RESERVED_KERN))
344 set_pte(pte, __pte(0)); 344 set_pte(pte, __pte(0));
345 continue; 345 continue;
346 } 346 }
@@ -393,9 +393,9 @@ phys_pmd_init(pmd_t *pmd_page, unsigned long paddr, unsigned long paddr_end,
393 if (paddr >= paddr_end) { 393 if (paddr >= paddr_end) {
394 if (!after_bootmem && 394 if (!after_bootmem &&
395 !e820__mapped_any(paddr & PMD_MASK, paddr_next, 395 !e820__mapped_any(paddr & PMD_MASK, paddr_next,
396 E820_RAM) && 396 E820_TYPE_RAM) &&
397 !e820__mapped_any(paddr & PMD_MASK, paddr_next, 397 !e820__mapped_any(paddr & PMD_MASK, paddr_next,
398 E820_RESERVED_KERN)) 398 E820_TYPE_RESERVED_KERN))
399 set_pmd(pmd, __pmd(0)); 399 set_pmd(pmd, __pmd(0));
400 continue; 400 continue;
401 } 401 }
@@ -479,9 +479,9 @@ phys_pud_init(pud_t *pud_page, unsigned long paddr, unsigned long paddr_end,
479 if (paddr >= paddr_end) { 479 if (paddr >= paddr_end) {
480 if (!after_bootmem && 480 if (!after_bootmem &&
481 !e820__mapped_any(paddr & PUD_MASK, paddr_next, 481 !e820__mapped_any(paddr & PUD_MASK, paddr_next,
482 E820_RAM) && 482 E820_TYPE_RAM) &&
483 !e820__mapped_any(paddr & PUD_MASK, paddr_next, 483 !e820__mapped_any(paddr & PUD_MASK, paddr_next,
484 E820_RESERVED_KERN)) 484 E820_TYPE_RESERVED_KERN))
485 set_pud(pud, __pud(0)); 485 set_pud(pud, __pud(0));
486 continue; 486 continue;
487 } 487 }
diff --git a/arch/x86/pci/mmconfig-shared.c b/arch/x86/pci/mmconfig-shared.c
index 696b050bdc45..96057e4b6121 100644
--- a/arch/x86/pci/mmconfig-shared.c
+++ b/arch/x86/pci/mmconfig-shared.c
@@ -452,7 +452,7 @@ static int __ref is_mmconf_reserved(check_reserved_t is_reserved,
452 int num_buses; 452 int num_buses;
453 char *method = with_e820 ? "E820" : "ACPI motherboard resources"; 453 char *method = with_e820 ? "E820" : "ACPI motherboard resources";
454 454
455 while (!is_reserved(addr, addr + size, E820_RESERVED)) { 455 while (!is_reserved(addr, addr + size, E820_TYPE_RESERVED)) {
456 size >>= 1; 456 size >>= 1;
457 if (size < (16UL<<20)) 457 if (size < (16UL<<20))
458 break; 458 break;
diff --git a/arch/x86/platform/efi/efi.c b/arch/x86/platform/efi/efi.c
index d97c05ee9664..14d0a6b1eee1 100644
--- a/arch/x86/platform/efi/efi.c
+++ b/arch/x86/platform/efi/efi.c
@@ -140,21 +140,21 @@ static void __init do_add_efi_memmap(void)
140 case EFI_BOOT_SERVICES_DATA: 140 case EFI_BOOT_SERVICES_DATA:
141 case EFI_CONVENTIONAL_MEMORY: 141 case EFI_CONVENTIONAL_MEMORY:
142 if (md->attribute & EFI_MEMORY_WB) 142 if (md->attribute & EFI_MEMORY_WB)
143 e820_type = E820_RAM; 143 e820_type = E820_TYPE_RAM;
144 else 144 else
145 e820_type = E820_RESERVED; 145 e820_type = E820_TYPE_RESERVED;
146 break; 146 break;
147 case EFI_ACPI_RECLAIM_MEMORY: 147 case EFI_ACPI_RECLAIM_MEMORY:
148 e820_type = E820_ACPI; 148 e820_type = E820_TYPE_ACPI;
149 break; 149 break;
150 case EFI_ACPI_MEMORY_NVS: 150 case EFI_ACPI_MEMORY_NVS:
151 e820_type = E820_NVS; 151 e820_type = E820_TYPE_NVS;
152 break; 152 break;
153 case EFI_UNUSABLE_MEMORY: 153 case EFI_UNUSABLE_MEMORY:
154 e820_type = E820_UNUSABLE; 154 e820_type = E820_TYPE_UNUSABLE;
155 break; 155 break;
156 case EFI_PERSISTENT_MEMORY: 156 case EFI_PERSISTENT_MEMORY:
157 e820_type = E820_PMEM; 157 e820_type = E820_TYPE_PMEM;
158 break; 158 break;
159 default: 159 default:
160 /* 160 /*
@@ -162,7 +162,7 @@ static void __init do_add_efi_memmap(void)
162 * EFI_RUNTIME_SERVICES_DATA EFI_MEMORY_MAPPED_IO 162 * EFI_RUNTIME_SERVICES_DATA EFI_MEMORY_MAPPED_IO
163 * EFI_MEMORY_MAPPED_IO_PORT_SPACE EFI_PAL_CODE 163 * EFI_MEMORY_MAPPED_IO_PORT_SPACE EFI_PAL_CODE
164 */ 164 */
165 e820_type = E820_RESERVED; 165 e820_type = E820_TYPE_RESERVED;
166 break; 166 break;
167 } 167 }
168 e820__range_add(start, size, e820_type); 168 e820__range_add(start, size, e820_type);
diff --git a/arch/x86/platform/efi/quirks.c b/arch/x86/platform/efi/quirks.c
index d4acd1668d36..3c8d8e511fd4 100644
--- a/arch/x86/platform/efi/quirks.c
+++ b/arch/x86/platform/efi/quirks.c
@@ -242,14 +242,14 @@ void __init efi_arch_mem_reserve(phys_addr_t addr, u64 size)
242 * else. We must only reserve (and then free) regions: 242 * else. We must only reserve (and then free) regions:
243 * 243 *
244 * - Not within any part of the kernel 244 * - Not within any part of the kernel
245 * - Not the BIOS reserved area (E820_RESERVED, E820_NVS, etc) 245 * - Not the BIOS reserved area (E820_TYPE_RESERVED, E820_TYPE_NVS, etc)
246 */ 246 */
247static bool can_free_region(u64 start, u64 size) 247static bool can_free_region(u64 start, u64 size)
248{ 248{
249 if (start + size > __pa_symbol(_text) && start <= __pa_symbol(_end)) 249 if (start + size > __pa_symbol(_text) && start <= __pa_symbol(_end))
250 return false; 250 return false;
251 251
252 if (!e820__mapped_all(start, start+size, E820_RAM)) 252 if (!e820__mapped_all(start, start+size, E820_TYPE_RAM))
253 return false; 253 return false;
254 254
255 return true; 255 return true;
@@ -282,7 +282,7 @@ void __init efi_reserve_boot_services(void)
282 * A good example of a critical region that must not be 282 * A good example of a critical region that must not be
283 * freed is page zero (first 4Kb of memory), which may 283 * freed is page zero (first 4Kb of memory), which may
284 * contain boot services code/data but is marked 284 * contain boot services code/data but is marked
285 * E820_RESERVED by trim_bios_range(). 285 * E820_TYPE_RESERVED by trim_bios_range().
286 */ 286 */
287 if (!already_reserved) { 287 if (!already_reserved) {
288 memblock_reserve(start, size); 288 memblock_reserve(start, size);
diff --git a/arch/x86/xen/setup.c b/arch/x86/xen/setup.c
index a634723e660f..625ceafeb7a0 100644
--- a/arch/x86/xen/setup.c
+++ b/arch/x86/xen/setup.c
@@ -206,7 +206,7 @@ static unsigned long __init xen_find_pfn_range(unsigned long *min_pfn)
206 unsigned long s_pfn; 206 unsigned long s_pfn;
207 unsigned long e_pfn; 207 unsigned long e_pfn;
208 208
209 if (entry->type != E820_RAM) 209 if (entry->type != E820_TYPE_RAM)
210 continue; 210 continue;
211 211
212 e_pfn = PFN_DOWN(entry->addr + entry->size); 212 e_pfn = PFN_DOWN(entry->addr + entry->size);
@@ -473,11 +473,11 @@ static unsigned long __init xen_foreach_remap_area(unsigned long nr_pages,
473 */ 473 */
474 for (i = 0; i < xen_e820_table_entries; i++, entry++) { 474 for (i = 0; i < xen_e820_table_entries; i++, entry++) {
475 phys_addr_t end = entry->addr + entry->size; 475 phys_addr_t end = entry->addr + entry->size;
476 if (entry->type == E820_RAM || i == xen_e820_table_entries - 1) { 476 if (entry->type == E820_TYPE_RAM || i == xen_e820_table_entries - 1) {
477 unsigned long start_pfn = PFN_DOWN(start); 477 unsigned long start_pfn = PFN_DOWN(start);
478 unsigned long end_pfn = PFN_UP(end); 478 unsigned long end_pfn = PFN_UP(end);
479 479
480 if (entry->type == E820_RAM) 480 if (entry->type == E820_TYPE_RAM)
481 end_pfn = PFN_UP(entry->addr); 481 end_pfn = PFN_UP(entry->addr);
482 482
483 if (start_pfn < end_pfn) 483 if (start_pfn < end_pfn)
@@ -591,7 +591,7 @@ static void __init xen_align_and_add_e820_region(phys_addr_t start,
591 phys_addr_t end = start + size; 591 phys_addr_t end = start + size;
592 592
593 /* Align RAM regions to page boundaries. */ 593 /* Align RAM regions to page boundaries. */
594 if (type == E820_RAM) { 594 if (type == E820_TYPE_RAM) {
595 start = PAGE_ALIGN(start); 595 start = PAGE_ALIGN(start);
596 end &= ~((phys_addr_t)PAGE_SIZE - 1); 596 end &= ~((phys_addr_t)PAGE_SIZE - 1);
597 } 597 }
@@ -605,8 +605,8 @@ static void __init xen_ignore_unusable(void)
605 unsigned int i; 605 unsigned int i;
606 606
607 for (i = 0; i < xen_e820_table_entries; i++, entry++) { 607 for (i = 0; i < xen_e820_table_entries; i++, entry++) {
608 if (entry->type == E820_UNUSABLE) 608 if (entry->type == E820_TYPE_UNUSABLE)
609 entry->type = E820_RAM; 609 entry->type = E820_TYPE_RAM;
610 } 610 }
611} 611}
612 612
@@ -623,7 +623,7 @@ bool __init xen_is_e820_reserved(phys_addr_t start, phys_addr_t size)
623 entry = xen_e820_table; 623 entry = xen_e820_table;
624 624
625 for (mapcnt = 0; mapcnt < xen_e820_table_entries; mapcnt++) { 625 for (mapcnt = 0; mapcnt < xen_e820_table_entries; mapcnt++) {
626 if (entry->type == E820_RAM && entry->addr <= start && 626 if (entry->type == E820_TYPE_RAM && entry->addr <= start &&
627 (entry->addr + entry->size) >= end) 627 (entry->addr + entry->size) >= end)
628 return false; 628 return false;
629 629
@@ -648,7 +648,7 @@ phys_addr_t __init xen_find_free_area(phys_addr_t size)
648 struct e820_entry *entry = xen_e820_table; 648 struct e820_entry *entry = xen_e820_table;
649 649
650 for (mapcnt = 0; mapcnt < xen_e820_table_entries; mapcnt++, entry++) { 650 for (mapcnt = 0; mapcnt < xen_e820_table_entries; mapcnt++, entry++) {
651 if (entry->type != E820_RAM || entry->size < size) 651 if (entry->type != E820_TYPE_RAM || entry->size < size)
652 continue; 652 continue;
653 start = entry->addr; 653 start = entry->addr;
654 for (addr = start; addr < start + size; addr += PAGE_SIZE) { 654 for (addr = start; addr < start + size; addr += PAGE_SIZE) {
@@ -764,7 +764,7 @@ char * __init xen_memory_setup(void)
764 xen_e820_table[0].size = mem_end; 764 xen_e820_table[0].size = mem_end;
765 /* 8MB slack (to balance backend allocations). */ 765 /* 8MB slack (to balance backend allocations). */
766 xen_e820_table[0].size += 8ULL << 20; 766 xen_e820_table[0].size += 8ULL << 20;
767 xen_e820_table[0].type = E820_RAM; 767 xen_e820_table[0].type = E820_TYPE_RAM;
768 rc = 0; 768 rc = 0;
769 } 769 }
770 BUG_ON(rc); 770 BUG_ON(rc);
@@ -819,7 +819,7 @@ char * __init xen_memory_setup(void)
819 chunk_size = size; 819 chunk_size = size;
820 type = xen_e820_table[i].type; 820 type = xen_e820_table[i].type;
821 821
822 if (type == E820_RAM) { 822 if (type == E820_TYPE_RAM) {
823 if (addr < mem_end) { 823 if (addr < mem_end) {
824 chunk_size = min(size, mem_end - addr); 824 chunk_size = min(size, mem_end - addr);
825 } else if (extra_pages) { 825 } else if (extra_pages) {
@@ -859,7 +859,7 @@ char * __init xen_memory_setup(void)
859 * about in there. 859 * about in there.
860 */ 860 */
861 e820__range_add(ISA_START_ADDRESS, ISA_END_ADDRESS - ISA_START_ADDRESS, 861 e820__range_add(ISA_START_ADDRESS, ISA_END_ADDRESS - ISA_START_ADDRESS,
862 E820_RESERVED); 862 E820_TYPE_RESERVED);
863 863
864 e820__update_table(e820_table->entries, ARRAY_SIZE(e820_table->entries), &e820_table->nr_entries); 864 e820__update_table(e820_table->entries, ARRAY_SIZE(e820_table->entries), &e820_table->nr_entries);
865 865
diff --git a/tools/lguest/lguest.c b/tools/lguest/lguest.c
index 3819e23a173e..4e38ea02ef0f 100644
--- a/tools/lguest/lguest.c
+++ b/tools/lguest/lguest.c
@@ -3339,7 +3339,7 @@ int main(int argc, char *argv[])
3339 * simple, single region. 3339 * simple, single region.
3340 */ 3340 */
3341 boot->e820_entries = 1; 3341 boot->e820_entries = 1;
3342 boot->e820_table[0] = ((struct e820_entry) { 0, mem, E820_RAM }); 3342 boot->e820_table[0] = ((struct e820_entry) { 0, mem, E820_TYPE_RAM });
3343 /* 3343 /*
3344 * The boot header contains a command line pointer: we put the command 3344 * The boot header contains a command line pointer: we put the command
3345 * line after the boot header. 3345 * line after the boot header.