xref: /dragonfly/stand/boot/efi/include/efi.h (revision 34f16cb63a66b8f9628ff8a7eed4e9c5ccec9b45)
1 /*
2  * Copyright (c)  1999 - 2002 Intel Corporation. All rights reserved
3  * This software and associated documentation (if any) is furnished
4  * under a license and may only be used or copied in accordance
5  * with the terms of the license. Except as permitted by such
6  * license, no part of this software or documentation may be
7  * reproduced, stored in a retrieval system, or transmitted in any
8  * form or by any means without the express written consent of
9  * Intel Corporation.
10  */
11 
12 #ifndef _EFI_INCLUDE_
13 #define _EFI_INCLUDE_
14 
15 #ifdef    __x86_64__
16 #define   EFIAPI    __attribute__((ms_abi))
17 #endif
18 
19 /*
20  * The following macros are defined unconditionally in the EDK II headers,
21  * so get our definitions out of the way.
22  */
23 #undef NULL
24 #undef MIN
25 #undef MAX
26 
27 #include <Uefi.h>
28 #include <Guid/Acpi.h>
29 #include <Guid/DebugImageInfoTable.h>
30 #include <Guid/DxeServices.h>
31 #include <Guid/HobList.h>
32 #include <Guid/LzmaDecompress.h>
33 #include <Guid/Mps.h>
34 #include <Guid/SmBios.h>
35 #include <Guid/SystemResourceTable.h>
36 #include <Protocol/BlockIo.h>
37 #include <Protocol/GraphicsOutput.h>
38 #include <Protocol/NetworkInterfaceIdentifier.h>
39 #include <Protocol/PciIo.h>
40 #include <Protocol/SerialIo.h>
41 #include <Protocol/SimpleNetwork.h>
42 #include <Protocol/UgaDraw.h>
43 
44 /*
45  * The following macros haven been preserved from the old EFI headers for now.
46  */
47 #define   EFI_DP_TYPE_MASK    0x7f
48 
49 #define   END_DEVICE_PATH_TYPE          0x7f
50 
51 #define   DevicePathType(a)             (((a)->Type) & EFI_DP_TYPE_MASK)
52 #define   DevicePathSubType(a)                    ((a)->SubType)
53 #define   DevicePathNodeLength(a)                 ((size_t)(((a)->Length[0]) | ((a)->Length[1] << 8)))
54 #define   NextDevicePathNode(a)                   ((EFI_DEVICE_PATH *)(((UINT8 *)(a)) + DevicePathNodeLength(a)))
55 #define   IsDevicePathType(a, t)                  (DevicePathType(a) == t)
56 #define   IsDevicePathEndType(a)                  IsDevicePathType(a, END_DEVICE_PATH_TYPE)
57 #define   IsDevicePathEndSubType(a)     ((a)->SubType == END_ENTIRE_DEVICE_PATH_SUBTYPE)
58 #define   IsDevicePathEnd(a)            (IsDevicePathEndType(a) && IsDevicePathEndSubType(a))
59 
60 #define   SetDevicePathEndNode(a)       do {                          \
61           (a)->Type = END_DEVICE_PATH_TYPE;                 \
62           (a)->SubType = END_ENTIRE_DEVICE_PATH_SUBTYPE;    \
63           (a)->Length[0] = sizeof(EFI_DEVICE_PATH);         \
64           (a)->Length[1] = 0;                               \
65 } while (0)
66 
67 #define   NextMemoryDescriptor(Ptr,Size)          ((EFI_MEMORY_DESCRIPTOR *)(((UINT8 *)Ptr) + Size))
68 
69 #define   FDT_TABLE_GUID \
70           { 0xb1b621d5, 0xf19c, 0x41a5, {0x83, 0x0b, 0xd9, 0x15, 0x2c, 0x69, 0xaa, 0xe0} }
71 
72 #define   MEMORY_TYPE_INFORMATION_TABLE_GUID \
73           { 0x4c19049f, 0x4137, 0x4dd3, {0x9c, 0x10, 0x8b, 0x97, 0xa8, 0x3f, 0xfd, 0xfa} }
74 
75 #define   AMI_ROM_LAYOUT_GUID \
76           { 0x00781ca1, 0x5de3, 0x405f, {0xab, 0xb8, 0x37, 0x9c, 0x3c, 0x07, 0x69, 0x84} }
77 
78 #endif
79