e820_memory_layout.h 697 B

123456789101112131415161718192021222324252627282930
  1. /*
  2. * QEMU BIOS e820 routines
  3. *
  4. * Copyright (c) 2003-2004 Fabrice Bellard
  5. *
  6. * SPDX-License-Identifier: MIT
  7. */
  8. #ifndef HW_I386_E820_MEMORY_LAYOUT_H
  9. #define HW_I386_E820_MEMORY_LAYOUT_H
  10. /* e820 types */
  11. #define E820_RAM 1
  12. #define E820_RESERVED 2
  13. #define E820_ACPI 3
  14. #define E820_NVS 4
  15. #define E820_UNUSABLE 5
  16. struct e820_entry {
  17. uint64_t address;
  18. uint64_t length;
  19. uint32_t type;
  20. } QEMU_PACKED __attribute((__aligned__(4)));
  21. void e820_add_entry(uint64_t address, uint64_t length, uint32_t type);
  22. bool e820_get_entry(int index, uint32_t type,
  23. uint64_t *address, uint64_t *length);
  24. int e820_get_table(struct e820_entry **table);
  25. #endif