blob: d02e32e3c3f0678d2bbf816d7fd8bc3293f38be3 [file] [log] [blame]
Andi Kleenf2d3efe2006-03-25 16:30:22 +01001#ifndef _ASM_DMI_H
2#define _ASM_DMI_H 1
3
4#include <asm/io.h>
5
Andi Kleenf2d3efe2006-03-25 16:30:22 +01006#define DMI_MAX_DATA 2048
7
8extern int dmi_alloc_index;
9extern char dmi_alloc_data[DMI_MAX_DATA];
10
Yinghai Luaf3e9a22007-07-21 17:10:04 +020011/* This is so early that there is no good way to allocate dynamic memory.
Andi Kleenf2d3efe2006-03-25 16:30:22 +010012 Allocate data in an BSS array. */
13static inline void *dmi_alloc(unsigned len)
14{
15 int idx = dmi_alloc_index;
16 if ((dmi_alloc_index += len) > DMI_MAX_DATA)
17 return NULL;
18 return dmi_alloc_data + idx;
19}
20
21#define dmi_ioremap early_ioremap
22#define dmi_iounmap early_iounmap
23
24#endif