X-Git-Url: https://git.proxmox.com/?p=mirror_edk2.git;a=blobdiff_plain;f=IntelFrameworkModulePkg%2FBus%2FIsa%2FIsaBusDxe%2FIsaIo.c;h=6b49abd0a10cdb31fee710977eb9b4fe20d734f2;hp=6f1cd1b8b11947124b455289f0c3c855a23e2b73;hb=0a6f48249a601f88af124ae1ff6814b195b699c3;hpb=e38f26a2f7f62b69fec2d84e83bcc4b45ddefdc1 diff --git a/IntelFrameworkModulePkg/Bus/Isa/IsaBusDxe/IsaIo.c b/IntelFrameworkModulePkg/Bus/Isa/IsaBusDxe/IsaIo.c index 6f1cd1b8b1..6b49abd0a1 100644 --- a/IntelFrameworkModulePkg/Bus/Isa/IsaBusDxe/IsaIo.c +++ b/IntelFrameworkModulePkg/Bus/Isa/IsaBusDxe/IsaIo.c @@ -1,7 +1,7 @@ /** @file - The implementation for EFI_ISA_IO_PROTOCOL. - -Copyright (c) 2006 - 2012, Intel Corporation. All rights reserved.
+ The implementation for EFI_ISA_IO_PROTOCOL. + +Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved.
This program and the accompanying materials are licensed and made available under the terms and conditions of the BSD License which accompanies this distribution. The full text of the license may be found at @@ -18,11 +18,11 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. // Module Variables // EFI_ISA_IO_PROTOCOL mIsaIoInterface = { - { + { IsaIoMemRead, IsaIoMemWrite }, - { + { IsaIoIoRead, IsaIoIoWrite }, @@ -85,7 +85,7 @@ EFI_ISA_DMA_REGISTERS mDmaRegisters[8] = { @param[in] IsaIoDevice The iso device to be initialized. @param[in] IsaDeviceResourceList The resource list. - + **/ VOID InitializeIsaIoInstance ( @@ -110,8 +110,8 @@ InitializeIsaIoInstance ( @param[in] This A pointer to the EFI_ISA_IO_PROTOCOL instance. @param[in] Width Specifies the width of the I/O operation. - @param[in] Offset The offset in ISA I/O space to start the I/O operation. - @param[in] Count The number of I/O operations to perform. + @param[in] Offset The offset in ISA I/O space to start the I/O operation. + @param[in] Count The number of I/O operations to perform. @param[out] Buffer The destination buffer to store the results @retval EFI_SUCCESS The data was read from the device sucessfully. @@ -172,8 +172,8 @@ IsaIoIoRead ( @param[in] This A pointer to the EFI_ISA_IO_PROTOCOL instance. @param[in] Width Specifies the width of the I/O operation. - @param[in] Offset The offset in ISA I/O space to start the I/O operation. - @param[in] Count The number of I/O operations to perform. + @param[in] Offset The offset in ISA I/O space to start the I/O operation. + @param[in] Count The number of I/O operations to perform. @param[in] Buffer The source buffer to write data from @retval EFI_SUCCESS The data was writen to the device sucessfully. @@ -233,7 +233,7 @@ IsaIoIoWrite ( Writes an 8-bit I/O Port @param[in] This A pointer to the EFI_ISA_IO_PROTOCOL instance. - @param[in] Offset The offset in ISA IO space to start the IO operation. + @param[in] Offset The offset in ISA IO space to start the IO operation. @param[in] Value The data to write port. @retval EFI_SUCCESS Success. @@ -282,8 +282,8 @@ WritePort ( @param[in] PageOffset The page's offest. @param[in] CountOffset The count's offset. @param[in] BaseAddress The base address. - @param[in] Count The number of I/O operations to perform. - + @param[in] Count The number of I/O operations to perform. + @retval EFI_SUCCESS Success. @retval EFI_INVALID_PARAMETER Parameter is invalid. @retval EFI_UNSUPPORTED The address range specified by these Offsets and Count is not valid. @@ -420,9 +420,9 @@ IsaIoFlush ( @param[in] IsaIoDevice The ISA device to be verified. @param[in] Type The Access type. The input must be either IsaAccessTypeMem or IsaAccessTypeIo. @param[in] Width The width of the memory operation. - @param[in] Count The number of memory operations to perform. - @param[in] Offset The offset in ISA memory space to start the memory operation. - + @param[in] Count The number of memory operations to perform. + @param[in] Offset The offset in ISA memory space to start the memory operation. + @retval EFI_SUCCESS Verify success. @retval EFI_INVALID_PARAMETER One of the parameters has an invalid value. @retval EFI_UNSUPPORTED The device ont support the access type. @@ -482,10 +482,10 @@ IsaIoVerifyAccess ( @param[in] This A pointer to the EFI_ISA_IO_PROTOCOL instance. @param[in] Width Specifies the width of the memory operation. - @param[in] Offset The offset in ISA memory space to start the memory operation. - @param[in] Count The number of memory operations to perform. + @param[in] Offset The offset in ISA memory space to start the memory operation. + @param[in] Count The number of memory operations to perform. @param[out] Buffer The destination buffer to store the results - + @retval EFI_SUCCESS The data was read from the device successfully. @retval EFI_UNSUPPORTED The Offset is not valid for this device. @retval EFI_INVALID_PARAMETER Width or Count, or both, were invalid. @@ -549,10 +549,10 @@ IsaIoMemRead ( /** Performs an ISA Memory Write Cycle - @param[in] This A pointer to the EFI_ISA_IO_PROTOCOL instance. + @param[in] This A pointer to the EFI_ISA_IO_PROTOCOL instance. @param[in] Width Specifies the width of the memory operation. - @param[in] Offset The offset in ISA memory space to start the memory operation. - @param[in] Count The number of memory operations to perform. + @param[in] Offset The offset in ISA memory space to start the memory operation. + @param[in] Count The number of memory operations to perform. @param[in] Buffer The source buffer to write data from @retval EFI_SUCCESS The data was written to the device sucessfully. @@ -620,7 +620,7 @@ IsaIoMemWrite ( @param[in] This A pointer to the EFI_ISA_IO_PROTOCOL instance. @param[in] Width Specifies the width of the memory copy operation. - @param[in] DestOffset The offset of the destination + @param[in] DestOffset The offset of the destination @param[in] SrcOffset The offset of the source @param[in] Count The number of memory copy operations to perform @@ -701,18 +701,18 @@ IsaIoCopyMem ( only supports slave read/write operation to save code size. @param This A pointer to the EFI_ISA_IO_PROTOCOL instance. - @param Operation Indicates the type of DMA (slave or bus master), and if - the DMA operation is going to read or write to system memory. - @param ChannelNumber The slave channel number to use for this DMA operation. - If Operation and ChannelAttributes shows that this device - performs bus mastering DMA, then this field is ignored. - The legal range for this field is 0..7. + @param Operation Indicates the type of DMA (slave or bus master), and if + the DMA operation is going to read or write to system memory. + @param ChannelNumber The slave channel number to use for this DMA operation. + If Operation and ChannelAttributes shows that this device + performs bus mastering DMA, then this field is ignored. + The legal range for this field is 0..7. @param ChannelAttributes The attributes of the DMA channel to use for this DMA operation - @param HostAddress The system memory address to map to the device. - @param NumberOfBytes On input the number of bytes to map. On output the number + @param HostAddress The system memory address to map to the device. + @param NumberOfBytes On input the number of bytes to map. On output the number of bytes that were mapped. - @param DeviceAddress The resulting map address for the bus master device to use - to access the hosts HostAddress. + @param DeviceAddress The resulting map address for the bus master device to use + to access the hosts HostAddress. @param Mapping A resulting value to pass to EFI_ISA_IO.Unmap(). @retval EFI_SUCCESS The range was mapped for the returned NumberOfBytes. @@ -743,7 +743,7 @@ IsaIoMapOnlySupportSlaveReadWrite ( UINT8 DmaMask; UINT8 DmaClear; UINT8 DmaChannelMode; - + if ((NULL == This) || (NULL == HostAddress) || (NULL == NumberOfBytes) || @@ -762,7 +762,7 @@ IsaIoMapOnlySupportSlaveReadWrite ( // Make sure the Operation parameter is valid. // Light IsaIo only supports two operations. // - if (!(Operation == EfiIsaIoOperationSlaveRead || + if (!(Operation == EfiIsaIoOperationSlaveRead || Operation == EfiIsaIoOperationSlaveWrite)) { return EFI_INVALID_PARAMETER; } @@ -848,7 +848,7 @@ IsaIoMapOnlySupportSlaveReadWrite ( // *DeviceAddress = PhysicalAddress; } - + // // Figure out what to program into the DMA Channel Mode Register // @@ -933,22 +933,22 @@ IsaIoMapOnlySupportSlaveReadWrite ( } /** - Maps a memory region for DMA. This implementation implement the + Maps a memory region for DMA. This implementation implement the the full mapping support. @param This A pointer to the EFI_ISA_IO_PROTOCOL instance. - @param Operation Indicates the type of DMA (slave or bus master), and if - the DMA operation is going to read or write to system memory. - @param ChannelNumber The slave channel number to use for this DMA operation. - If Operation and ChannelAttributes shows that this device - performs bus mastering DMA, then this field is ignored. - The legal range for this field is 0..7. + @param Operation Indicates the type of DMA (slave or bus master), and if + the DMA operation is going to read or write to system memory. + @param ChannelNumber The slave channel number to use for this DMA operation. + If Operation and ChannelAttributes shows that this device + performs bus mastering DMA, then this field is ignored. + The legal range for this field is 0..7. @param ChannelAttributes The attributes of the DMA channel to use for this DMA operation - @param HostAddress The system memory address to map to the device. - @param NumberOfBytes On input the number of bytes to map. On output the number + @param HostAddress The system memory address to map to the device. + @param NumberOfBytes On input the number of bytes to map. On output the number of bytes that were mapped. - @param DeviceAddress The resulting map address for the bus master device to use - to access the hosts HostAddress. + @param DeviceAddress The resulting map address for the bus master device to use + to access the hosts HostAddress. @param Mapping A resulting value to pass to EFI_ISA_IO.Unmap(). @retval EFI_SUCCESS - The range was mapped for the returned NumberOfBytes. @@ -1262,18 +1262,18 @@ IsaIoMapFullSupport ( Maps a memory region for DMA @param This A pointer to the EFI_ISA_IO_PROTOCOL instance. - @param Operation Indicates the type of DMA (slave or bus master), and if - the DMA operation is going to read or write to system memory. - @param ChannelNumber The slave channel number to use for this DMA operation. - If Operation and ChannelAttributes shows that this device - performs bus mastering DMA, then this field is ignored. - The legal range for this field is 0..7. + @param Operation Indicates the type of DMA (slave or bus master), and if + the DMA operation is going to read or write to system memory. + @param ChannelNumber The slave channel number to use for this DMA operation. + If Operation and ChannelAttributes shows that this device + performs bus mastering DMA, then this field is ignored. + The legal range for this field is 0..7. @param ChannelAttributes The attributes of the DMA channel to use for this DMA operation - @param HostAddress The system memory address to map to the device. - @param NumberOfBytes On input the number of bytes to map. On output the number + @param HostAddress The system memory address to map to the device. + @param NumberOfBytes On input the number of bytes to map. On output the number of bytes that were mapped. - @param DeviceAddress The resulting map address for the bus master device to use - to access the hosts HostAddress. + @param DeviceAddress The resulting map address for the bus master device to use + to access the hosts HostAddress. @param Mapping A resulting value to pass to EFI_ISA_IO.Unmap(). @retval EFI_SUCCESS The range was mapped for the returned NumberOfBytes. @@ -1302,7 +1302,7 @@ IsaIoMap ( return EFI_UNSUPPORTED; } // - // Set Feature Flag PcdIsaBusSupportBusMaster to FALSE to disable support for + // Set Feature Flag PcdIsaBusSupportBusMaster to FALSE to disable support for // ISA Bus Master. // // So we just return EFI_UNSUPPORTED for these functions. @@ -1345,7 +1345,7 @@ IsaIoMap ( @retval EFI_SUCCESS The requested memory pages were allocated. @retval EFI_INVALID_PARAMETER Type is invalid or MemoryType is invalid or HostAddress is NULL - @retval EFI_UNSUPPORTED Attributes is unsupported or the memory range specified + @retval EFI_UNSUPPORTED Attributes is unsupported or the memory range specified by HostAddress, Pages, and Type is not available for common buffer use. @retval EFI_OUT_OF_RESOURCES The memory pages could not be allocated. **/ @@ -1364,7 +1364,7 @@ IsaIoAllocateBuffer ( EFI_PHYSICAL_ADDRESS PhysicalAddress; // - // Set Feature Flag PcdIsaBusOnlySupportSlaveDma to FALSE to disable support for + // Set Feature Flag PcdIsaBusOnlySupportSlaveDma to FALSE to disable support for // ISA Bus Master. // Or unset Feature Flag PcdIsaBusSupportDma to disable support for ISA DMA. // @@ -1418,7 +1418,7 @@ IsaIoAllocateBuffer ( } /** - Frees memory that was allocated with EFI_ISA_IO.AllocateBuffer(). + Frees memory that was allocated with EFI_ISA_IO.AllocateBuffer(). @param[in] This A pointer to the EFI_ISA_IO_PROTOCOL instance. @param[in] Pages The number of pages to free. @@ -1438,7 +1438,7 @@ IsaIoFreeBuffer ( EFI_STATUS Status; // - // Set Feature Flag PcdIsaBusOnlySupportSlaveDma to FALSE to disable support for + // Set Feature Flag PcdIsaBusOnlySupportSlaveDma to FALSE to disable support for // ISA Bus Master. // Or unset Feature Flag PcdIsaBusSupportDma to disable support for ISA DMA. //