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