Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/drzeus/mmc
[pandora-kernel.git] / include / asm-x86 / dmi.h
1 #ifndef _ASM_X86_DMI_H
2 #define _ASM_X86_DMI_H
3
4 #include <asm/io.h>
5
6 #ifdef CONFIG_X86_32
7
8 /* Use early IO mappings for DMI because it's initialized early */
9 #define dmi_ioremap bt_ioremap
10 #define dmi_iounmap bt_iounmap
11 #define dmi_alloc alloc_bootmem
12
13 #else /* CONFIG_X86_32 */
14
15 #define DMI_MAX_DATA 2048
16
17 extern int dmi_alloc_index;
18 extern char dmi_alloc_data[DMI_MAX_DATA];
19
20 /* This is so early that there is no good way to allocate dynamic memory.
21    Allocate data in an BSS array. */
22 static inline void *dmi_alloc(unsigned len)
23 {
24         int idx = dmi_alloc_index;
25         if ((dmi_alloc_index += len) > DMI_MAX_DATA)
26                 return NULL;
27         return dmi_alloc_data + idx;
28 }
29
30 #define dmi_ioremap early_ioremap
31 #define dmi_iounmap early_iounmap
32
33 #endif
34
35 #endif