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