summaryrefslogtreecommitdiffstats
path: root/arch/x86/kernel/e820.c
diff options
context:
space:
mode:
authorPaul Jackson <pj@sgi.com>2008-05-14 08:15:46 -0700
committerThomas Gleixner <tglx@linutronix.de>2008-05-25 10:55:11 +0200
commit6e9bcc796b120d17b08dde7ab958b82ddb899889 (patch)
treee7cecb5a49f875beae9b6aff6bb44777be714430 /arch/x86/kernel/e820.c
parent028b785888c523baccdf27af0cdbf1deb92edec0 (diff)
downloadblackbird-op-linux-6e9bcc796b120d17b08dde7ab958b82ddb899889.tar.gz
blackbird-op-linux-6e9bcc796b120d17b08dde7ab958b82ddb899889.zip
x86 boot: change sanitize_e820_map parameter from byte to int to allow bigger memory maps
The map size counter passed into, and back out of, sanitize_e820_map(), was an eight bit type (char or u8), as derived from its origins in legacy BIOS E820 structures. This patch changes that type to an 'int', to allow this sanitize routine to also be used on larger maps (larger than the 256 count that fits in a char). The legacy BIOS E820 interface of course does not change; that remains at 8 bits for this count, holding up to E820MAX == 128 entries. But the kernel internals can handle more when those additional memory map entries are passed from the BIOS via EFI interfaces. Signed-off-by: Paul Jackson <pj@sgi.com> Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'arch/x86/kernel/e820.c')
-rw-r--r--arch/x86/kernel/e820.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/arch/x86/kernel/e820.c b/arch/x86/kernel/e820.c
index 3f7777b255aa..91abf5b2fb94 100644
--- a/arch/x86/kernel/e820.c
+++ b/arch/x86/kernel/e820.c
@@ -143,7 +143,7 @@ void __init e820_print_map(char *who)
*
*/
int __init sanitize_e820_map(struct e820entry *biosmap, int max_nr_map,
- char *pnr_map)
+ int *pnr_map)
{
struct change_member {
struct e820entry *pbios; /* pointer to original bios entry */
@@ -204,6 +204,7 @@ static struct e820entry new_bios[E820_X_MAX] __initdata;
return -1;
old_nr = *pnr_map;
+ BUG_ON(old_nr > max_nr_map);
/* bail out if we find any unreasonable addresses in bios map */
for (i = 0; i < old_nr; i++)
@@ -401,7 +402,7 @@ u64 __init update_memory_range(u64 start, u64 size, unsigned old_type,
void __init update_e820(void)
{
- u8 nr_map;
+ int nr_map;
nr_map = e820.nr_map;
if (sanitize_e820_map(e820.map, ARRAY_SIZE(e820.map), &nr_map))
OpenPOWER on IntegriCloud