sched: make early bootup sched_clock() use safer
[wrt350n-kernel.git] / include / asm-x86 / dmi.h
blob1241e6ad1935b99c6273554eb8501f05833b28cb
1 #ifndef _ASM_X86_DMI_H
2 #define _ASM_X86_DMI_H
4 #include <asm/io.h>
6 #ifdef CONFIG_X86_32
8 #define dmi_alloc alloc_bootmem
10 #else /* CONFIG_X86_32 */
12 #define DMI_MAX_DATA 2048
14 extern int dmi_alloc_index;
15 extern char dmi_alloc_data[DMI_MAX_DATA];
17 /* This is so early that there is no good way to allocate dynamic memory.
18 Allocate data in an BSS array. */
19 static inline void *dmi_alloc(unsigned len)
21 int idx = dmi_alloc_index;
22 if ((dmi_alloc_index + len) > DMI_MAX_DATA)
23 return NULL;
24 dmi_alloc_index += len;
25 return dmi_alloc_data + idx;
28 #endif
30 #define dmi_ioremap early_ioremap
31 #define dmi_iounmap early_iounmap
33 #endif