xref: /haiku/headers/private/kernel/platform/efi/protocol/device-path.h (revision 5889cb5e7e8e7bfea6072ddfe881f55d364a0cf0)
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 // DEVICE_PATH_MEDIA Types
39 #define MEDIA_HARDDRIVE_DP              0x01
40 #define MEDIA_CDROM_DP                  0x02
41 #define MEDIA_VENDOR_DP                 0x03
42 #define MEDIA_FILEPATH_DP               0x04
43 #define MEDIA_PROTOCOL_DP               0x05
44 
45 // TODO: move this to another header? would break circular dependencies between
46 // boot-services.h and this header, for efi_memory_type
47 typedef struct {
48     efi_device_path_protocol Header;
49     efi_memory_type MemoryType;
50     efi_physical_addr StartAddress;
51     efi_physical_addr EndAddress;
52 } efi_device_path_hw_memmap;
53