dmi.h 740 B

1234567891011121314151617181920212223242526272829303132333435
  1. #ifndef _ASM_X86_DMI_H
  2. #define _ASM_X86_DMI_H
  3. #include <asm/io.h>
  4. #ifdef CONFIG_X86_32
  5. /* Use early IO mappings for DMI because it's initialized early */
  6. #define dmi_ioremap bt_ioremap
  7. #define dmi_iounmap bt_iounmap
  8. #define dmi_alloc alloc_bootmem
  9. #else /* CONFIG_X86_32 */
  10. #define DMI_MAX_DATA 2048
  11. extern int dmi_alloc_index;
  12. extern char dmi_alloc_data[DMI_MAX_DATA];
  13. /* This is so early that there is no good way to allocate dynamic memory.
  14. Allocate data in an BSS array. */
  15. static inline void *dmi_alloc(unsigned len)
  16. {
  17. int idx = dmi_alloc_index;
  18. if ((dmi_alloc_index += len) > DMI_MAX_DATA)
  19. return NULL;
  20. return dmi_alloc_data + idx;
  21. }
  22. #define dmi_ioremap early_ioremap
  23. #define dmi_iounmap early_iounmap
  24. #endif
  25. #endif