Skip to content

Commit

Permalink
x86/boot/e820: Rename 'e820_map' variables to 'e820_array'
Browse files Browse the repository at this point in the history
In line with the rename to 'struct e820_array', harmonize the naming of common e820
table variable names as well:

 e820          =>  e820_array
 e820_saved    =>  e820_array_saved
 e820_map      =>  e820_array
 initial_e820  =>  e820_array_init

This makes the variable names more consistent  and easier to grep for.

No change in functionality.

Cc: Alex Thorlton <[email protected]>
Cc: Andy Lutomirski <[email protected]>
Cc: Borislav Petkov <[email protected]>
Cc: Brian Gerst <[email protected]>
Cc: Dan Williams <[email protected]>
Cc: Denys Vlasenko <[email protected]>
Cc: H. Peter Anvin <[email protected]>
Cc: Huang, Ying <[email protected]>
Cc: Josh Poimboeuf <[email protected]>
Cc: Juergen Gross <[email protected]>
Cc: Linus Torvalds <[email protected]>
Cc: Paul Jackson <[email protected]>
Cc: Peter Zijlstra <[email protected]>
Cc: Rafael J. Wysocki <[email protected]>
Cc: Tejun Heo <[email protected]>
Cc: Thomas Gleixner <[email protected]>
Cc: Wei Yang <[email protected]>
Cc: Yinghai Lu <[email protected]>
Cc: [email protected]
Signed-off-by: Ingo Molnar <[email protected]>
  • Loading branch information
