Commit 8ec67d97 authored by Ingo Molnar's avatar Ingo Molnar
Browse files

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: default avatarIngo Molnar <mingo@kernel.org>
parent 308bee69
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -34,5 +34,5 @@ Offset Proto Name Meaning
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
				(array of struct e820entry)
				(array of struct e820_entry)
D00/1EC	ALL	eddbuf		EDD data (array of struct edd_info)
+6 −6
Original line number Diff line number Diff line
@@ -900,7 +900,7 @@ static void add_e820ext(struct boot_params *params,
	unsigned long size;

	e820ext->type = SETUP_E820_EXT;
	e820ext->len = nr_entries * sizeof(struct e820entry);
	e820ext->len = nr_entries * sizeof(struct e820_entry);
	e820ext->next = 0;

	data = (struct setup_data *)(unsigned long)params->hdr.setup_data;
@@ -917,9 +917,9 @@ 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 e820entry *e820_map = &params->e820_map[0];
	struct e820_entry *e820_map = &params->e820_map[0];
	struct efi_info *efi = &params->efi_info;
	struct e820entry *prev = NULL;
	struct e820_entry *prev = NULL;
	u32 nr_entries;
	u32 nr_desc;
	int i;
@@ -983,14 +983,14 @@ static efi_status_t setup_e820(struct boot_params *params,
		}

		if (nr_entries == ARRAY_SIZE(params->e820_map)) {
			u32 need = (nr_desc - i) * sizeof(struct e820entry) +
			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 e820entry *)e820ext->data;
			e820_map = (struct e820_entry *)e820ext->data;
		}

		e820_map->addr = d->phys_addr;
@@ -1019,7 +1019,7 @@ static efi_status_t alloc_e820ext(u32 nr_desc, struct setup_data **e820ext,
	unsigned long size;

	size = sizeof(struct setup_data) +
		sizeof(struct e820entry) * nr_desc;
		sizeof(struct e820_entry) * nr_desc;

	if (*e820ext) {
		efi_call_early(free_pool, *e820ext);
+1 −1
Original line number Diff line number Diff line
@@ -426,7 +426,7 @@ static unsigned long slots_fetch_random(void)
	return 0;
}

static void process_e820_entry(struct e820entry *entry,
static void process_e820_entry(struct e820_entry *entry,
			       unsigned long minimum,
			       unsigned long image_size)
{
+2 −2
Original line number Diff line number Diff line
@@ -21,8 +21,8 @@ static int detect_memory_e820(void)
{
	int count = 0;
	struct biosregs ireg, oreg;
	struct e820entry *desc = boot_params.e820_map;
	static struct e820entry buf; /* static so it is zeroed */
	struct e820_entry *desc = boot_params.e820_map;
	static struct e820_entry buf; /* static so it is zeroed */

	initregs(&ireg);
	ireg.ax  = 0xe820;
+3 −3
Original line number Diff line number Diff line
@@ -4,8 +4,8 @@
#include <asm/e820/types.h>

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

extern unsigned long pci_mem_start;

@@ -13,7 +13,7 @@ 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 e820entry *biosmap, int max_nr_map, u32 *pnr_map);
extern int  sanitize_e820_map(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);
Loading