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