dmi.h 633 B

1234567891011121314151617181920212223242526
  1. #ifndef ASM_X86__DMI_H
  2. #define ASM_X86__DMI_H
  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. dmi_alloc_index += len;
  15. return dmi_alloc_data + idx;
  16. }
  17. /* Use early IO mappings for DMI because it's initialized early */
  18. #define dmi_ioremap early_ioremap
  19. #define dmi_iounmap early_iounmap
  20. #endif /* ASM_X86__DMI_H */