dmi.h 640 B

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