ef3fb66ced
The declaration of dmi helper functions is a bit messy and inconsistent at the moment: * On ia64 they are declared in <asm/io.h>. * On x86-64 they are declared in <asm/dmi.h>. * On i386 they are declared both in <asm/io.h> and <asm/dmi.h>. Fix the header files so that the dmi helper functions are consistently defined in <asm/dmi.h>. Signed-off-by: Jean Delvare <khali@linux-fr.org> Cc: Matt Domsch <Matt_Domsch@dell.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
34 lines
702 B
C
34 lines
702 B
C
#ifndef _ASM_X86_DMI_H
|
|
#define _ASM_X86_DMI_H
|
|
|
|
#include <asm/io.h>
|
|
|
|
#ifdef CONFIG_X86_32
|
|
|
|
#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;
|
|
dmi_alloc_index += len;
|
|
return dmi_alloc_data + idx;
|
|
}
|
|
|
|
#endif
|
|
|
|
/* Use early IO mappings for DMI because it's initialized early */
|
|
#define dmi_ioremap early_ioremap
|
|
#define dmi_iounmap early_iounmap
|
|
|
|
#endif
|