]> Pileus Git - ~andy/linux/blobdiff - arch/x86/include/asm/dmi.h
Merge tag 'byteswap-for-linus-20121219' of git://git.infradead.org/users/dwmw2/byteswap
[~andy/linux] / arch / x86 / include / asm / dmi.h
index bc68212c6bc0097f66ae21b936c0af59e4c3f705..fd8f9e2ca35f16ffdac6b9e609be0086ae055803 100644 (file)
@@ -1,22 +1,15 @@
 #ifndef _ASM_X86_DMI_H
 #define _ASM_X86_DMI_H
 
-#include <asm/io.h>
-
-#define DMI_MAX_DATA 2048
+#include <linux/compiler.h>
+#include <linux/init.h>
 
-extern int dmi_alloc_index;
-extern char dmi_alloc_data[DMI_MAX_DATA];
+#include <asm/io.h>
+#include <asm/setup.h>
 
-/* This is so early that there is no good way to allocate dynamic memory.
-   Allocate data in an BSS array. */
-static inline void *dmi_alloc(unsigned len)
+static __always_inline __init void *dmi_alloc(unsigned len)
 {
-       int idx = dmi_alloc_index;
-       if ((dmi_alloc_index + len) > DMI_MAX_DATA)
-               return NULL;
-       dmi_alloc_index += len;
-       return dmi_alloc_data + idx;
+       return extend_brk(len, sizeof(int));
 }
 
 /* Use early IO mappings for DMI because it's initialized early */