diff options
Diffstat (limited to 'include/asm-x86_64/dmi.h')
-rw-r--r-- | include/asm-x86_64/dmi.h | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/include/asm-x86_64/dmi.h b/include/asm-x86_64/dmi.h new file mode 100644 index 000000000000..93b2b15d4325 --- /dev/null +++ b/include/asm-x86_64/dmi.h | |||
@@ -0,0 +1,27 @@ | |||
1 | #ifndef _ASM_DMI_H | ||
2 | #define _ASM_DMI_H 1 | ||
3 | |||
4 | #include <asm/io.h> | ||
5 | |||
6 | extern void *dmi_ioremap(unsigned long addr, unsigned long size); | ||
7 | extern void dmi_iounmap(void *addr, unsigned long size); | ||
8 | |||
9 | #define DMI_MAX_DATA 2048 | ||
10 | |||
11 | extern int dmi_alloc_index; | ||
12 | extern char dmi_alloc_data[DMI_MAX_DATA]; | ||
13 | |||
14 | /* This is so early that there is no good way to allocate dynamic memory. | ||
15 | Allocate data in an BSS array. */ | ||
16 | static inline void *dmi_alloc(unsigned len) | ||
17 | { | ||
18 | int idx = dmi_alloc_index; | ||
19 | if ((dmi_alloc_index += len) > DMI_MAX_DATA) | ||
20 | return NULL; | ||
21 | return dmi_alloc_data + idx; | ||
22 | } | ||
23 | |||
24 | #define dmi_ioremap early_ioremap | ||
25 | #define dmi_iounmap early_iounmap | ||
26 | |||
27 | #endif | ||