aboutsummaryrefslogtreecommitdiffstats
path: root/arch/x86/include/asm/dmi.h
diff options
context:
space:
mode:
authorJeremy Fitzhardinge <jeremy.fitzhardinge@citrix.com>2009-02-27 16:35:45 -0500
committerH. Peter Anvin <hpa@zytor.com>2009-03-14 20:23:47 -0400
commit6de6cb442e76bbaf2e685150be8ddac0f237a59c (patch)
tree9ba64970ac46472e81ca90448b5e2e22f572144b /arch/x86/include/asm/dmi.h
parentccf3fe02e35f4abca2589f99022cc25084bbd8ae (diff)
x86: use brk allocation for DMI
Impact: use new interface instead of previous ad hoc implementation Use extend_brk() to allocate memory for DMI rather than having an ad-hoc allocator. Signed-off-by: Jeremy Fitzhardinge <jeremy.fitzhardinge@citrix.com> Signed-off-by: H. Peter Anvin <hpa@zytor.com>
Diffstat (limited to 'arch/x86/include/asm/dmi.h')
-rw-r--r--arch/x86/include/asm/dmi.h14
1 files changed, 2 insertions, 12 deletions
diff --git a/arch/x86/include/asm/dmi.h b/arch/x86/include/asm/dmi.h
index bc68212c6bc0..aa32f7e6c197 100644
--- a/arch/x86/include/asm/dmi.h
+++ b/arch/x86/include/asm/dmi.h
@@ -2,21 +2,11 @@
2#define _ASM_X86_DMI_H 2#define _ASM_X86_DMI_H
3 3
4#include <asm/io.h> 4#include <asm/io.h>
5#include <asm/setup.h>
5 6
6#define DMI_MAX_DATA 2048
7
8extern int dmi_alloc_index;
9extern char dmi_alloc_data[DMI_MAX_DATA];
10
11/* This is so early that there is no good way to allocate dynamic memory.
12 Allocate data in an BSS array. */
13static inline void *dmi_alloc(unsigned len) 7static inline void *dmi_alloc(unsigned len)
14{ 8{
15 int idx = dmi_alloc_index; 9 return extend_brk(len, sizeof(int));
16 if ((dmi_alloc_index + len) > DMI_MAX_DATA)
17 return NULL;
18 dmi_alloc_index += len;
19 return dmi_alloc_data + idx;
20} 10}
21 11
22/* Use early IO mappings for DMI because it's initialized early */ 12/* Use early IO mappings for DMI because it's initialized early */