Debian Codegraph @

src/boot/proto/pci-io.h

raw
1 /* SPDX-License-Identifier: LGPL-2.1-or-later */
2 #pragma once
3
4 #include "efi.h"
5
6 #define EFI_PCI_IO_PROTOCOL_GUID \
7 GUID_DEF(0x4cf5b200, 0x68b8, 0x4ca5, 0x9e, 0xec, 0xb2, 0x3e, 0x3f, 0x50, 0x02, 0x9a)
8
9 typedef enum {
10 EfiPciIoWidthUint8,
11 EfiPciIoWidthUint16,
12 EfiPciIoWidthUint32,
13 EfiPciIoWidthUint64,
14 } EFI_PCI_IO_PROTOCOL_WIDTH;
15
16 typedef struct EFI_PCI_IO_PROTOCOL EFI_PCI_IO_PROTOCOL;
17
18 typedef EFI_STATUS (EFIAPI *EFI_PCI_IO_PROTOCOL_CONFIG)(
19 EFI_PCI_IO_PROTOCOL *This,
20 EFI_PCI_IO_PROTOCOL_WIDTH Width,
21 uint32_t Offset,
22 size_t Count,
23 void *Buffer);
24
25 typedef struct {
26 EFI_PCI_IO_PROTOCOL_CONFIG Read;
27 EFI_PCI_IO_PROTOCOL_CONFIG Write;
28 } EFI_PCI_IO_PROTOCOL_CONFIG_ACCESS;
29
30 /* Minimal definition — only Pci.Read is used. Fields before Pci must be correctly sized
31 * (one function pointer each for PollMem/PollIo, two for Mem.Read/Write, two for Io.Read/Write)
32 * to ensure Pci is at the right offset. */
33 struct EFI_PCI_IO_PROTOCOL {
34 void *PollMem;
35 void *PollIo;
36 EFI_PCI_IO_PROTOCOL_CONFIG_ACCESS Mem;
37 EFI_PCI_IO_PROTOCOL_CONFIG_ACCESS Io;
38 EFI_PCI_IO_PROTOCOL_CONFIG_ACCESS Pci;
39 /* remaining fields omitted */
40 };
41
42 #define PCI_VENDOR_ID_REDHAT 0x1af4U
43 #define PCI_DEVICE_ID_VIRTIO_CONSOLE 0x1003U