]> git.proxmox.com Git - mirror_edk2.git/blame - MdePkg/Include/Protocol/IsaHc.h
MdePkg: Replace BSD License with BSD+Patent License
[mirror_edk2.git] / MdePkg / Include / Protocol / IsaHc.h
CommitLineData
42c9d9f8
RN
1/** @file\r
2 ISA HC Protocol as defined in the PI 1.2.1 specification.\r
3\r
4 This protocol provides registration for ISA devices on a positive- or\r
5 subtractive-decode ISA bus. It allows devices to be registered and also\r
6 handles opening and closing the apertures which are positively-decoded.\r
7\r
9095d37b 8 Copyright (c) 2015 - 2018, Intel Corporation. All rights reserved.<BR>\r
9344f092 9 SPDX-License-Identifier: BSD-2-Clause-Patent\r
42c9d9f8
RN
10\r
11 @par Revision Reference:\r
12 This protocol is from PI Version 1.2.1.\r
13\r
14**/\r
15\r
16#ifndef __ISA_HC_PROTOCOL_H__\r
17#define __ISA_HC_PROTOCOL_H__\r
18\r
19#define EFI_ISA_HC_PROTOCOL_GUID \\r
20 { \\r
21 0xbcdaf080, 0x1bde, 0x4e22, {0xae, 0x6a, 0x43, 0x54, 0x1e, 0x12, 0x8e, 0xc4} \\r
22 }\r
23\r
24#define EFI_ISA_HC_SERVICE_BINDING_PROTOCOL_GUID \\r
25 { \\r
26 0xfad7933a, 0x6c21, 0x4234, {0xa4, 0x34, 0x0a, 0x8a, 0x0d, 0x2b, 0x07, 0x81} \\r
27 }\r
28\r
29typedef struct _EFI_ISA_HC_PROTOCOL EFI_ISA_HC_PROTOCOL;\r
30typedef struct _EFI_ISA_HC_PROTOCOL *PEFI_ISA_HC_PROTOCOL;\r
31\r
32/**\r
33 Open I/O aperture.\r
34\r
35 This function opens an I/O aperture in a ISA Host Controller for the I/O addresses\r
36 specified by IoAddress to IoAddress + IoLength - 1. It may be possible that a\r
37 single hardware aperture may be used for more than one device. This function\r
38 tracks the number of times that each aperture is referenced, and does not close\r
39 the hardware aperture (via CloseIoAperture()) until there are no more references to it.\r
40\r
41 @param This A pointer to this instance of the EFI_ISA_HC_PROTOCOL.\r
42 @param IoAddress An unsigned integer that specifies the first byte of the\r
43 I/O space required.\r
44 @param IoLength An unsigned integer that specifies the number of bytes\r
45 of the I/O space required.\r
46 @param IoApertureHandle A pointer to the returned I/O aperture handle. This\r
47 value can be used on subsequent calls to CloseIoAperture().\r
48\r
49 @retval EFI_SUCCESS The I/O aperture was opened successfully.\r
50 @retval EFI_UNSUPPORTED The ISA Host Controller is a subtractive-decode controller.\r
51 @retval EFI_OUT_OF_RESOURCES There is no available I/O aperture.\r
52**/\r
53typedef\r
54EFI_STATUS\r
55(EFIAPI *EFI_ISA_HC_OPEN_IO) (\r
56 IN CONST EFI_ISA_HC_PROTOCOL *This,\r
57 IN UINT16 IoAddress,\r
58 IN UINT16 IoLength,\r
59 OUT UINT64 *IoApertureHandle\r
60 );\r
61\r
62/**\r
63 Close I/O aperture.\r
64\r
65 This function closes a previously opened I/O aperture handle. If there are no\r
66 more I/O aperture handles that refer to the hardware I/O aperture resource,\r
67 then the hardware I/O aperture is closed. It may be possible that a single\r
68 hardware aperture may be used for more than one device. This function tracks\r
69 the number of times that each aperture is referenced, and does not close the\r
70 hardware aperture (via CloseIoAperture()) until there are no more references to it.\r
71\r
72 @param This A pointer to this instance of the EFI_ISA_HC_PROTOCOL.\r
9095d37b 73 @param IoApertureHandle The I/O aperture handle previously returned from a\r
42c9d9f8
RN
74 call to OpenIoAperture().\r
75\r
76 @retval EFI_SUCCESS The IO aperture was closed successfully.\r
77**/\r
78typedef\r
79EFI_STATUS\r
80(EFIAPI *EFI_ISA_HC_CLOSE_IO) (\r
81 IN CONST EFI_ISA_HC_PROTOCOL *This,\r
82 IN UINT64 IoApertureHandle\r
83 );\r
84\r
85///\r
86/// ISA HC Protocol\r
87///\r
88struct _EFI_ISA_HC_PROTOCOL {\r
89 ///\r
90 /// The version of this protocol. Higher version numbers are backward\r
91 /// compatible with lower version numbers.\r
92 ///\r
93 UINT32 Version;\r
94 ///\r
95 /// Open an I/O aperture.\r
96 ///\r
97 EFI_ISA_HC_OPEN_IO OpenIoAperture;\r
98 ///\r
99 /// Close an I/O aperture.\r
100 ///\r
101 EFI_ISA_HC_CLOSE_IO CloseIoAperture;\r
102};\r
103\r
104///\r
105/// Reference to variable defined in the .DEC file\r
106///\r
107extern EFI_GUID gEfiIsaHcProtocolGuid;\r
108extern EFI_GUID gEfiIsaHcServiceBindingProtocolGuid;\r
109\r
110#endif // __ISA_HC_H__\r