]> git.proxmox.com Git - mirror_edk2.git/blame - EdkCompatibilityPkg/Foundation/Efi/Protocol/DeviceIo/DeviceIo.h
Update the copyright notice format
[mirror_edk2.git] / EdkCompatibilityPkg / Foundation / Efi / Protocol / DeviceIo / DeviceIo.h
CommitLineData
3eb9473e 1/*++\r
2\r
f57387d5
HT
3Copyright (c) 2004, Intel Corporation. All rights reserved.<BR>\r
4This program and the accompanying materials \r
3eb9473e 5are licensed and made available under the terms and conditions of the BSD License \r
6which accompanies this distribution. The full text of the license may be found at \r
7http://opensource.org/licenses/bsd-license.php \r
8 \r
9THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, \r
10WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. \r
11\r
12Module Name:\r
13\r
14 DeviceIo.h\r
15\r
16Abstract:\r
17\r
18 Device IO protocol as defined in the EFI 1.0 specification.\r
19\r
20 Device IO is used to abstract hardware access to devices. It includes\r
21 memory mapped IO, IO, PCI Config space, and DMA.\r
22\r
23 \r
24--*/\r
25\r
26#ifndef _DEVICE_IO_H_\r
27#define _DEVICE_IO_H_\r
28\r
29#define EFI_DEVICE_IO_PROTOCOL_GUID \\r
30 { \\r
7ccf38a3 31 0xaf6ac311, 0x84c3, 0x11d2, {0x8e, 0x3c, 0x00, 0xa0, 0xc9, 0x69, 0x72, 0x3b} \\r
3eb9473e 32 }\r
33\r
34EFI_FORWARD_DECLARATION (EFI_DEVICE_IO_PROTOCOL);\r
35\r
36typedef enum {\r
37 IO_UINT8,\r
38 IO_UINT16,\r
39 IO_UINT32,\r
40 IO_UINT64,\r
41 MMIO_COPY_UINT8,\r
42 MMIO_COPY_UINT16,\r
43 MMIO_COPY_UINT32,\r
44 MMIO_COPY_UINT64\r
45} EFI_IO_WIDTH;\r
46\r
47typedef\r
48EFI_STATUS\r
49(EFIAPI *EFI_DEVICE_IO) (\r
50 IN EFI_DEVICE_IO_PROTOCOL * This,\r
51 IN EFI_IO_WIDTH Width,\r
52 IN UINT64 Address,\r
53 IN UINTN Count,\r
54 IN OUT VOID *Buffer\r
55 );\r
56\r
57typedef struct {\r
58 EFI_DEVICE_IO Read;\r
59 EFI_DEVICE_IO Write;\r
60} EFI_IO_ACCESS;\r
61\r
62typedef\r
63EFI_STATUS\r
64(EFIAPI *EFI_PCI_DEVICE_PATH) (\r
65 IN EFI_DEVICE_IO_PROTOCOL * This,\r
66 IN UINT64 Address,\r
67 IN OUT EFI_DEVICE_PATH_PROTOCOL **PciDevicePath\r
68 );\r
69\r
70typedef enum {\r
71 EfiBusMasterRead,\r
72 EfiBusMasterWrite,\r
73 EfiBusMasterCommonBuffer\r
74} EFI_IO_OPERATION_TYPE;\r
75\r
76typedef\r
77EFI_STATUS\r
78(EFIAPI *EFI_IO_MAP) (\r
79 IN EFI_DEVICE_IO_PROTOCOL * This,\r
80 IN EFI_IO_OPERATION_TYPE Operation,\r
81 IN EFI_PHYSICAL_ADDRESS * HostAddress,\r
82 IN OUT UINTN *NumberOfBytes,\r
83 OUT EFI_PHYSICAL_ADDRESS * DeviceAddress,\r
84 OUT VOID **Mapping\r
85 );\r
86\r
87typedef\r
88EFI_STATUS\r
89(EFIAPI *EFI_IO_UNMAP) (\r
90 IN EFI_DEVICE_IO_PROTOCOL * This,\r
91 IN VOID *Mapping\r
92 );\r
93\r
94typedef\r
95EFI_STATUS\r
96(EFIAPI *EFI_IO_ALLOCATE_BUFFER) (\r
97 IN EFI_DEVICE_IO_PROTOCOL * This,\r
98 IN EFI_ALLOCATE_TYPE Type,\r
99 IN EFI_MEMORY_TYPE MemoryType,\r
100 IN UINTN Pages,\r
101 IN OUT EFI_PHYSICAL_ADDRESS * HostAddress\r
102 );\r
103\r
104typedef\r
105EFI_STATUS\r
106(EFIAPI *EFI_IO_FLUSH) (\r
107 IN EFI_DEVICE_IO_PROTOCOL * This\r
108 );\r
109\r
110typedef\r
111EFI_STATUS\r
112(EFIAPI *EFI_IO_FREE_BUFFER) (\r
113 IN EFI_DEVICE_IO_PROTOCOL * This,\r
114 IN UINTN Pages,\r
115 IN EFI_PHYSICAL_ADDRESS HostAddress\r
116 );\r
117\r
e5bce275 118struct _EFI_DEVICE_IO_PROTOCOL {\r
3eb9473e 119 EFI_IO_ACCESS Mem;\r
120 EFI_IO_ACCESS Io;\r
121 EFI_IO_ACCESS Pci;\r
122 EFI_IO_MAP Map;\r
123 EFI_PCI_DEVICE_PATH PciDevicePath;\r
124 EFI_IO_UNMAP Unmap;\r
125 EFI_IO_ALLOCATE_BUFFER AllocateBuffer;\r
126 EFI_IO_FLUSH Flush;\r
127 EFI_IO_FREE_BUFFER FreeBuffer;\r
e5bce275 128};\r
3eb9473e 129\r
130extern EFI_GUID gEfiDeviceIoProtocolGuid;\r
131\r
132#endif\r