dmi.h 702 B

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