boot/efi: Port most of our efi boot code to the EDK II headers.
[dragonfly.git] / sys / boot / efi / include / efi.h
blobcddba663fc91f505ed4fdc62f59a72fa08ee2858
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.
12 #ifndef _EFI_INCLUDE_
13 #define _EFI_INCLUDE_
15 #ifdef __x86_64__
16 #define EFIAPI __attribute__((ms_abi))
17 #endif
20 * The following macros are defined unconditionally in the EDK II headers,
21 * so get our definitions out of the way.
23 #undef NULL
24 #undef MIN
25 #undef MAX
27 #include <Uefi/UefiBaseType.h>
28 #include <Uefi/UefiSpec.h>
29 #include <Guid/Acpi.h>
30 #include <Guid/DebugImageInfoTable.h>
31 #include <Guid/DxeServices.h>
32 #include <Guid/HobList.h>
33 #include <Guid/Mps.h>
34 #include <Guid/SmBios.h>
35 #include <Protocol/BlockIo.h>
36 #include <Protocol/GraphicsOutput.h>
37 #include <Protocol/NetworkInterfaceIdentifier.h>
38 #include <Protocol/PciIo.h>
39 #include <Protocol/SerialIo.h>
40 #include <Protocol/SimpleNetwork.h>
41 #include <Protocol/UgaDraw.h>
44 * The following macros haven been preserved from the old EFI headers for now.
46 #define EFI_DP_TYPE_MASK 0x7f
48 #define END_DEVICE_PATH_TYPE 0x7f
50 #define DevicePathType(a) (((a)->Type) & EFI_DP_TYPE_MASK)
51 #define DevicePathSubType(a) ((a)->SubType)
52 #define DevicePathNodeLength(a) (((a)->Length[0]) | ((a)->Length[1] << 8))
53 #define NextDevicePathNode(a) ((EFI_DEVICE_PATH *)(((UINT8 *)(a)) + DevicePathNodeLength(a)))
54 #define IsDevicePathType(a, t) (DevicePathType(a) == t)
55 #define IsDevicePathEndType(a) IsDevicePathType(a, END_DEVICE_PATH_TYPE)
56 #define IsDevicePathEndSubType(a) ((a)->SubType == END_ENTIRE_DEVICE_PATH_SUBTYPE)
57 #define IsDevicePathEnd(a) (IsDevicePathEndType(a) && IsDevicePathEndSubType(a))
59 #define SetDevicePathEndNode(a) do { \
60 (a)->Type = END_DEVICE_PATH_TYPE; \
61 (a)->SubType = END_ENTIRE_DEVICE_PATH_SUBTYPE; \
62 (a)->Length[0] = sizeof(EFI_DEVICE_PATH); \
63 (a)->Length[1] = 0; \
64 } while (0)
66 #define NextMemoryDescriptor(Ptr,Size) ((EFI_MEMORY_DESCRIPTOR *)(((UINT8 *)Ptr) + Size))
68 #define FDT_TABLE_GUID \
69 { 0xb1b621d5, 0xf19c, 0x41a5, {0x83, 0x0b, 0xd9, 0x15, 0x2c, 0x69, 0xaa, 0xe0} }
71 #define MEMORY_TYPE_INFORMATION_TABLE_GUID \
72 { 0x4c19049f, 0x4137, 0x4dd3, {0x9c, 0x10, 0x8b, 0x97, 0xa8, 0x3f, 0xfd, 0xfa} }
74 #endif