1#ifndef __EFI_H
2#define __EFI_H
3
4/* We allocate three new EFI memory types to signal to the CPU driver where
5 * its code, data, stack and Multiboot info block are located, so that it can
6 * avoid trampling on them. */
7typedef enum {
8    EfiBarrelfishFirstMemType=   0x80000000,
9
10    EfiBarrelfishCPUDriver=      0x80000000,
11    EfiBarrelfishCPUDriverStack= 0x80000001,
12    EfiBarrelfishMultibootData=  0x80000002,
13    EfiBarrelfishELFData=        0x80000003,
14    EfiBarrelfishBootPageTable=  0x80000004,
15
16    EfiBarrelfishMaxMemType
17} efi_barrelfish_memory_type;
18
19/* Copyright (c) 2006 - 2015, Intel Corporation. All rights reserved.
20   This program and the accompanying materials are licensed and made available
21   under the terms and conditions of the BSD License that accompanies this
22   distribution.  The full text of the license may be found at
23   http://opensource.org/licenses/bsd-license.php.
24
25   THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
26   WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR
27   IMPLIED.
28*/
29
30/* Core EFI memory types - taken from the UDK. */
31typedef enum {
32    EfiReservedMemoryType,
33    EfiLoaderCode,
34    EfiLoaderData,
35    EfiBootServicesCode,
36    EfiBootServicesData,
37    EfiRuntimeServicesCode,
38    EfiRuntimeServicesData,
39    EfiConventionalMemory,
40    EfiUnusableMemory,
41    EfiACPIReclaimMemory,
42    EfiACPIMemoryNVS,
43    EfiMemoryMappedIO,
44    EfiMemoryMappedIOPortSpace,
45    EfiPalCode,
46    EfiPersistentMemory,
47    EfiMaxMemoryType
48} efi_memory_type;
49
50/* An EFI memory region descriptor. */
51typedef struct {
52  uint32_t Type;
53  uint64_t PhysicalStart;
54  uint64_t VirtualStart;
55  uint64_t NumberOfPages;
56  uint64_t Attribute;
57} efi_memory_descriptor;
58
59void print_mmap(efi_memory_descriptor *mmap, size_t mmap_len);
60
61#endif /* __EFI_H */
62