fedora core 6 1.2949 + vserver 2.2.0
[linux-2.6.git] / include / asm-x86_64 / dmi.h
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 #ifdef CONFIG_XEN
9 extern void *bt_ioremap(unsigned long addr, unsigned long size);
10 extern void bt_iounmap(void *addr, unsigned long size);
11 #endif
12
13 #define DMI_MAX_DATA 2048
14
15 extern int dmi_alloc_index;
16 extern char dmi_alloc_data[DMI_MAX_DATA];
17
18 /* This is so early that there is no good way to allocate dynamic memory. 
19    Allocate data in an BSS array. */
20 static inline void *dmi_alloc(unsigned len)
21 {
22         int idx = dmi_alloc_index;
23         if ((dmi_alloc_index += len) > DMI_MAX_DATA)
24                 return NULL;
25         return dmi_alloc_data + idx;
26 }
27
28 #ifdef CONFIG_XEN
29 #define dmi_ioremap bt_ioremap
30 #define dmi_iounmap bt_iounmap
31 #else
32 #define dmi_ioremap early_ioremap
33 #define dmi_iounmap early_iounmap
34 #endif
35
36 #endif