]> git.proxmox.com Git - mirror_edk2.git/blame - MdePkg/Include/Ppi/IsaHc.h
MdePkg: Replace BSD License with BSD+Patent License
[mirror_edk2.git] / MdePkg / Include / Ppi / IsaHc.h
CommitLineData
42c9d9f8
RN
1/** @file\r
2 This PPI opens or closes an I/O aperture in a ISA HOST controller.\r
3\r
9095d37b 4 Copyright (c) 2015 - 2018, Intel Corporation. All rights reserved.<BR>\r
9344f092 5 SPDX-License-Identifier: BSD-2-Clause-Patent\r
42c9d9f8
RN
6\r
7 @par Revision Reference:\r
8 This PPI is from PI Version 1.2.1.\r
9\r
10**/\r
11\r
12#ifndef __ISA_HC_PPI_H__\r
13#define __ISA_HC_PPI_H__\r
14\r
15#define EFI_ISA_HC_PPI_GUID \\r
16 { \\r
17 0x8d48bd70, 0xc8a3, 0x4c06, {0x90, 0x1b, 0x74, 0x79, 0x46, 0xaa, 0xc3, 0x58} \\r
18 }\r
19\r
20typedef struct _EFI_ISA_HC_PPI EFI_ISA_HC_PPI;\r
21typedef struct _EFI_ISA_HC_PPI *PEFI_ISA_HC_PPI;\r
22\r
23/**\r
24 Open I/O aperture.\r
25\r
26 This function opens an I/O aperture in a ISA Host Controller for the I/O\r
27 addresses specified by IoAddress to IoAddress + IoLength - 1. It is possible\r
28 that more than one caller may be assigned to the same aperture.\r
29 It may be possible that a single hardware aperture may be used for more than\r
9095d37b 30 one device. This function tracks the number of times that each aperture is\r
42c9d9f8
RN
31 referenced, and doesa not close the hardware aperture (via CloseIoAperture())\r
32 until there are no more references to it.\r
9095d37b 33\r
42c9d9f8
RN
34 @param This A pointer to this instance of the EFI_ISA_HC_PPI.\r
35 @param IoAddress An unsigned integer that specifies the first byte of\r
36 the I/O space required.\r
37 @param IoLength An unsigned integer that specifies the number of\r
38 bytes of the I/O space required.\r
39 @param IoApertureHandle A pointer to the returned I/O aperture handle.\r
40 This value can be used on subsequent calls to CloseIoAperture().\r
41\r
42 @retval EFI_SUCCESS The I/O aperture was opened successfully.\r
43 @retval EFI_UNSUPPORTED The ISA Host Controller is a subtractive-decode controller.\r
44 @retval EFI_OUT_OF_RESOURCES There is no available I/O aperture.\r
45**/\r
46typedef\r
47EFI_STATUS\r
48(EFIAPI *EFI_PEI_ISA_HC_OPEN_IO) (\r
49 IN CONST EFI_ISA_HC_PPI *This,\r
50 IN UINT16 IoAddress,\r
51 IN UINT16 IoLength,\r
52 OUT UINT64 *IoApertureHandle\r
53 );\r
54\r
55/**\r
56 Close I/O aperture.\r
57\r
58 This function closes a previously opened I/O aperture handle. If there are no\r
59 more I/O aperture handles that refer to the hardware I/O aperture resource,\r
60 then the hardware I/O aperture is closed.\r
61 It may be possible that a single hardware aperture may be used for more than\r
62 one device. This function tracks the number of times that each aperture is\r
63 referenced, and does not close the hardware aperture (via CloseIoAperture())\r
64 until there are no more references to it.\r
65\r
66 @param This A pointer to this instance of the EFI_ISA_HC_PPI.\r
67 @param IoApertureHandle The I/O aperture handle previously returned from a\r
68 call to OpenIoAperture().\r
69\r
70 @retval EFI_SUCCESS The I/O aperture was closed successfully.\r
9095d37b 71**/\r
42c9d9f8
RN
72typedef\r
73EFI_STATUS\r
74(EFIAPI *EFI_PEI_ISA_HC_CLOSE_IO) (\r
75 IN CONST EFI_ISA_HC_PPI *This,\r
76 IN UINT64 IoApertureHandle\r
77 );\r
78\r
79///\r
80/// This PPI provides functions for opening or closing an I/O aperture.\r
81///\r
82struct _EFI_ISA_HC_PPI {\r
83 ///\r
84 /// An unsigned integer that specifies the version of the PPI structure.\r
85 ///\r
86 UINT32 Version;\r
87 ///\r
88 /// The address of the ISA/LPC Bridge device.\r
89 /// For PCI, this is the segment, bus, device and function of the a ISA/LPC\r
90 /// Bridge device.\r
91 ///\r
92 /// If bits 24-31 are 0, then the definition is:\r
93 /// Bits 0:2 - Function\r
94 /// Bits 3-7 - Device\r
95 /// Bits 8:15 - Bus\r
96 /// Bits 16-23 - Segment\r
97 /// Bits 24-31 - Bus Type\r
98 /// If bits 24-31 are 0xff, then the definition is platform-specific.\r
99 ///\r
100 UINT32 Address;\r
101 ///\r
102 /// Opens an aperture on a positive-decode ISA Host Controller.\r
103 ///\r
104 EFI_PEI_ISA_HC_OPEN_IO OpenIoAperture;\r
105 ///\r
106 /// Closes an aperture on a positive-decode ISA Host Controller.\r
107 ///\r
108 EFI_PEI_ISA_HC_CLOSE_IO CloseIoAperture;\r
109};\r
110\r
111extern EFI_GUID gEfiIsaHcPpiGuid;\r
112\r
9095d37b 113#endif\r