1 // Copyright 2016 The Fuchsia Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4 
5 #pragma once
6 
7 #include <efi/types.h>
8 
9 #define EFI_DEVICE_PATH_PROTOCOL_GUID \
10     {0x09576e91, 0x6d3f, 0x11d2, {0x8e, 0x39, 0x00, 0xa0, 0xc9, 0x69, 0x72, 0x3b}}
11 extern efi_guid DevicePathProtocol;
12 
13 typedef struct efi_device_path_protocol {
14     uint8_t Type;
15     uint8_t SubType;
16     uint8_t Length[2];
17 } efi_device_path_protocol;
18 
19 #define DEVICE_PATH_HARDWARE       0x01
20 #define DEVICE_PATH_ACPI           0x02
21 #define DEVICE_PATH_MESSAGING      0x03
22 #define DEVICE_PATH_MEDIA          0x04
23 #define DEVICE_PATH_BIOS_BOOT_SPEC 0x05
24 #define DEVICE_PATH_END            0x7f
25 
26 #define DEVICE_PATH_INSTANCE_END 0x01
27 #define DEVICE_PATH_ENTIRE_END   0xff
28 
29 #define DEVICE_PATH_HW_PCI        0x01
30 #define DEVICE_PATH_HW_PCCARD     0x02
31 #define DEVICE_PATH_HW_MEMMAP     0x03
32 #define DEVICE_PATH_HW_VENDOR     0x04
33 #define DEVICE_PATH_HW_CONTROLLER 0x05
34 #define DEVICE_PATH_HW_BMC        0x06
35 
36 // TODO: sub-types for other types (ACPI, etc)
37 
38 // TODO: move this to another header? would break circular dependencies between
39 // boot-services.h and this header, for efi_memory_type
40 typedef struct {
41     efi_device_path_protocol Header;
42     efi_memory_type MemoryType;
43     efi_physical_addr StartAddress;
44     efi_physical_addr EndAddress;
45 } efi_device_path_hw_memmap;
46