diff options
Diffstat (limited to 'arch/x86/include/asm/dmi.h')
-rw-r--r-- | arch/x86/include/asm/dmi.h | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/arch/x86/include/asm/dmi.h b/arch/x86/include/asm/dmi.h new file mode 100644 index 000000000000..bc68212c6bc0 --- /dev/null +++ b/arch/x86/include/asm/dmi.h | |||
@@ -0,0 +1,26 @@ | |||
1 | #ifndef _ASM_X86_DMI_H | ||
2 | #define _ASM_X86_DMI_H | ||
3 | |||
4 | #include <asm/io.h> | ||
5 | |||
6 | #define DMI_MAX_DATA 2048 | ||
7 | |||
8 | extern int dmi_alloc_index; | ||
9 | extern 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. */ | ||
13 | static inline void *dmi_alloc(unsigned len) | ||
14 | { | ||
15 | int idx = dmi_alloc_index; | ||
16 | if ((dmi_alloc_index + len) > DMI_MAX_DATA) | ||
17 | return NULL; | ||
18 | dmi_alloc_index += len; | ||
19 | return dmi_alloc_data + idx; | ||
20 | } | ||
21 | |||
22 | /* Use early IO mappings for DMI because it's initialized early */ | ||
23 | #define dmi_ioremap early_ioremap | ||
24 | #define dmi_iounmap early_iounmap | ||
25 | |||
26 | #endif /* _ASM_X86_DMI_H */ | ||