aboutsummaryrefslogtreecommitdiffstats
path: root/arch/i386/kernel/dmi_scan.c
diff options
context:
space:
mode:
authorAndi Kleen <ak@suse.de>2006-01-11 16:43:33 -0500
committerLinus Torvalds <torvalds@g5.osdl.org>2006-01-11 22:04:51 -0500
commite99286744599a66195de4cd975d7ef4d643c2789 (patch)
treed231b075c9bdb0bd7fa48d0eb00551a529e4586a /arch/i386/kernel/dmi_scan.c
parentb347d25fbc4616f4f37895e9afbe25b2bbc7e11f (diff)
[PATCH] x86_64: Generalize DMI and enable for x86-64
Some people need it now on 64bit so reuse the i386 code for x86-64. This will be also useful for future bug workarounds. It is a bit simplified there because there is no need to do it very early on x86-64. This means it doesn't need early ioremap et.al. We run it as a core initcall right now. I hope it's not needed for early setup. I added a general CONFIG_DMI symbol in case IA64 or someone else wants to reuse the code later too. Signed-off-by: Andi Kleen <ak@suse.de> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'arch/i386/kernel/dmi_scan.c')
-rw-r--r--arch/i386/kernel/dmi_scan.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/arch/i386/kernel/dmi_scan.c b/arch/i386/kernel/dmi_scan.c
index 58516e2ac17..6a93d75db43 100644
--- a/arch/i386/kernel/dmi_scan.c
+++ b/arch/i386/kernel/dmi_scan.c
@@ -4,7 +4,7 @@
4#include <linux/module.h> 4#include <linux/module.h>
5#include <linux/dmi.h> 5#include <linux/dmi.h>
6#include <linux/bootmem.h> 6#include <linux/bootmem.h>
7 7#include <linux/slab.h>
8 8
9static char * __init dmi_string(struct dmi_header *dm, u8 s) 9static char * __init dmi_string(struct dmi_header *dm, u8 s)
10{ 10{
@@ -19,7 +19,7 @@ static char * __init dmi_string(struct dmi_header *dm, u8 s)
19 } 19 }
20 20
21 if (*bp != 0) { 21 if (*bp != 0) {
22 str = alloc_bootmem(strlen(bp) + 1); 22 str = dmi_alloc(strlen(bp) + 1);
23 if (str != NULL) 23 if (str != NULL)
24 strcpy(str, bp); 24 strcpy(str, bp);
25 else 25 else
@@ -40,7 +40,7 @@ static int __init dmi_table(u32 base, int len, int num,
40 u8 *buf, *data; 40 u8 *buf, *data;
41 int i = 0; 41 int i = 0;
42 42
43 buf = bt_ioremap(base, len); 43 buf = dmi_ioremap(base, len);
44 if (buf == NULL) 44 if (buf == NULL)
45 return -1; 45 return -1;
46 46
@@ -65,7 +65,7 @@ static int __init dmi_table(u32 base, int len, int num,
65 data += 2; 65 data += 2;
66 i++; 66 i++;
67 } 67 }
68 bt_iounmap(buf, len); 68 dmi_iounmap(buf, len);
69 return 0; 69 return 0;
70} 70}
71 71
@@ -112,7 +112,7 @@ static void __init dmi_save_devices(struct dmi_header *dm)
112 if ((*d & 0x80) == 0) 112 if ((*d & 0x80) == 0)
113 continue; 113 continue;
114 114
115 dev = alloc_bootmem(sizeof(*dev)); 115 dev = dmi_alloc(sizeof(*dev));
116 if (!dev) { 116 if (!dev) {
117 printk(KERN_ERR "dmi_save_devices: out of memory.\n"); 117 printk(KERN_ERR "dmi_save_devices: out of memory.\n");
118 break; 118 break;
@@ -131,7 +131,7 @@ static void __init dmi_save_ipmi_device(struct dmi_header *dm)
131 struct dmi_device *dev; 131 struct dmi_device *dev;
132 void * data; 132 void * data;
133 133
134 data = alloc_bootmem(dm->length); 134 data = dmi_alloc(dm->length);
135 if (data == NULL) { 135 if (data == NULL) {
136 printk(KERN_ERR "dmi_save_ipmi_device: out of memory.\n"); 136 printk(KERN_ERR "dmi_save_ipmi_device: out of memory.\n");
137 return; 137 return;
@@ -139,7 +139,7 @@ static void __init dmi_save_ipmi_device(struct dmi_header *dm)
139 139
140 memcpy(data, dm, dm->length); 140 memcpy(data, dm, dm->length);
141 141
142 dev = alloc_bootmem(sizeof(*dev)); 142 dev = dmi_alloc(sizeof(*dev));
143 if (!dev) { 143 if (!dev) {
144 printk(KERN_ERR "dmi_save_ipmi_device: out of memory.\n"); 144 printk(KERN_ERR "dmi_save_ipmi_device: out of memory.\n");
145 return; 145 return;
@@ -221,7 +221,7 @@ void __init dmi_scan_machine(void)
221 } 221 }
222 } 222 }
223 223
224out: printk(KERN_INFO "DMI not present.\n"); 224out: printk(KERN_INFO "DMI not present or invalid.\n");
225} 225}
226 226
227 227