summaryrefslogtreecommitdiffstats
path: root/perl-install/c
diff options
context:
space:
mode:
authorNicolas Planel <nplanel@mandriva.com>2004-09-09 02:41:37 +0000
committerNicolas Planel <nplanel@mandriva.com>2004-09-09 02:41:37 +0000
commit2b460c53a4cbc8f9541a2960952acff64c68d335 (patch)
tree319db767d435fa68ad2cfcc645ae0adc6db9c48e /perl-install/c
parentc3721c8bc40e9538467b5736d3ddce19de58970c (diff)
downloaddrakx-2b460c53a4cbc8f9541a2960952acff64c68d335.tar
drakx-2b460c53a4cbc8f9541a2960952acff64c68d335.tar.gz
drakx-2b460c53a4cbc8f9541a2960952acff64c68d335.tar.bz2
drakx-2b460c53a4cbc8f9541a2960952acff64c68d335.tar.xz
drakx-2b460c53a4cbc8f9541a2960952acff64c68d335.zip
add dmi type 6 in detection memory size
Diffstat (limited to 'perl-install/c')
-rw-r--r--perl-install/c/smp-dmi.c29
1 files 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));
}