xref: /kvmtool/x86/include/kvm/e820.h (revision f323796502fb5538acff18bd7e7979a3abf23bb2)
1*f3237965SAndre Przywara #ifndef KVM_E820_H
2*f3237965SAndre Przywara #define KVM_E820_H
3*f3237965SAndre Przywara 
4*f3237965SAndre Przywara #include <kvm/bios.h>
5*f3237965SAndre Przywara 
6*f3237965SAndre Przywara #define SMAP    0x534d4150      /* ASCII "SMAP" */
7*f3237965SAndre Przywara 
8*f3237965SAndre Przywara #define E820MAX 128             /* number of entries in E820MAP */
9*f3237965SAndre Przywara #define E820_X_MAX E820MAX
10*f3237965SAndre Przywara 
11*f3237965SAndre Przywara #define E820_RAM        1
12*f3237965SAndre Przywara #define E820_RESERVED   2
13*f3237965SAndre Przywara 
14*f3237965SAndre Przywara struct e820entry {
15*f3237965SAndre Przywara 	u64 addr;     /* start of memory segment */
16*f3237965SAndre Przywara 	u64 size;     /* size of memory segment */
17*f3237965SAndre Przywara 	u32 type;     /* type of memory segment */
18*f3237965SAndre Przywara } __attribute__((packed));
19*f3237965SAndre Przywara 
20*f3237965SAndre Przywara struct e820map {
21*f3237965SAndre Przywara 	u32 nr_map;
22*f3237965SAndre Przywara         struct e820entry map[E820_X_MAX];
23*f3237965SAndre Przywara };
24*f3237965SAndre Przywara 
25*f3237965SAndre Przywara struct biosregs;
26*f3237965SAndre Przywara 
27*f3237965SAndre Przywara extern bioscall void e820_query_map(struct biosregs *regs);
28*f3237965SAndre Przywara 
29*f3237965SAndre Przywara #endif /* KVM_E820_H */
30