Ingo Molnar committed Jan 28, 2017
1 parent e79d74d commit acd4c04
Show file tree
Hide file tree
Showing 19 changed files with 158 additions and 158 deletions.
4 changes: 2 additions & 2 deletions Documentation/x86/zero-page.txt
Original file line number Diff line number Diff line change
Expand Up @@ -27,12 +27,12 @@ Offset Proto Name Meaning
1C0/020 ALL efi_info EFI 32 information (struct efi_info)
1E0/004 ALL alk_mem_k Alternative mem check, in KB
1E4/004 ALL scratch Scratch field for the kernel setup code
1E8/001 ALL e820_entries Number of entries in e820_map (below)
1E8/001 ALL e820_entries Number of entries in e820_array (below)
1E9/001 ALL eddbuf_entries Number of entries in eddbuf (below)
1EA/001 ALL edd_mbr_sig_buf_entries Number of entries in edd_mbr_sig_buffer
(below)
1EF/001 ALL sentinel Used to detect broken bootloaders
290/040 ALL edd_mbr_sig_buffer EDD MBR signatures
2D0/A00 ALL e820_map E820 memory map table
2D0/A00 ALL e820_array E820 memory map table
(array of struct e820_entry)
D00/1EC ALL eddbuf EDD data (array of struct edd_info)
22 changes: 11 additions & 11 deletions arch/x86/boot/compressed/eboot.c
Original file line number Diff line number Diff line change
Expand Up @@ -917,7 +917,7 @@ static void add_e820ext(struct boot_params *params,
static efi_status_t setup_e820(struct boot_params *params,
struct setup_data *e820ext, u32 e820ext_size)
{
struct e820_entry *e820_map = &params->e820_map[0];
struct e820_entry *e820_array = &params->e820_array[0];
struct efi_info *efi = &params->efi_info;
struct e820_entry *prev = NULL;
u32 nr_entries;
Expand Down Expand Up @@ -982,26 +982,26 @@ static efi_status_t setup_e820(struct boot_params *params,
continue;
}

if (nr_entries == ARRAY_SIZE(params->e820_map)) {
if (nr_entries == ARRAY_SIZE(params->e820_array)) {
u32 need = (nr_desc - i) * sizeof(struct e820_entry) +
sizeof(struct setup_data);

if (!e820ext || e820ext_size < need)
return EFI_BUFFER_TOO_SMALL;

/* boot_params map full, switch to e820 extended */
e820_map = (struct e820_entry *)e820ext->data;
e820_array = (struct e820_entry *)e820ext->data;
}

e820_map->addr = d->phys_addr;
e820_map->size = d->num_pages << PAGE_SHIFT;
e820_map->type = e820_type;
prev = e820_map++;
e820_array->addr = d->phys_addr;
e820_array->size = d->num_pages << PAGE_SHIFT;
e820_array->type = e820_type;
prev = e820_array++;
nr_entries++;
}

if (nr_entries > ARRAY_SIZE(params->e820_map)) {
u32 nr_e820ext = nr_entries - ARRAY_SIZE(params->e820_map);
if (nr_entries > ARRAY_SIZE(params->e820_array)) {
u32 nr_e820ext = nr_entries - ARRAY_SIZE(params->e820_array);

add_e820ext(params, e820ext, nr_e820ext);
nr_entries -= nr_e820ext;
Expand Down Expand Up @@ -1055,9 +1055,9 @@ static efi_status_t exit_boot_func(efi_system_table_t *sys_table_arg,

if (first) {
nr_desc = *map->buff_size / *map->desc_size;
if (nr_desc > ARRAY_SIZE(p->boot_params->e820_map)) {
if (nr_desc > ARRAY_SIZE(p->boot_params->e820_array)) {
u32 nr_e820ext = nr_desc -
ARRAY_SIZE(p->boot_params->e820_map);
ARRAY_SIZE(p->boot_params->e820_array);

status = alloc_e820ext(nr_e820ext, &p->e820ext,
&p->e820ext_size);
Expand Down
2 changes: 1 addition & 1 deletion arch/x86/boot/compressed/kaslr.c
Original file line number Diff line number Diff line change
Expand Up @@ -518,7 +518,7 @@ static unsigned long find_random_phys_addr(unsigned long minimum,

/* Verify potential e820 positions, appending to slots list. */
for (i = 0; i < boot_params->e820_entries; i++) {
process_e820_entry(&boot_params->e820_map[i], minimum,
process_e820_entry(&boot_params->e820_array[i], minimum,
image_size);
if (slot_area_index == MAX_SLOT_AREA) {
debug_putstr("Aborted e820 scan (slot_areas full)!\n");
Expand Down
4 changes: 2 additions & 2 deletions arch/x86/boot/memory.c
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ static int detect_memory_e820(void)
{
int count = 0;
struct biosregs ireg, oreg;
struct e820_entry *desc = boot_params.e820_map;
struct e820_entry *desc = boot_params.e820_array;
static struct e820_entry buf; /* static so it is zeroed */

initregs(&ireg);
Expand Down Expand Up @@ -66,7 +66,7 @@ static int detect_memory_e820(void)

*desc++ = buf;
count++;
} while (ireg.ebx && count < ARRAY_SIZE(boot_params.e820_map));
} while (ireg.ebx && count < ARRAY_SIZE(boot_params.e820_array));

return boot_params.e820_entries = count;
}
Expand Down
6 changes: 3 additions & 3 deletions arch/x86/include/asm/e820/api.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,16 @@
#include <asm/e820/types.h>

/* see comment in arch/x86/kernel/e820.c */
extern struct e820_array *e820;
extern struct e820_array *e820_saved;
extern struct e820_array *e820_array;
extern struct e820_array *e820_array_saved;

extern unsigned long pci_mem_start;

extern int e820_any_mapped(u64 start, u64 end, unsigned type);
extern int e820_all_mapped(u64 start, u64 end, unsigned type);
extern void e820_add_region(u64 start, u64 size, int type);
extern void e820_print_map(char *who);
extern int sanitize_e820_map(struct e820_entry *biosmap, int max_nr_map, u32 *pnr_map);
extern int sanitize_e820_array(struct e820_entry *biosmap, int max_nr_map, u32 *pnr_map);
extern u64 e820_update_range(u64 start, u64 size, unsigned old_type, unsigned new_type);
extern u64 e820_remove_range(u64 start, u64 size, unsigned old_type, int checktype);
extern void update_e820(void);
Expand Down
2 changes: 1 addition & 1 deletion arch/x86/include/asm/e820/types.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
*
* This allows for bootstrap/firmware quirks such as possible duplicate
* E820 entries that might need room in the same arrays, prior to the
* call to sanitize_e820_map() to remove duplicates. The allowance
* call to sanitize_e820_array() to remove duplicates. The allowance
* of three memory map entries per node is "enough" entries for
* the initial hardware platform motivating this mechanism to make
* use of additional EFI map entries. Future platforms may want
Expand Down
2 changes: 1 addition & 1 deletion arch/x86/include/uapi/asm/bootparam.h
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ struct boot_params {
struct setup_header hdr; /* setup header */ /* 0x1f1 */
__u8 _pad7[0x290-0x1f1-sizeof(struct setup_header)];
__u32 edd_mbr_sig_buffer[EDD_MBR_SIG_MAX]; /* 0x290 */
struct e820_entry e820_map[E820MAX]; /* 0x2d0 */
struct e820_entry e820_array[E820MAX]; /* 0x2d0 */
__u8 _pad8[48]; /* 0xcd0 */
struct edd_info eddbuf[EDDMAXNR]; /* 0xd00 */
__u8 _pad9[276]; /* 0xeec */
Expand Down
2 changes: 1 addition & 1 deletion arch/x86/kernel/crash.c
Original file line number Diff line number Diff line change
Expand Up @@ -512,7 +512,7 @@ static int add_e820_entry(struct boot_params *params, struct e820_entry *entry)
if (nr_e820_entries >= E820MAX)
return 1;

memcpy(&params->e820_map[nr_e820_entries], entry,
memcpy(&params->e820_array[nr_e820_entries], entry,
sizeof(struct e820_entry));
params->e820_entries++;
return 0;
Expand Down
Loading

0 comments on commit acd4c04

Please sign in to comment.