dmi_64.h 515 B

123456789101112131415161718192021222324
  1. #ifndef _ASM_DMI_H
  2. #define _ASM_DMI_H 1
  3. #include <asm/io.h>
  4. #define DMI_MAX_DATA 2048
  5. extern int dmi_alloc_index;
  6. extern char dmi_alloc_data[DMI_MAX_DATA];
  7. /* This is so early that there is no good way to allocate dynamic memory.
  8. Allocate data in an BSS array. */
  9. static inline void *dmi_alloc(unsigned len)
  10. {
  11. int idx = dmi_alloc_index;
  12. if ((dmi_alloc_index += len) > DMI_MAX_DATA)
  13. return NULL;
  14. return dmi_alloc_data + idx;
  15. }
  16. #define dmi_ioremap early_ioremap
  17. #define dmi_iounmap early_iounmap
  18. #endif