summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorIngo Molnar <mingo@kernel.org>2017-01-27 06:54:38 -0500
committerIngo Molnar <mingo@kernel.org>2017-01-28 03:33:14 -0500
commit8ec67d97bff592cc5b5325d1ee3646ebd7d635fc (patch)
treed3fe58dd5afef8ec2b5ab259ca79a12e18c58aac
parent308bee698a902dac1d724277e636cd5f9be8cd3b (diff)
x86/boot/e820: Rename the basic e820 data types to 'struct e820_entry' and 'struct e820_array'
The 'e820entry' and 'e820map' names have various annoyances: - the missing underscore departs from the usual kernel style and makes the code look weird, - in the past I kept confusing the 'map' with the 'entry', because a 'map' is ambiguous in that regard, - it's not really clear from the 'e820map' that this is a regular C array. Rename them to 'struct e820_entry' and 'struct e820_array' accordingly. ( Leave the legacy UAPI header alone but do the rename in the bootparam.h and e820/types.h file - outside tools relying on these defines should either adjust their code, or should use the legacy header, or should create their private copies for the definitions. ) 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--Documentation/x86/zero-page.txt2
-rw-r--r--arch/x86/boot/compressed/eboot.c12
-rw-r--r--arch/x86/boot/compressed/kaslr.c2
-rw-r--r--arch/x86/boot/memory.c4
-rw-r--r--arch/x86/include/asm/e820/api.h6
-rw-r--r--arch/x86/include/asm/e820/types.h4
-rw-r--r--arch/x86/include/uapi/asm/bootparam.h2
-rw-r--r--arch/x86/include/uapi/asm/e820/types.h2
-rw-r--r--arch/x86/kernel/crash.c8
-rw-r--r--arch/x86/kernel/e820.c64
-rw-r--r--arch/x86/kernel/kexec-bzimage64.c2
-rw-r--r--arch/x86/kernel/resource.c2
-rw-r--r--arch/x86/kernel/setup.c2
-rw-r--r--arch/x86/power/hibernate_64.c6
-rw-r--r--arch/x86/xen/setup.c12
-rw-r--r--tools/lguest/lguest.c2
16 files changed, 66 insertions, 66 deletions
diff --git a/Documentation/x86/zero-page.txt b/Documentation/x86/zero-page.txt
index 95a4d34af3fd..1746ddcfa50c 100644
--- a/Documentation/x86/zero-page.txt
+++ b/Documentation/x86/zero-page.txt
@@ -34,5 +34,5 @@ Offset Proto Name Meaning
341EF/001 ALL sentinel Used to detect broken bootloaders 341EF/001 ALL sentinel Used to detect broken bootloaders
35290/040 ALL edd_mbr_sig_buffer EDD MBR signatures 35290/040 ALL edd_mbr_sig_buffer EDD MBR signatures
362D0/A00 ALL e820_map E820 memory map table 362D0/A00 ALL e820_map E820 memory map table
37 (array of struct e820entry) 37 (array of struct e820_entry)
38D00/1EC ALL eddbuf EDD data (array of struct edd_info) 38D00/1EC ALL eddbuf EDD data (array of struct edd_info)
diff --git a/arch/x86/boot/compressed/eboot.c b/arch/x86/boot/compressed/eboot.c
index 2066f74cf9b2..e1a3e2cde5cb 100644
--- a/arch/x86/boot/compressed/eboot.c
+++ b/arch/x86/boot/compressed/eboot.c
@@ -900,7 +900,7 @@ static void add_e820ext(struct boot_params *params,
900 unsigned long size; 900 unsigned long size;
901 901
902 e820ext->type = SETUP_E820_EXT; 902 e820ext->type = SETUP_E820_EXT;
903 e820ext->len = nr_entries * sizeof(struct e820entry); 903 e820ext->len = nr_entries * sizeof(struct e820_entry);
904 e820ext->next = 0; 904 e820ext->next = 0;
905 905
906 data = (struct setup_data *)(unsigned long)params->hdr.setup_data; 906 data = (struct setup_data *)(unsigned long)params->hdr.setup_data;
@@ -917,9 +917,9 @@ static void add_e820ext(struct boot_params *params,
917static efi_status_t setup_e820(struct boot_params *params, 917static efi_status_t setup_e820(struct boot_params *params,
918 struct setup_data *e820ext, u32 e820ext_size) 918 struct setup_data *e820ext, u32 e820ext_size)
919{ 919{
920 struct e820entry *e820_map = &params->e820_map[0]; 920 struct e820_entry *e820_map = &params->e820_map[0];
921 struct efi_info *efi = &params->efi_info; 921 struct efi_info *efi = &params->efi_info;
922 struct e820entry *prev = NULL; 922 struct e820_entry *prev = NULL;
923 u32 nr_entries; 923 u32 nr_entries;
924 u32 nr_desc; 924 u32 nr_desc;
925 int i; 925 int i;
@@ -983,14 +983,14 @@ static efi_status_t setup_e820(struct boot_params *params,
983 } 983 }
984 984
985 if (nr_entries == ARRAY_SIZE(params->e820_map)) { 985 if (nr_entries == ARRAY_SIZE(params->e820_map)) {
986 u32 need = (nr_desc - i) * sizeof(struct e820entry) + 986 u32 need = (nr_desc - i) * sizeof(struct e820_entry) +
987 sizeof(struct setup_data); 987 sizeof(struct setup_data);
988 988
989 if (!e820ext || e820ext_size < need) 989 if (!e820ext || e820ext_size < need)
990 return EFI_BUFFER_TOO_SMALL; 990 return EFI_BUFFER_TOO_SMALL;
991 991
992 /* boot_params map full, switch to e820 extended */ 992 /* boot_params map full, switch to e820 extended */
993 e820_map = (struct e820entry *)e820ext->data; 993 e820_map = (struct e820_entry *)e820ext->data;
994 } 994 }
995 995
996 e820_map->addr = d->phys_addr; 996 e820_map->addr = d->phys_addr;
@@ -1019,7 +1019,7 @@ static efi_status_t alloc_e820ext(u32 nr_desc, struct setup_data **e820ext,
1019 unsigned long size; 1019 unsigned long size;
1020 1020
1021 size = sizeof(struct setup_data) + 1021 size = sizeof(struct setup_data) +
1022 sizeof(struct e820entry) * nr_desc; 1022 sizeof(struct e820_entry) * nr_desc;
1023 1023
1024 if (*e820ext) { 1024 if (*e820ext) {
1025 efi_call_early(free_pool, *e820ext); 1025 efi_call_early(free_pool, *e820ext);
diff --git a/arch/x86/boot/compressed/kaslr.c b/arch/x86/boot/compressed/kaslr.c
index 8b7c9e75edcb..17da12e92e99 100644
--- a/arch/x86/boot/compressed/kaslr.c
+++ b/arch/x86/boot/compressed/kaslr.c
@@ -426,7 +426,7 @@ static unsigned long slots_fetch_random(void)
426 return 0; 426 return 0;
427} 427}
428 428
429static void process_e820_entry(struct e820entry *entry, 429static void process_e820_entry(struct e820_entry *entry,
430 unsigned long minimum, 430 unsigned long minimum,
431 unsigned long image_size) 431 unsigned long image_size)
432{ 432{
diff --git a/arch/x86/boot/memory.c b/arch/x86/boot/memory.c
index db75d07c3645..331b3d831cc4 100644
--- a/arch/x86/boot/memory.c
+++ b/arch/x86/boot/memory.c
@@ -21,8 +21,8 @@ static int detect_memory_e820(void)
21{ 21{
22 int count = 0; 22 int count = 0;
23 struct biosregs ireg, oreg; 23 struct biosregs ireg, oreg;
24 struct e820entry *desc = boot_params.e820_map; 24 struct e820_entry *desc = boot_params.e820_map;
25 static struct e820entry buf; /* static so it is zeroed */ 25 static struct e820_entry buf; /* static so it is zeroed */
26 26
27 initregs(&ireg); 27 initregs(&ireg);
28 ireg.ax = 0xe820; 28 ireg.ax = 0xe820;
diff --git a/arch/x86/include/asm/e820/api.h b/arch/x86/include/asm/e820/api.h
index 4163a83f1a37..848b9f61808c 100644
--- a/arch/x86/include/asm/e820/api.h
+++ b/arch/x86/include/asm/e820/api.h
@@ -4,8 +4,8 @@
4#include <asm/e820/types.h> 4#include <asm/e820/types.h>
5 5
6/* see comment in arch/x86/kernel/e820.c */ 6/* see comment in arch/x86/kernel/e820.c */
7extern struct e820map *e820; 7extern struct e820_array *e820;
8extern struct e820map *e820_saved; 8extern struct e820_array *e820_saved;
9 9
10extern unsigned long pci_mem_start; 10extern unsigned long pci_mem_start;
11 11
@@ -13,7 +13,7 @@ extern int e820_any_mapped(u64 start, u64 end, unsigned type);
13extern int e820_all_mapped(u64 start, u64 end, unsigned type); 13extern int e820_all_mapped(u64 start, u64 end, unsigned type);
14extern void e820_add_region(u64 start, u64 size, int type); 14extern void e820_add_region(u64 start, u64 size, int type);
15extern void e820_print_map(char *who); 15extern void e820_print_map(char *who);
16extern int sanitize_e820_map(struct e820entry *biosmap, int max_nr_map, u32 *pnr_map); 16extern int sanitize_e820_map(struct e820_entry *biosmap, int max_nr_map, u32 *pnr_map);
17extern u64 e820_update_range(u64 start, u64 size, unsigned old_type, unsigned new_type); 17extern u64 e820_update_range(u64 start, u64 size, unsigned old_type, unsigned new_type);
18extern u64 e820_remove_range(u64 start, u64 size, unsigned old_type, int checktype); 18extern u64 e820_remove_range(u64 start, u64 size, unsigned old_type, int checktype);
19extern void update_e820(void); 19extern void update_e820(void);
diff --git a/arch/x86/include/asm/e820/types.h b/arch/x86/include/asm/e820/types.h
index ce0e100b843c..05e25cabfafb 100644
--- a/arch/x86/include/asm/e820/types.h
+++ b/arch/x86/include/asm/e820/types.h
@@ -68,9 +68,9 @@
68/* 68/*
69 * The whole array of E820 entries: 69 * The whole array of E820 entries:
70 */ 70 */
71struct e820map { 71struct e820_array {
72 __u32 nr_map; 72 __u32 nr_map;
73 struct e820entry map[E820_X_MAX]; 73 struct e820_entry map[E820_X_MAX];
74}; 74};
75 75
76/* 76/*
diff --git a/arch/x86/include/uapi/asm/bootparam.h b/arch/x86/include/uapi/asm/bootparam.h
index 742333c3ffea..f0a7170d5a9d 100644
--- a/arch/x86/include/uapi/asm/bootparam.h
+++ b/arch/x86/include/uapi/asm/bootparam.h
@@ -152,7 +152,7 @@ struct boot_params {
152 struct setup_header hdr; /* setup header */ /* 0x1f1 */ 152 struct setup_header hdr; /* setup header */ /* 0x1f1 */
153 __u8 _pad7[0x290-0x1f1-sizeof(struct setup_header)]; 153 __u8 _pad7[0x290-0x1f1-sizeof(struct setup_header)];
154 __u32 edd_mbr_sig_buffer[EDD_MBR_SIG_MAX]; /* 0x290 */ 154 __u32 edd_mbr_sig_buffer[EDD_MBR_SIG_MAX]; /* 0x290 */
155 struct e820entry e820_map[E820MAX]; /* 0x2d0 */ 155 struct e820_entry e820_map[E820MAX]; /* 0x2d0 */
156 __u8 _pad8[48]; /* 0xcd0 */ 156 __u8 _pad8[48]; /* 0xcd0 */
157 struct edd_info eddbuf[EDDMAXNR]; /* 0xd00 */ 157 struct edd_info eddbuf[EDDMAXNR]; /* 0xd00 */
158 __u8 _pad9[276]; /* 0xeec */ 158 __u8 _pad9[276]; /* 0xeec */
diff --git a/arch/x86/include/uapi/asm/e820/types.h b/arch/x86/include/uapi/asm/e820/types.h
index 8e522eb120aa..54b812e80bac 100644
--- a/arch/x86/include/uapi/asm/e820/types.h
+++ b/arch/x86/include/uapi/asm/e820/types.h
@@ -10,7 +10,7 @@
10 * A single E820 map entry, describing a memory range of [addr...addr+size-1], 10 * A single E820 map entry, describing a memory range of [addr...addr+size-1],
11 * of 'type' memory type: 11 * of 'type' memory type:
12 */ 12 */
13struct e820entry { 13struct e820_entry {
14 __u64 addr; 14 __u64 addr;
15 __u64 size; 15 __u64 size;
16 __u32 type; 16 __u32 type;
diff --git a/arch/x86/kernel/crash.c b/arch/x86/kernel/crash.c
index 60c018530379..81b67df3b52f 100644
--- a/arch/x86/kernel/crash.c
+++ b/arch/x86/kernel/crash.c
@@ -504,7 +504,7 @@ static int prepare_elf_headers(struct kimage *image, void **addr,
504 return ret; 504 return ret;
505} 505}
506 506
507static int add_e820_entry(struct boot_params *params, struct e820entry *entry) 507static int add_e820_entry(struct boot_params *params, struct e820_entry *entry)
508{ 508{
509 unsigned int nr_e820_entries; 509 unsigned int nr_e820_entries;
510 510
@@ -513,7 +513,7 @@ static int add_e820_entry(struct boot_params *params, struct e820entry *entry)
513 return 1; 513 return 1;
514 514
515 memcpy(&params->e820_map[nr_e820_entries], entry, 515 memcpy(&params->e820_map[nr_e820_entries], entry,
516 sizeof(struct e820entry)); 516 sizeof(struct e820_entry));
517 params->e820_entries++; 517 params->e820_entries++;
518 return 0; 518 return 0;
519} 519}
@@ -522,7 +522,7 @@ static int memmap_entry_callback(u64 start, u64 end, void *arg)
522{ 522{
523 struct crash_memmap_data *cmd = arg; 523 struct crash_memmap_data *cmd = arg;
524 struct boot_params *params = cmd->params; 524 struct boot_params *params = cmd->params;
525 struct e820entry ei; 525 struct e820_entry ei;
526 526
527 ei.addr = start; 527 ei.addr = start;
528 ei.size = end - start + 1; 528 ei.size = end - start + 1;
@@ -561,7 +561,7 @@ int crash_setup_memmap_entries(struct kimage *image, struct boot_params *params)
561{ 561{
562 int i, ret = 0; 562 int i, ret = 0;
563 unsigned long flags; 563 unsigned long flags;
564 struct e820entry ei; 564 struct e820_entry ei;
565 struct crash_memmap_data cmd; 565 struct crash_memmap_data cmd;
566 struct crash_mem *cmem; 566 struct crash_mem *cmem;
567 567
diff --git a/arch/x86/kernel/e820.c b/arch/x86/kernel/e820.c
index 49d54c5002fa..eeb9c9963a6b 100644
--- a/arch/x86/kernel/e820.c
+++ b/arch/x86/kernel/e820.c
@@ -40,10 +40,10 @@
40 * user can e.g. boot the original kernel with mem=1G while still booting the 40 * user can e.g. boot the original kernel with mem=1G while still booting the
41 * next kernel with full memory. 41 * next kernel with full memory.
42 */ 42 */
43static struct e820map initial_e820 __initdata; 43static struct e820_array initial_e820 __initdata;
44static struct e820map initial_e820_saved __initdata; 44static struct e820_array initial_e820_saved __initdata;
45struct e820map *e820 __refdata = &initial_e820; 45struct e820_array *e820 __refdata = &initial_e820;
46struct e820map *e820_saved __refdata = &initial_e820_saved; 46struct e820_array *e820_saved __refdata = &initial_e820_saved;
47 47
48/* For PCI or other memory-mapped resources */ 48/* For PCI or other memory-mapped resources */
49unsigned long pci_mem_start = 0xaeedbabe; 49unsigned long pci_mem_start = 0xaeedbabe;
@@ -61,7 +61,7 @@ e820_any_mapped(u64 start, u64 end, unsigned type)
61 int i; 61 int i;
62 62
63 for (i = 0; i < e820->nr_map; i++) { 63 for (i = 0; i < e820->nr_map; i++) {
64 struct e820entry *ei = &e820->map[i]; 64 struct e820_entry *ei = &e820->map[i];
65 65
66 if (type && ei->type != type) 66 if (type && ei->type != type)
67 continue; 67 continue;
@@ -84,7 +84,7 @@ int __init e820_all_mapped(u64 start, u64 end, unsigned type)
84 int i; 84 int i;
85 85
86 for (i = 0; i < e820->nr_map; i++) { 86 for (i = 0; i < e820->nr_map; i++) {
87 struct e820entry *ei = &e820->map[i]; 87 struct e820_entry *ei = &e820->map[i];
88 88
89 if (type && ei->type != type) 89 if (type && ei->type != type)
90 continue; 90 continue;
@@ -110,7 +110,7 @@ int __init e820_all_mapped(u64 start, u64 end, unsigned type)
110/* 110/*
111 * Add a memory region to the kernel e820 map. 111 * Add a memory region to the kernel e820 map.
112 */ 112 */
113static void __init __e820_add_region(struct e820map *e820x, u64 start, u64 size, 113static void __init __e820_add_region(struct e820_array *e820x, u64 start, u64 size,
114 int type) 114 int type)
115{ 115{
116 int x = e820x->nr_map; 116 int x = e820x->nr_map;
@@ -185,7 +185,7 @@ void __init e820_print_map(char *who)
185 * numbered type. 185 * numbered type.
186 * 186 *
187 * The input parameter biosmap points to an array of 'struct 187 * The input parameter biosmap points to an array of 'struct
188 * e820entry' which on entry has elements in the range [0, *pnr_map) 188 * e820_entry' which on entry has elements in the range [0, *pnr_map)
189 * valid, and which has space for up to max_nr_map entries. 189 * valid, and which has space for up to max_nr_map entries.
190 * On return, the resulting sanitized e820 map entries will be in 190 * On return, the resulting sanitized e820 map entries will be in
191 * overwritten in the same location, starting at biosmap. 191 * overwritten in the same location, starting at biosmap.
@@ -238,7 +238,7 @@ void __init e820_print_map(char *who)
238 * ______________________4_ 238 * ______________________4_
239 */ 239 */
240struct change_member { 240struct change_member {
241 struct e820entry *pbios; /* pointer to original bios entry */ 241 struct e820_entry *pbios; /* pointer to original bios entry */
242 unsigned long long addr; /* address for this change point */ 242 unsigned long long addr; /* address for this change point */
243}; 243};
244 244
@@ -259,13 +259,13 @@ static int __init cpcompare(const void *a, const void *b)
259 return (ap->addr != ap->pbios->addr) - (bp->addr != bp->pbios->addr); 259 return (ap->addr != ap->pbios->addr) - (bp->addr != bp->pbios->addr);
260} 260}
261 261
262int __init sanitize_e820_map(struct e820entry *biosmap, int max_nr_map, 262int __init sanitize_e820_map(struct e820_entry *biosmap, int max_nr_map,
263 u32 *pnr_map) 263 u32 *pnr_map)
264{ 264{
265 static struct change_member change_point_list[2*E820_X_MAX] __initdata; 265 static struct change_member change_point_list[2*E820_X_MAX] __initdata;
266 static struct change_member *change_point[2*E820_X_MAX] __initdata; 266 static struct change_member *change_point[2*E820_X_MAX] __initdata;
267 static struct e820entry *overlap_list[E820_X_MAX] __initdata; 267 static struct e820_entry *overlap_list[E820_X_MAX] __initdata;
268 static struct e820entry new_bios[E820_X_MAX] __initdata; 268 static struct e820_entry new_bios[E820_X_MAX] __initdata;
269 unsigned long current_type, last_type; 269 unsigned long current_type, last_type;
270 unsigned long long last_addr; 270 unsigned long long last_addr;
271 int chgidx; 271 int chgidx;
@@ -379,13 +379,13 @@ int __init sanitize_e820_map(struct e820entry *biosmap, int max_nr_map,
379 new_nr = new_bios_entry; 379 new_nr = new_bios_entry;
380 380
381 /* copy new bios mapping into original location */ 381 /* copy new bios mapping into original location */
382 memcpy(biosmap, new_bios, new_nr * sizeof(struct e820entry)); 382 memcpy(biosmap, new_bios, new_nr * sizeof(struct e820_entry));
383 *pnr_map = new_nr; 383 *pnr_map = new_nr;
384 384
385 return 0; 385 return 0;
386} 386}
387 387
388static int __init __append_e820_map(struct e820entry *biosmap, int nr_map) 388static int __init __append_e820_map(struct e820_entry *biosmap, int nr_map)
389{ 389{
390 while (nr_map) { 390 while (nr_map) {
391 u64 start = biosmap->addr; 391 u64 start = biosmap->addr;
@@ -414,7 +414,7 @@ static int __init __append_e820_map(struct e820entry *biosmap, int nr_map)
414 * will have given us a memory map that we can use to properly 414 * will have given us a memory map that we can use to properly
415 * set up memory. If we aren't, we'll fake a memory map. 415 * set up memory. If we aren't, we'll fake a memory map.
416 */ 416 */
417static int __init append_e820_map(struct e820entry *biosmap, int nr_map) 417static int __init append_e820_map(struct e820_entry *biosmap, int nr_map)
418{ 418{
419 /* Only one memory region (or negative)? Ignore it */ 419 /* Only one memory region (or negative)? Ignore it */
420 if (nr_map < 2) 420 if (nr_map < 2)
@@ -423,7 +423,7 @@ static int __init append_e820_map(struct e820entry *biosmap, int nr_map)
423 return __append_e820_map(biosmap, nr_map); 423 return __append_e820_map(biosmap, nr_map);
424} 424}
425 425
426static u64 __init __e820_update_range(struct e820map *e820x, u64 start, 426static u64 __init __e820_update_range(struct e820_array *e820x, u64 start,
427 u64 size, unsigned old_type, 427 u64 size, unsigned old_type,
428 unsigned new_type) 428 unsigned new_type)
429{ 429{
@@ -445,7 +445,7 @@ static u64 __init __e820_update_range(struct e820map *e820x, u64 start,
445 printk(KERN_CONT "\n"); 445 printk(KERN_CONT "\n");
446 446
447 for (i = 0; i < e820x->nr_map; i++) { 447 for (i = 0; i < e820x->nr_map; i++) {
448 struct e820entry *ei = &e820x->map[i]; 448 struct e820_entry *ei = &e820x->map[i];
449 u64 final_start, final_end; 449 u64 final_start, final_end;
450 u64 ei_end; 450 u64 ei_end;
451 451
@@ -524,7 +524,7 @@ u64 __init e820_remove_range(u64 start, u64 size, unsigned old_type,
524 printk(KERN_CONT "\n"); 524 printk(KERN_CONT "\n");
525 525
526 for (i = 0; i < e820->nr_map; i++) { 526 for (i = 0; i < e820->nr_map; i++) {
527 struct e820entry *ei = &e820->map[i]; 527 struct e820_entry *ei = &e820->map[i];
528 u64 final_start, final_end; 528 u64 final_start, final_end;
529 u64 ei_end; 529 u64 ei_end;
530 530
@@ -535,7 +535,7 @@ u64 __init e820_remove_range(u64 start, u64 size, unsigned old_type,
535 /* totally covered? */ 535 /* totally covered? */
536 if (ei->addr >= start && ei_end <= end) { 536 if (ei->addr >= start && ei_end <= end) {
537 real_removed_size += ei->size; 537 real_removed_size += ei->size;
538 memset(ei, 0, sizeof(struct e820entry)); 538 memset(ei, 0, sizeof(struct e820_entry));
539 continue; 539 continue;
540 } 540 }
541 541
@@ -658,16 +658,16 @@ __init void e820_setup_gap(void)
658 */ 658 */
659__init void e820_reallocate_tables(void) 659__init void e820_reallocate_tables(void)
660{ 660{
661 struct e820map *n; 661 struct e820_array *n;
662 int size; 662 int size;
663 663
664 size = offsetof(struct e820map, map) + sizeof(struct e820entry) * e820->nr_map; 664 size = offsetof(struct e820_array, map) + sizeof(struct e820_entry) * e820->nr_map;
665 n = kmalloc(size, GFP_KERNEL); 665 n = kmalloc(size, GFP_KERNEL);
666 BUG_ON(!n); 666 BUG_ON(!n);
667 memcpy(n, e820, size); 667 memcpy(n, e820, size);
668 e820 = n; 668 e820 = n;
669 669
670 size = offsetof(struct e820map, map) + sizeof(struct e820entry) * e820_saved->nr_map; 670 size = offsetof(struct e820_array, map) + sizeof(struct e820_entry) * e820_saved->nr_map;
671 n = kmalloc(size, GFP_KERNEL); 671 n = kmalloc(size, GFP_KERNEL);
672 BUG_ON(!n); 672 BUG_ON(!n);
673 memcpy(n, e820_saved, size); 673 memcpy(n, e820_saved, size);
@@ -683,12 +683,12 @@ __init void e820_reallocate_tables(void)
683void __init parse_e820_ext(u64 phys_addr, u32 data_len) 683void __init parse_e820_ext(u64 phys_addr, u32 data_len)
684{ 684{
685 int entries; 685 int entries;
686 struct e820entry *extmap; 686 struct e820_entry *extmap;
687 struct setup_data *sdata; 687 struct setup_data *sdata;
688 688
689 sdata = early_memremap(phys_addr, data_len); 689 sdata = early_memremap(phys_addr, data_len);
690 entries = sdata->len / sizeof(struct e820entry); 690 entries = sdata->len / sizeof(struct e820_entry);
691 extmap = (struct e820entry *)(sdata->data); 691 extmap = (struct e820_entry *)(sdata->data);
692 __append_e820_map(extmap, entries); 692 __append_e820_map(extmap, entries);
693 sanitize_e820_map(e820->map, ARRAY_SIZE(e820->map), &e820->nr_map); 693 sanitize_e820_map(e820->map, ARRAY_SIZE(e820->map), &e820->nr_map);
694 early_memunmap(sdata, data_len); 694 early_memunmap(sdata, data_len);
@@ -712,7 +712,7 @@ void __init e820_mark_nosave_regions(unsigned long limit_pfn)
712 unsigned long pfn = 0; 712 unsigned long pfn = 0;
713 713
714 for (i = 0; i < e820->nr_map; i++) { 714 for (i = 0; i < e820->nr_map; i++) {
715 struct e820entry *ei = &e820->map[i]; 715 struct e820_entry *ei = &e820->map[i];
716 716
717 if (pfn < PFN_UP(ei->addr)) 717 if (pfn < PFN_UP(ei->addr))
718 register_nosave_region(pfn, PFN_UP(ei->addr)); 718 register_nosave_region(pfn, PFN_UP(ei->addr));
@@ -738,7 +738,7 @@ static int __init e820_mark_nvs_memory(void)
738 int i; 738 int i;
739 739
740 for (i = 0; i < e820->nr_map; i++) { 740 for (i = 0; i < e820->nr_map; i++) {
741 struct e820entry *ei = &e820->map[i]; 741 struct e820_entry *ei = &e820->map[i];
742 742
743 if (ei->type == E820_NVS) 743 if (ei->type == E820_NVS)
744 acpi_nvs_register(ei->addr, ei->size); 744 acpi_nvs_register(ei->addr, ei->size);
@@ -786,7 +786,7 @@ static unsigned long __init e820_end_pfn(unsigned long limit_pfn, unsigned type)
786 unsigned long max_arch_pfn = MAX_ARCH_PFN; 786 unsigned long max_arch_pfn = MAX_ARCH_PFN;
787 787
788 for (i = 0; i < e820->nr_map; i++) { 788 for (i = 0; i < e820->nr_map; i++) {
789 struct e820entry *ei = &e820->map[i]; 789 struct e820_entry *ei = &e820->map[i];
790 unsigned long start_pfn; 790 unsigned long start_pfn;
791 unsigned long end_pfn; 791 unsigned long end_pfn;
792 792
@@ -1040,7 +1040,7 @@ void __init e820_reserve_resources(void)
1040 } 1040 }
1041 1041
1042 for (i = 0; i < e820_saved->nr_map; i++) { 1042 for (i = 0; i < e820_saved->nr_map; i++) {
1043 struct e820entry *entry = &e820_saved->map[i]; 1043 struct e820_entry *entry = &e820_saved->map[i];
1044 firmware_map_add_early(entry->addr, 1044 firmware_map_add_early(entry->addr,
1045 entry->addr + entry->size, 1045 entry->addr + entry->size,
1046 e820_type_to_string(entry->type)); 1046 e820_type_to_string(entry->type));
@@ -1083,7 +1083,7 @@ void __init e820_reserve_resources_late(void)
1083 * avoid stolen RAM: 1083 * avoid stolen RAM:
1084 */ 1084 */
1085 for (i = 0; i < e820->nr_map; i++) { 1085 for (i = 0; i < e820->nr_map; i++) {
1086 struct e820entry *entry = &e820->map[i]; 1086 struct e820_entry *entry = &e820->map[i];
1087 u64 start, end; 1087 u64 start, end;
1088 1088
1089 if (entry->type != E820_RAM) 1089 if (entry->type != E820_RAM)
@@ -1145,7 +1145,7 @@ void __init setup_memory_map(void)
1145 char *who; 1145 char *who;
1146 1146
1147 who = x86_init.resources.memory_setup(); 1147 who = x86_init.resources.memory_setup();
1148 memcpy(e820_saved, e820, sizeof(struct e820map)); 1148 memcpy(e820_saved, e820, sizeof(struct e820_array));
1149 printk(KERN_INFO "e820: BIOS-provided physical RAM map:\n"); 1149 printk(KERN_INFO "e820: BIOS-provided physical RAM map:\n");
1150 e820_print_map(who); 1150 e820_print_map(who);
1151} 1151}
@@ -1163,7 +1163,7 @@ void __init memblock_x86_fill(void)
1163 memblock_allow_resize(); 1163 memblock_allow_resize();
1164 1164
1165 for (i = 0; i < e820->nr_map; i++) { 1165 for (i = 0; i < e820->nr_map; i++) {
1166 struct e820entry *ei = &e820->map[i]; 1166 struct e820_entry *ei = &e820->map[i];
1167 1167
1168 end = ei->addr + ei->size; 1168 end = ei->addr + ei->size;
1169 if (end != (resource_size_t)end) 1169 if (end != (resource_size_t)end)
diff --git a/arch/x86/kernel/kexec-bzimage64.c b/arch/x86/kernel/kexec-bzimage64.c
index 2f4a3c8127f6..d70e8d65cc16 100644
--- a/arch/x86/kernel/kexec-bzimage64.c
+++ b/arch/x86/kernel/kexec-bzimage64.c
@@ -108,7 +108,7 @@ static int setup_e820_entries(struct boot_params *params)
108 108
109 params->e820_entries = nr_e820_entries; 109 params->e820_entries = nr_e820_entries;
110 memcpy(&params->e820_map, &e820_saved->map, 110 memcpy(&params->e820_map, &e820_saved->map,
111 nr_e820_entries * sizeof(struct e820entry)); 111 nr_e820_entries * sizeof(struct e820_entry));
112 112
113 return 0; 113 return 0;
114} 114}
diff --git a/arch/x86/kernel/resource.c b/arch/x86/kernel/resource.c
index eb2021659c9e..06a6e8049070 100644
--- a/arch/x86/kernel/resource.c
+++ b/arch/x86/kernel/resource.c
@@ -25,7 +25,7 @@ static void resource_clip(struct resource *res, resource_size_t start,
25static void remove_e820_regions(struct resource *avail) 25static void remove_e820_regions(struct resource *avail)
26{ 26{
27 int i; 27 int i;
28 struct e820entry *entry; 28 struct e820_entry *entry;
29 29
30 for (i = 0; i < e820->nr_map; i++) { 30 for (i = 0; i < e820->nr_map; i++) {
31 entry = &e820->map[i]; 31 entry = &e820->map[i];
diff --git a/arch/x86/kernel/setup.c b/arch/x86/kernel/setup.c
index 6e521831f6ba..d2bdda9c3d6f 100644
--- a/arch/x86/kernel/setup.c
+++ b/arch/x86/kernel/setup.c
@@ -459,7 +459,7 @@ static void __init e820_reserve_setup_data(void)
459 } 459 }
460 460
461 sanitize_e820_map(e820->map, ARRAY_SIZE(e820->map), &e820->nr_map); 461 sanitize_e820_map(e820->map, ARRAY_SIZE(e820->map), &e820->nr_map);
462 memcpy(e820_saved, e820, sizeof(struct e820map)); 462 memcpy(e820_saved, e820, sizeof(struct e820_array));
463 printk(KERN_INFO "extended physical RAM map:\n"); 463 printk(KERN_INFO "extended physical RAM map:\n");
464 e820_print_map("reserve setup_data"); 464 e820_print_map("reserve setup_data");
465} 465}
diff --git a/arch/x86/power/hibernate_64.c b/arch/x86/power/hibernate_64.c
index 13e87bf86043..874aea614fcf 100644
--- a/arch/x86/power/hibernate_64.c
+++ b/arch/x86/power/hibernate_64.c
@@ -201,7 +201,7 @@ struct restore_data_record {
201 * @map: the e820 map to be calculated 201 * @map: the e820 map to be calculated
202 * @buf: the md5 result to be stored to 202 * @buf: the md5 result to be stored to
203 */ 203 */
204static int get_e820_md5(struct e820map *map, void *buf) 204static int get_e820_md5(struct e820_array *map, void *buf)
205{ 205{
206 struct scatterlist sg; 206 struct scatterlist sg;
207 struct crypto_ahash *tfm; 207 struct crypto_ahash *tfm;
@@ -214,8 +214,8 @@ static int get_e820_md5(struct e820map *map, void *buf)
214 214
215 { 215 {
216 AHASH_REQUEST_ON_STACK(req, tfm); 216 AHASH_REQUEST_ON_STACK(req, tfm);
217 size = offsetof(struct e820map, map) 217 size = offsetof(struct e820_array, map)
218 + sizeof(struct e820entry) * map->nr_map; 218 + sizeof(struct e820_entry) * map->nr_map;
219 ahash_request_set_tfm(req, tfm); 219 ahash_request_set_tfm(req, tfm);
220 sg_init_one(&sg, (u8 *)map, size); 220 sg_init_one(&sg, (u8 *)map, size);
221 ahash_request_set_callback(req, 0, NULL, NULL); 221 ahash_request_set_callback(req, 0, NULL, NULL);
diff --git a/arch/x86/xen/setup.c b/arch/x86/xen/setup.c
index dd6ec15f91d4..7386a6e4c072 100644
--- a/arch/x86/xen/setup.c
+++ b/arch/x86/xen/setup.c
@@ -41,7 +41,7 @@ struct xen_memory_region xen_extra_mem[XEN_EXTRA_MEM_MAX_REGIONS] __initdata;
41unsigned long xen_released_pages; 41unsigned long xen_released_pages;
42 42
43/* E820 map used during setting up memory. */ 43/* E820 map used during setting up memory. */
44static struct e820entry xen_e820_map[E820_X_MAX] __initdata; 44static struct e820_entry xen_e820_map[E820_X_MAX] __initdata;
45static u32 xen_e820_map_entries __initdata; 45static u32 xen_e820_map_entries __initdata;
46 46
47/* 47/*
@@ -198,7 +198,7 @@ void __init xen_inv_extra_mem(void)
198 */ 198 */
199static unsigned long __init xen_find_pfn_range(unsigned long *min_pfn) 199static unsigned long __init xen_find_pfn_range(unsigned long *min_pfn)
200{ 200{
201 const struct e820entry *entry = xen_e820_map; 201 const struct e820_entry *entry = xen_e820_map;
202 unsigned int i; 202 unsigned int i;
203 unsigned long done = 0; 203 unsigned long done = 0;
204 204
@@ -457,7 +457,7 @@ static unsigned long __init xen_foreach_remap_area(unsigned long nr_pages,
457{ 457{
458 phys_addr_t start = 0; 458 phys_addr_t start = 0;
459 unsigned long ret_val = 0; 459 unsigned long ret_val = 0;
460 const struct e820entry *entry = xen_e820_map; 460 const struct e820_entry *entry = xen_e820_map;
461 int i; 461 int i;
462 462
463 /* 463 /*
@@ -601,7 +601,7 @@ static void __init xen_align_and_add_e820_region(phys_addr_t start,
601 601
602static void __init xen_ignore_unusable(void) 602static void __init xen_ignore_unusable(void)
603{ 603{
604 struct e820entry *entry = xen_e820_map; 604 struct e820_entry *entry = xen_e820_map;
605 unsigned int i; 605 unsigned int i;
606 606
607 for (i = 0; i < xen_e820_map_entries; i++, entry++) { 607 for (i = 0; i < xen_e820_map_entries; i++, entry++) {
@@ -612,7 +612,7 @@ static void __init xen_ignore_unusable(void)
612 612
613bool __init xen_is_e820_reserved(phys_addr_t start, phys_addr_t size) 613bool __init xen_is_e820_reserved(phys_addr_t start, phys_addr_t size)
614{ 614{
615 struct e820entry *entry; 615 struct e820_entry *entry;
616 unsigned mapcnt; 616 unsigned mapcnt;
617 phys_addr_t end; 617 phys_addr_t end;
618 618
@@ -645,7 +645,7 @@ phys_addr_t __init xen_find_free_area(phys_addr_t size)
645{ 645{
646 unsigned mapcnt; 646 unsigned mapcnt;
647 phys_addr_t addr, start; 647 phys_addr_t addr, start;
648 struct e820entry *entry = xen_e820_map; 648 struct e820_entry *entry = xen_e820_map;
649 649
650 for (mapcnt = 0; mapcnt < xen_e820_map_entries; mapcnt++, entry++) { 650 for (mapcnt = 0; mapcnt < xen_e820_map_entries; mapcnt++, entry++) {
651 if (entry->type != E820_RAM || entry->size < size) 651 if (entry->type != E820_RAM || entry->size < size)
diff --git a/tools/lguest/lguest.c b/tools/lguest/lguest.c
index 11c8d9bc762e..7deb8d4a976e 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_map[0] = ((struct e820entry) { 0, mem, E820_RAM }); 3342 boot->e820_map[0] = ((struct e820_entry) { 0, mem, E820_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.