Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
at v2.6.26-rc9 34 lines 702 B view raw
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#define dmi_alloc alloc_bootmem 9 10#else /* CONFIG_X86_32 */ 11 12#define DMI_MAX_DATA 2048 13 14extern int dmi_alloc_index; 15extern char dmi_alloc_data[DMI_MAX_DATA]; 16 17/* This is so early that there is no good way to allocate dynamic memory. 18 Allocate data in an BSS array. */ 19static inline void *dmi_alloc(unsigned len) 20{ 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; 26} 27 28#endif 29 30/* Use early IO mappings for DMI because it's initialized early */ 31#define dmi_ioremap early_ioremap 32#define dmi_iounmap early_iounmap 33 34#endif