From 2b460c53a4cbc8f9541a2960952acff64c68d335 Mon Sep 17 00:00:00 2001 From: Nicolas Planel Date: Thu, 9 Sep 2004 02:41:37 +0000 Subject: add dmi type 6 in detection memory size --- perl-install/c/smp-dmi.c | 29 +++++++++++++++++++++++++++-- 1 file changed, 27 insertions(+), 2 deletions(-) diff --git a/perl-install/c/smp-dmi.c b/perl-install/c/smp-dmi.c index 53cf734cd..c42f83a9c 100644 --- a/perl-install/c/smp-dmi.c +++ b/perl-install/c/smp-dmi.c @@ -219,7 +219,32 @@ static int processor(u8 *data) { return 0; } -static int memory_in_MB(u8 *data) +static int memory_in_MB_type6(u8 *data) +{ + struct dmi_header *dm; + + int dmi_memory_module_size(u8 code) { + /* 3.3.7.2 */ + switch(code&0x7F) { + case 0x7D: /* Not Determinable */ + case 0x7E: /* Disabled */ + case 0x7F: /* Not Installed */ + break; + default: + return 1<<(code&0x7F); + } + return 0; + } + + dm = (struct dmi_header *)data; + + if ((dm->type == 6) && (dm->length >= 0xC)) + return dmi_memory_module_size(data[0x0A]); /* Enabled Size */ + + return 0; +} + +static int memory_in_MB_type17(u8 *data) { struct dmi_header *dm; @@ -271,5 +296,5 @@ int intelDetectSMP(void) { } int dmiDetectMemory(void) { - return dmi_detect(memory_in_MB); + return max(dmi_detect(memory_in_MB_type6), dmi_detect(memory_in_MB_type17)); } -- cgit v1.2.1