diff --git a/include/asm-x86/dmi.h b/include/asm-x86/dmi.h index c9e4e8ebc2708611c18bf367ffe94cad1e64fed9..8e2b0e6aa8e7eb81687f4861758a141084c5402e 100644 --- a/include/asm-x86/dmi.h +++ b/include/asm-x86/dmi.h @@ -1,5 +1,35 @@ +#ifndef _ASM_X86_DMI_H +#define _ASM_X86_DMI_H + +#include + #ifdef CONFIG_X86_32 -# include "dmi_32.h" -#else -# include "dmi_64.h" + +/* Use early IO mappings for DMI because it's initialized early */ +#define dmi_ioremap bt_ioremap +#define dmi_iounmap bt_iounmap +#define dmi_alloc alloc_bootmem + +#else /* CONFIG_X86_32 */ + +#define DMI_MAX_DATA 2048 + +extern int dmi_alloc_index; +extern char dmi_alloc_data[DMI_MAX_DATA]; + +/* 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) +{ + int idx = dmi_alloc_index; + if ((dmi_alloc_index += len) > DMI_MAX_DATA) + return NULL; + return dmi_alloc_data + idx; +} + +#define dmi_ioremap early_ioremap +#define dmi_iounmap early_iounmap + +#endif + #endif diff --git a/include/asm-x86/dmi_32.h b/include/asm-x86/dmi_32.h deleted file mode 100644 index 38d4eeb7fc7ec01a1584672119528ffc5ef57f01..0000000000000000000000000000000000000000 --- a/include/asm-x86/dmi_32.h +++ /dev/null @@ -1,11 +0,0 @@ -#ifndef _ASM_DMI_H -#define _ASM_DMI_H 1 - -#include - -/* Use early IO mappings for DMI because it's initialized early */ -#define dmi_ioremap bt_ioremap -#define dmi_iounmap bt_iounmap -#define dmi_alloc alloc_bootmem - -#endif diff --git a/include/asm-x86/dmi_64.h b/include/asm-x86/dmi_64.h deleted file mode 100644 index d02e32e3c3f0678d2bbf816d7fd8bc3293f38be3..0000000000000000000000000000000000000000 --- a/include/asm-x86/dmi_64.h +++ /dev/null @@ -1,24 +0,0 @@ -#ifndef _ASM_DMI_H -#define _ASM_DMI_H 1 - -#include - -#define DMI_MAX_DATA 2048 - -extern int dmi_alloc_index; -extern char dmi_alloc_data[DMI_MAX_DATA]; - -/* 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) -{ - int idx = dmi_alloc_index; - if ((dmi_alloc_index += len) > DMI_MAX_DATA) - return NULL; - return dmi_alloc_data + idx; -} - -#define dmi_ioremap early_ioremap -#define dmi_iounmap early_iounmap - -#endif