},\r
};\r
\r
+/**\r
+ report a error Status code of PCI bus driver controller\r
+\r
+ @param Code - The error status code.\r
+ \r
+ @Return EFI_SUCCESS - Success to report status code.\r
+**/\r
EFI_STATUS\r
ReportErrorStatusCode (\r
EFI_STATUS_CODE_VALUE Code\r
)\r
-/*++\r
-\r
-Routine Description:\r
\r
- report a error Status code of PCI bus driver controller\r
-\r
-Arguments:\r
-\r
- Code - The error status code.\r
- \r
-Returns:\r
-\r
- EFI_SUCCESS - Success to report status code.\r
- \r
-\r
---*/\r
{\r
return REPORT_STATUS_CODE (\r
EFI_ERROR_CODE | EFI_ERROR_MINOR,\r
//\r
// Driver Support Functions\r
//\r
+/**\r
+\r
+ Initializes an ISA I/O Instance\r
\r
+ @param IsaIoDevice - The iso device to be initialized.\r
+ @param IsaDeviceResourceList - The resource list.\r
+ \r
+ @retval EFI_SUCCESS - Initial success.\r
+ \r
+**/\r
EFI_STATUS\r
InitializeIsaIoInstance (\r
IN ISA_IO_DEVICE *IsaIoDevice,\r
IN EFI_ISA_ACPI_RESOURCE_LIST *IsaDeviceResourceList\r
)\r
-/*++\r
-\r
-Routine Description:\r
-\r
- Initializes an ISA I/O Instance\r
-\r
-Arguments:\r
-\r
- IsaIoDevice - The iso device to be initialized.\r
- IsaDeviceResourceList - The resource list.\r
- \r
-Returns:\r
-\r
- EFI_SUCCESS - Initial success.\r
- \r
---*/\r
{\r
//\r
// Initializes an ISA I/O Instance\r
return EFI_SUCCESS;\r
}\r
\r
+/**\r
+ Performs an ISA I/O Read Cycle\r
+\r
+ @param This - A pointer to the EFI_ISA_IO_PROTOCOL instance.\r
+ @param Width - Signifies the width of the I/O operation.\r
+ @param Offset - The offset in ISA I/O space to start the I/O operation. \r
+ @param Count - The number of I/O operations to perform. \r
+ @param Buffer - The destination buffer to store the results\r
+\r
+ @retval EFI_SUCCESS - The data was read from the device sucessfully.\r
+ @retval EFI_UNSUPPORTED - The Offset is not valid for this device.\r
+ @retval EFI_INVALID_PARAMETER - Width or Count, or both, were invalid.\r
+ @retval EFI_OUT_OF_RESOURCES - The request could not be completed due to a lack of resources.\r
+\r
+**/\r
EFI_STATUS\r
EFIAPI\r
IsaIoIoRead (\r
IN UINTN Count,\r
IN OUT VOID *Buffer\r
)\r
-/*++\r
-\r
-Routine Description:\r
-\r
- Performs an ISA I/O Read Cycle\r
\r
-Arguments:\r
-\r
- This - A pointer to the EFI_ISA_IO_PROTOCOL instance.\r
- Width - Signifies the width of the I/O operation.\r
- Offset - The offset in ISA I/O space to start the I/O operation. \r
- Count - The number of I/O operations to perform. \r
- Buffer - The destination buffer to store the results\r
-\r
-Returns:\r
-\r
- EFI_SUCCESS - The data was read from the device sucessfully.\r
- EFI_UNSUPPORTED - The Offset is not valid for this device.\r
- EFI_INVALID_PARAMETER - Width or Count, or both, were invalid.\r
- EFI_OUT_OF_RESOURCES - The request could not be completed due to a lack of resources.\r
-\r
---*/\r
{\r
EFI_STATUS Status;\r
ISA_IO_DEVICE *IsaIoDevice;\r
return Status;\r
}\r
\r
+/**\r
+ Performs an ISA I/O Write Cycle\r
+\r
+ @param This - A pointer to the EFI_ISA_IO_PROTOCOL instance.\r
+ @param Width - Signifies the width of the I/O operation.\r
+ @param Offset - The offset in ISA I/O space to start the I/O operation. \r
+ @param Count - The number of I/O operations to perform. \r
+ @param Buffer - The source buffer to write data from\r
+\r
+ @Retval EFI_SUCCESS - The data was writen to the device sucessfully.\r
+ @Retval EFI_UNSUPPORTED - The Offset is not valid for this device.\r
+ @Retval EFI_INVALID_PARAMETER - Width or Count, or both, were invalid.\r
+ @Retval EFI_OUT_OF_RESOURCES - The request could not be completed due to a lack of resources.\r
+\r
+**/\r
EFI_STATUS\r
EFIAPI\r
IsaIoIoWrite (\r
IN UINTN Count,\r
IN OUT VOID *Buffer\r
)\r
-/*++\r
-\r
-Routine Description:\r
-\r
- Performs an ISA I/O Write Cycle\r
-\r
-Arguments:\r
-\r
- This - A pointer to the EFI_ISA_IO_PROTOCOL instance.\r
- Width - Signifies the width of the I/O operation.\r
- Offset - The offset in ISA I/O space to start the I/O operation. \r
- Count - The number of I/O operations to perform. \r
- Buffer - The source buffer to write data from\r
-\r
-Returns:\r
-\r
- EFI_SUCCESS - The data was writen to the device sucessfully.\r
- EFI_UNSUPPORTED - The Offset is not valid for this device.\r
- EFI_INVALID_PARAMETER - Width or Count, or both, were invalid.\r
- EFI_OUT_OF_RESOURCES - The request could not be completed due to a lack of resources.\r
-\r
---*/\r
{\r
EFI_STATUS Status;\r
ISA_IO_DEVICE *IsaIoDevice;\r
return Status;\r
}\r
\r
+/**\r
+ Writes an 8 bit I/O Port\r
+\r
+ @param This - A pointer to the EFI_ISA_IO_PROTOCOL instance.\r
+ @param Offset - The offset in ISA IO space to start the IO operation. \r
+ @param Value - The data to write port.\r
+\r
+ @retval EFI_SUCCESS - Success.\r
+ @retval EFI_INVALID_PARAMETER - Parameter is invalid.\r
+ @retval EFI_UNSUPPORTED - The address range specified by Offset is not valid.\r
+ @retval EFI_OUT_OF_RESOURCES - The request could not be completed due to a lack of resources.\r
+ \r
+**/\r
EFI_STATUS\r
WritePort (\r
IN EFI_ISA_IO_PROTOCOL *This,\r
IN UINT32 Offset,\r
IN UINT8 Value\r
)\r
-/*++\r
-\r
-Routine Description:\r
-\r
- Writes an 8 bit I/O Port\r
-\r
-Arguments:\r
-\r
- This - A pointer to the EFI_ISA_IO_PROTOCOL instance.\r
- Offset - The offset in ISA IO space to start the IO operation. \r
- Value - The data to write port.\r
- \r
-Returns:\r
\r
- EFI_SUCCESS - Success.\r
- EFI_INVALID_PARAMETER - Parameter is invalid.\r
- EFI_UNSUPPORTED - The address range specified by Offset is not valid.\r
- EFI_OUT_OF_RESOURCES - The request could not be completed due to a lack of resources.\r
- \r
---*/\r
{\r
EFI_STATUS Status;\r
ISA_IO_DEVICE *IsaIoDevice;\r
return EFI_SUCCESS;\r
}\r
\r
+/**\r
+ Writes I/O operation base address and count number to a 8 bit I/O Port.\r
+\r
+ @param This - A pointer to the EFI_ISA_IO_PROTOCOL instance.\r
+ @param AddrOffset - The address' offset.\r
+ @param PageOffset - The page's offest.\r
+ @param CountOffset - The count's offset.\r
+ @param BaseAddress - The base address.\r
+ @param Count - The number of I/O operations to perform. \r
+ \r
+ @retval EFI_SUCCESS - Success.\r
+ @retval EFI_INVALID_PARAMETER - Parameter is invalid.\r
+ @retval EFI_UNSUPPORTED - The address range specified by these Offsets and Count is not valid.\r
+ @retval EFI_OUT_OF_RESOURCES - The request could not be completed due to a lack of resources.\r
+\r
+**/\r
EFI_STATUS\r
WriteDmaPort (\r
IN EFI_ISA_IO_PROTOCOL *This,\r
IN UINT32 BaseAddress,\r
IN UINT16 Count\r
)\r
-/*++\r
-\r
-Routine Description:\r
-\r
- Writes I/O operation base address and count number to a 8 bit I/O Port.\r
-\r
-Arguments:\r
-\r
- This - A pointer to the EFI_ISA_IO_PROTOCOL instance.\r
- AddrOffset - The address' offset.\r
- PageOffset - The page's offest.\r
- CountOffset - The count's offset.\r
- BaseAddress - The base address.\r
- Count - The number of I/O operations to perform. \r
- \r
-Returns:\r
\r
- EFI_SUCCESS - Success.\r
- EFI_INVALID_PARAMETER - Parameter is invalid.\r
- EFI_UNSUPPORTED - The address range specified by these Offsets and Count is not valid.\r
- EFI_OUT_OF_RESOURCES - The request could not be completed due to a lack of resources.\r
-\r
---*/\r
{\r
EFI_STATUS Status;\r
\r
return EFI_SUCCESS;\r
}\r
\r
+/**\r
+ Unmaps a memory region for DMA\r
+\r
+ @param This - A pointer to the EFI_ISA_IO_PROTOCOL instance.\r
+ @param Mapping - The mapping value returned from EFI_ISA_IO.Map().\r
+\r
+ @retval EFI_SUCCESS - The range was unmapped.\r
+ @retval EFI_DEVICE_ERROR - The data was not committed to the target system memory.\r
+\r
+**/\r
EFI_STATUS\r
EFIAPI\r
IsaIoUnmap (\r
IN EFI_ISA_IO_PROTOCOL *This,\r
IN VOID *Mapping\r
)\r
-/*++\r
-\r
-Routine Description:\r
-\r
- Unmaps a memory region for DMA\r
-\r
-Arguments:\r
-\r
- This - A pointer to the EFI_ISA_IO_PROTOCOL instance.\r
- Mapping - The mapping value returned from EFI_ISA_IO.Map().\r
-\r
-Returns:\r
-\r
- EFI_SUCCESS - The range was unmapped.\r
- EFI_DEVICE_ERROR - The data was not committed to the target system memory.\r
-\r
---*/\r
{\r
ISA_MAP_INFO *IsaMapInfo;\r
\r
return EFI_SUCCESS;\r
}\r
\r
+/**\r
+ Flushes a DMA buffer\r
+\r
+ @param This - A pointer to the EFI_ISA_IO_PROTOCOL instance.\r
+\r
+ @retval EFI_SUCCESS - The buffers were flushed.\r
+ @retval EFI_DEVICE_ERROR - The buffers were not flushed due to a hardware error.\r
+\r
+**/\r
EFI_STATUS\r
EFIAPI\r
IsaIoFlush (\r
IN EFI_ISA_IO_PROTOCOL *This\r
)\r
-/*++\r
-\r
-Routine Description:\r
-\r
- Flushes a DMA buffer\r
-\r
-Arguments:\r
-\r
- This - A pointer to the EFI_ISA_IO_PROTOCOL instance.\r
\r
-Returns:\r
-\r
- EFI_SUCCESS - The buffers were flushed.\r
- EFI_DEVICE_ERROR - The buffers were not flushed due to a hardware error.\r
-\r
---*/\r
{\r
EFI_STATUS Status;\r
ISA_IO_DEVICE *IsaIoDevice;\r
return Status;\r
}\r
\r
+/**\r
+ Verifies access to an ISA device\r
+\r
+ @param IsaIoDevice - The ISA device to be verified.\r
+ @param Type - The Access type. The input must be either IsaAccessTypeMem or IsaAccessTypeIo.\r
+ @param Width - Signifies the width of the memory operation.\r
+ @param Count - The number of memory operations to perform. \r
+ @param Offset - The offset in ISA memory space to start the memory operation. \r
+ \r
+ @retval EFI_SUCCESS - Verify success.\r
+ @retval EFI_INVALID_PARAMETER - One of the parameters has an invalid value.\r
+ @retval EFI_UNSUPPORTED - The device ont support the access type.\r
+\r
+**/\r
EFI_STATUS\r
IsaIoVerifyAccess (\r
IN ISA_IO_DEVICE *IsaIoDevice,\r
IN UINTN Count,\r
IN OUT UINT32 *Offset\r
)\r
-/*++\r
-\r
-Routine Description:\r
\r
- Verifies access to an ISA device\r
-\r
-Arguments:\r
-\r
- IsaIoDevice - The ISA device to be verified.\r
- Type - The Access type. The input must be either IsaAccessTypeMem or IsaAccessTypeIo.\r
- Width - Signifies the width of the memory operation.\r
- Count - The number of memory operations to perform. \r
- Offset - The offset in ISA memory space to start the memory operation. \r
- \r
-Returns:\r
-\r
- EFI_SUCCESS - Verify success.\r
- EFI_INVALID_PARAMETER - One of the parameters has an invalid value.\r
- EFI_UNSUPPORTED - The device ont support the access type.\r
-\r
---*/\r
{\r
EFI_ISA_ACPI_RESOURCE *Item;\r
EFI_STATUS Status;\r
return Status;\r
}\r
\r
+/**\r
+\r
+ Performs an ISA Memory Read Cycle\r
+\r
+ @param This - A pointer to the EFI_ISA_IO_PROTOCOL instance.\r
+ @param Width - Signifies the width of the memory operation.\r
+ @param Offset - The offset in ISA memory space to start the memory operation. \r
+ @param Count - The number of memory operations to perform. \r
+ @param Buffer - The destination buffer to store the results\r
+ \r
+ @retval EFI_SUCCESS - The data was read from the device successfully.\r
+ @retval EFI_UNSUPPORTED - The Offset is not valid for this device.\r
+ @retval EFI_INVALID_PARAMETER - Width or Count, or both, were invalid.\r
+ @retval EFI_OUT_OF_RESOURCES - The request could not be completed due to a lack of resources.\r
+\r
+**/\r
EFI_STATUS\r
EFIAPI\r
IsaIoMemRead (\r
IN UINTN Count,\r
IN OUT VOID *Buffer\r
)\r
-/*++\r
-\r
-Routine Description:\r
-\r
- Performs an ISA Memory Read Cycle\r
-\r
-Arguments:\r
-\r
- This - A pointer to the EFI_ISA_IO_PROTOCOL instance.\r
- Width - Signifies the width of the memory operation.\r
- Offset - The offset in ISA memory space to start the memory operation. \r
- Count - The number of memory operations to perform. \r
- Buffer - The destination buffer to store the results\r
- \r
-Returns:\r
-\r
- EFI_SUCCESS - The data was read from the device successfully.\r
- EFI_UNSUPPORTED - The Offset is not valid for this device.\r
- EFI_INVALID_PARAMETER - Width or Count, or both, were invalid.\r
- EFI_OUT_OF_RESOURCES - The request could not be completed due to a lack of resources.\r
\r
---*/\r
{\r
EFI_STATUS Status;\r
ISA_IO_DEVICE *IsaIoDevice;\r
return Status;\r
}\r
\r
+/**\r
+ Performs an ISA Memory Write Cycle\r
+\r
+ @param This - A pointer to the EFI_ISA_IO_PROTOCOL instance. \r
+ @param Width - Signifies the width of the memory operation.\r
+ @param Offset - The offset in ISA memory space to start the memory operation. \r
+ @param Count - The number of memory operations to perform. \r
+ @param Buffer - The source buffer to write data from\r
+\r
+ @retval EFI_SUCCESS - The data was written to the device sucessfully.\r
+ @retval EFI_UNSUPPORTED - The Offset is not valid for this device.\r
+ @retval EFI_INVALID_PARAMETER - Width or Count, or both, were invalid.\r
+ @retval EFI_OUT_OF_RESOURCES - The request could not be completed due to a lack of resources.\r
+\r
+**/\r
EFI_STATUS\r
EFIAPI\r
IsaIoMemWrite (\r
IN UINTN Count,\r
IN OUT VOID *Buffer\r
)\r
-/*++\r
-\r
-Routine Description:\r
-\r
- Performs an ISA Memory Write Cycle\r
-\r
-Arguments:\r
-\r
- This - A pointer to the EFI_ISA_IO_PROTOCOL instance. \r
- Width - Signifies the width of the memory operation.\r
- Offset - The offset in ISA memory space to start the memory operation. \r
- Count - The number of memory operations to perform. \r
- Buffer - The source buffer to write data from\r
-\r
-Returns:\r
-\r
- EFI_SUCCESS - The data was written to the device sucessfully.\r
- EFI_UNSUPPORTED - The Offset is not valid for this device.\r
- EFI_INVALID_PARAMETER - Width or Count, or both, were invalid.\r
- EFI_OUT_OF_RESOURCES - The request could not be completed due to a lack of resources.\r
-\r
---*/\r
{\r
EFI_STATUS Status;\r
ISA_IO_DEVICE *IsaIoDevice;\r
return Status;\r
}\r
\r
+/**\r
+ Performs an ISA I/O Copy Memory \r
+\r
+ @param This - A pointer to the EFI_ISA_IO_PROTOCOL instance.\r
+ @param Width - Signifies the width of the memory copy operation.\r
+ @param DestOffset - The offset of the destination \r
+ @param SrcOffset - The offset of the source\r
+ @param Count - The number of memory copy operations to perform\r
+\r
+ @retval EFI_SUCCESS - The data was copied sucessfully.\r
+ @retval EFI_UNSUPPORTED - The DestOffset or SrcOffset is not valid for this device.\r
+ @retval EFI_INVALID_PARAMETER - Width or Count, or both, were invalid.\r
+ @retval EFI_OUT_OF_RESOURCES - The request could not be completed due to a lack of resources.\r
+\r
+**/\r
EFI_STATUS\r
EFIAPI\r
IsaIoCopyMem (\r
IN UINT32 SrcOffset,\r
IN UINTN Count\r
)\r
-/*++\r
-\r
-Routine Description:\r
-\r
- Performs an ISA I/O Copy Memory \r
-\r
-Arguments:\r
\r
- This - A pointer to the EFI_ISA_IO_PROTOCOL instance.\r
- Width - Signifies the width of the memory copy operation.\r
- DestOffset - The offset of the destination \r
- SrcOffset - The offset of the source\r
- Count - The number of memory copy operations to perform\r
-\r
-Returns:\r
-\r
- EFI_SUCCESS - The data was copied sucessfully.\r
- EFI_UNSUPPORTED - The DestOffset or SrcOffset is not valid for this device.\r
- EFI_INVALID_PARAMETER - Width or Count, or both, were invalid.\r
- EFI_OUT_OF_RESOURCES - The request could not be completed due to a lack of resources.\r
-\r
---*/\r
{\r
EFI_STATUS Status;\r
ISA_IO_DEVICE *IsaIoDevice;\r
return Status;\r
}\r
\r
+/**\r
+ Maps a memory region for DMA, note this implementation\r
+ only supports slave read/write operation to save code size.\r
+\r
+ @param This - A pointer to the EFI_ISA_IO_PROTOCOL instance.\r
+ @param Operation - Indicates the type of DMA (slave or bus master), and if \r
+ the DMA operation is going to read or write to system memory. \r
+ @param ChannelNumber - The slave channel number to use for this DMA operation. \r
+ If Operation and ChannelAttributes shows that this device \r
+ performs bus mastering DMA, then this field is ignored. \r
+ The legal range for this field is 0..7. \r
+ @param ChannelAttributes - The attributes of the DMA channel to use for this DMA operation\r
+ @param HostAddress - The system memory address to map to the device. \r
+ @param NumberOfBytes - On input the number of bytes to map. On output the number \r
+ of bytes that were mapped.\r
+ @param DeviceAddress - The resulting map address for the bus master device to use \r
+ to access the hosts HostAddress. \r
+ @param Mapping - A resulting value to pass to EFI_ISA_IO.Unmap().\r
+\r
+ @retval EFI_SUCCESS - The range was mapped for the returned NumberOfBytes.\r
+ @retval EFI_INVALID_PARAMETER - The Operation or HostAddress is undefined.\r
+ @retval EFI_UNSUPPORTED - The HostAddress can not be mapped as a common buffer.\r
+ @retval EFI_DEVICE_ERROR - The system hardware could not map the requested address.\r
+ @retval EFI_OUT_OF_RESOURCES - The memory pages could not be allocated.\r
+\r
+**/\r
STATIC\r
EFI_STATUS\r
IsaIoMap_OnlySupportSlaveReadWrite (\r
OUT EFI_PHYSICAL_ADDRESS *DeviceAddress,\r
OUT VOID **Mapping\r
)\r
-/*++\r
-\r
-Routine Description:\r
\r
- Maps a memory region for DMA, note this implementation\r
- only supports slave read/write operation to save code size.\r
-\r
-Arguments:\r
-\r
- This - A pointer to the EFI_ISA_IO_PROTOCOL instance.\r
- Operation - Indicates the type of DMA (slave or bus master), and if \r
- the DMA operation is going to read or write to system memory. \r
- ChannelNumber - The slave channel number to use for this DMA operation. \r
- If Operation and ChannelAttributes shows that this device \r
- performs bus mastering DMA, then this field is ignored. \r
- The legal range for this field is 0..7. \r
- ChannelAttributes - The attributes of the DMA channel to use for this DMA operation\r
- HostAddress - The system memory address to map to the device. \r
- NumberOfBytes - On input the number of bytes to map. On output the number \r
- of bytes that were mapped.\r
- DeviceAddress - The resulting map address for the bus master device to use \r
- to access the hosts HostAddress. \r
- Mapping - A resulting value to pass to EFI_ISA_IO.Unmap().\r
-\r
-Returns:\r
-\r
- EFI_SUCCESS - The range was mapped for the returned NumberOfBytes.\r
- EFI_INVALID_PARAMETER - The Operation or HostAddress is undefined.\r
- EFI_UNSUPPORTED - The HostAddress can not be mapped as a common buffer.\r
- EFI_DEVICE_ERROR - The system hardware could not map the requested address.\r
- EFI_OUT_OF_RESOURCES - The memory pages could not be allocated.\r
-\r
---*/\r
{\r
EFI_STATUS Status;\r
EFI_PHYSICAL_ADDRESS PhysicalAddress;\r
return EFI_SUCCESS;\r
}\r
\r
+/**\r
+ Maps a memory region for DMA. This implementation implement the \r
+ the full mapping support.\r
+\r
+ @param This - A pointer to the EFI_ISA_IO_PROTOCOL instance.\r
+ @param Operation - Indicates the type of DMA (slave or bus master), and if \r
+ the DMA operation is going to read or write to system memory. \r
+ @param ChannelNumber - The slave channel number to use for this DMA operation. \r
+ If Operation and ChannelAttributes shows that this device \r
+ performs bus mastering DMA, then this field is ignored. \r
+ The legal range for this field is 0..7. \r
+ @param ChannelAttributes - The attributes of the DMA channel to use for this DMA operation\r
+ @param HostAddress - The system memory address to map to the device. \r
+ @param NumberOfBytes - On input the number of bytes to map. On output the number \r
+ of bytes that were mapped.\r
+ @param DeviceAddress - The resulting map address for the bus master device to use \r
+ - to access the hosts HostAddress. \r
+ @param Mapping - A resulting value to pass to EFI_ISA_IO.Unmap().\r
+\r
+ @retval EFI_SUCCESS - The range was mapped for the returned NumberOfBytes.\r
+ @retval EFI_INVALID_PARAMETER - The Operation or HostAddress is undefined.\r
+ @retval EFI_UNSUPPORTED - The HostAddress can not be mapped as a common buffer.\r
+ @retval EFI_DEVICE_ERROR - The system hardware could not map the requested address.\r
+ @retval EFI_OUT_OF_RESOURCES - The memory pages could not be allocated.\r
+\r
+**/\r
STATIC\r
EFI_STATUS\r
IsaIoMap_FullSupport (\r
OUT EFI_PHYSICAL_ADDRESS *DeviceAddress,\r
OUT VOID **Mapping\r
)\r
-/*++\r
-\r
-Routine Description:\r
-\r
- Maps a memory region for DMA. This implementation implement the \r
- the full mapping support.\r
-\r
-Arguments:\r
-\r
- This - A pointer to the EFI_ISA_IO_PROTOCOL instance.\r
- Operation - Indicates the type of DMA (slave or bus master), and if \r
- the DMA operation is going to read or write to system memory. \r
- ChannelNumber - The slave channel number to use for this DMA operation. \r
- If Operation and ChannelAttributes shows that this device \r
- performs bus mastering DMA, then this field is ignored. \r
- The legal range for this field is 0..7. \r
- ChannelAttributes - The attributes of the DMA channel to use for this DMA operation\r
- HostAddress - The system memory address to map to the device. \r
- NumberOfBytes - On input the number of bytes to map. On output the number \r
- of bytes that were mapped.\r
- DeviceAddress - The resulting map address for the bus master device to use \r
- - to access the hosts HostAddress. \r
- Mapping - A resulting value to pass to EFI_ISA_IO.Unmap().\r
-\r
-Returns:\r
\r
- EFI_SUCCESS - The range was mapped for the returned NumberOfBytes.\r
- EFI_INVALID_PARAMETER - The Operation or HostAddress is undefined.\r
- EFI_UNSUPPORTED - The HostAddress can not be mapped as a common buffer.\r
- EFI_DEVICE_ERROR - The system hardware could not map the requested address.\r
- EFI_OUT_OF_RESOURCES - The memory pages could not be allocated.\r
-\r
---*/\r
{\r
EFI_STATUS Status;\r
BOOLEAN Master;\r
return EFI_SUCCESS;\r
}\r
\r
+/**\r
+ Maps a memory region for DMA\r
+\r
+ @param This - A pointer to the EFI_ISA_IO_PROTOCOL instance.\r
+ @param Operation - Indicates the type of DMA (slave or bus master), and if \r
+ the DMA operation is going to read or write to system memory. \r
+ @param ChannelNumber - The slave channel number to use for this DMA operation. \r
+ If Operation and ChannelAttributes shows that this device \r
+ performs bus mastering DMA, then this field is ignored. \r
+ The legal range for this field is 0..7. \r
+ @param ChannelAttributes - The attributes of the DMA channel to use for this DMA operation\r
+ @param HostAddress - The system memory address to map to the device. \r
+ @param NumberOfBytes - On input the number of bytes to map. On output the number \r
+ of bytes that were mapped.\r
+ @param DeviceAddress - The resulting map address for the bus master device to use \r
+ - to access the hosts HostAddress. \r
+ @param Mapping - A resulting value to pass to EFI_ISA_IO.Unmap().\r
+\r
+\r
+ @retval EFI_SUCCESS - The range was mapped for the returned NumberOfBytes.\r
+ @retval EFI_INVALID_PARAMETER - The Operation or HostAddress is undefined.\r
+ @retval EFI_UNSUPPORTED - The HostAddress can not be mapped as a common buffer.\r
+ @retval EFI_DEVICE_ERROR - The system hardware could not map the requested address.\r
+ @retval EFI_OUT_OF_RESOURCES - The memory pages could not be allocated.\r
+\r
+**/\r
EFI_STATUS\r
EFIAPI\r
IsaIoMap (\r
OUT EFI_PHYSICAL_ADDRESS *DeviceAddress,\r
OUT VOID **Mapping\r
)\r
-/*++\r
-\r
-Routine Description:\r
-\r
- Maps a memory region for DMA\r
-\r
-Arguments:\r
-\r
- This - A pointer to the EFI_ISA_IO_PROTOCOL instance.\r
- Operation - Indicates the type of DMA (slave or bus master), and if \r
- the DMA operation is going to read or write to system memory. \r
- ChannelNumber - The slave channel number to use for this DMA operation. \r
- If Operation and ChannelAttributes shows that this device \r
- performs bus mastering DMA, then this field is ignored. \r
- The legal range for this field is 0..7. \r
- ChannelAttributes - The attributes of the DMA channel to use for this DMA operation\r
- HostAddress - The system memory address to map to the device. \r
- NumberOfBytes - On input the number of bytes to map. On output the number \r
- of bytes that were mapped.\r
- DeviceAddress - The resulting map address for the bus master device to use \r
- - to access the hosts HostAddress. \r
- Mapping - A resulting value to pass to EFI_ISA_IO.Unmap().\r
-\r
-Returns:\r
-\r
- EFI_SUCCESS - The range was mapped for the returned NumberOfBytes.\r
- EFI_INVALID_PARAMETER - The Operation or HostAddress is undefined.\r
- EFI_UNSUPPORTED - The HostAddress can not be mapped as a common buffer.\r
- EFI_DEVICE_ERROR - The system hardware could not map the requested address.\r
- EFI_OUT_OF_RESOURCES - The memory pages could not be allocated.\r
\r
---*/\r
{\r
//\r
// Or unset Feature Flag PcdIsaBusSupportDma to disable support for ISA DMA.\r
);\r
}\r
}\r
+\r
+/**\r
+ Allocates a common buffer for DMA\r
+\r
+ @param This - A pointer to the EFI_ISA_IO_PROTOCOL instance.\r
+ @param Type - The type allocation to perform.\r
+ @param MemoryType - The type of memory to allocate.\r
+ @param Pages - The number of pages to allocate.\r
+ @param HostAddress - A pointer to store the base address of the allocated range.\r
+ @param Attributes - The requested bit mask of attributes for the allocated range.\r
+\r
+ @retval EFI_SUCCESS - The requested memory pages were allocated.\r
+ @retval EFI_INVALID_PARAMETER - Type is invalid or MemoryType is invalid or HostAddress is NULL\r
+ @retval EFI_UNSUPPORTED - Attributes is unsupported or the memory range specified \r
+ by HostAddress, Pages, and Type is not available for common buffer use.\r
+ @retval EFI_OUT_OF_RESOURCES - The memory pages could not be allocated.\r
+\r
+**/\r
EFI_STATUS\r
EFIAPI\r
IsaIoAllocateBuffer (\r
OUT VOID **HostAddress,\r
IN UINT64 Attributes\r
)\r
-/*++\r
-\r
-Routine Description:\r
-\r
- Allocates a common buffer for DMA\r
-\r
-Arguments:\r
-\r
- This - A pointer to the EFI_ISA_IO_PROTOCOL instance.\r
- Type - The type allocation to perform.\r
- MemoryType - The type of memory to allocate.\r
- Pages - The number of pages to allocate.\r
- HostAddress - A pointer to store the base address of the allocated range.\r
- Attributes - The requested bit mask of attributes for the allocated range.\r
-\r
-Returns:\r
-\r
- EFI_SUCCESS - The requested memory pages were allocated.\r
- EFI_INVALID_PARAMETER - Type is invalid or MemoryType is invalid or HostAddress is NULL\r
- EFI_UNSUPPORTED - Attributes is unsupported or the memory range specified \r
- by HostAddress, Pages, and Type is not available for common buffer use.\r
- EFI_OUT_OF_RESOURCES - The memory pages could not be allocated.\r
-\r
---*/\r
{\r
EFI_STATUS Status;\r
EFI_PHYSICAL_ADDRESS PhysicalAddress;\r
return Status;\r
}\r
\r
-EFI_STATUS\r
-EFIAPI\r
-IsaIoFreeBuffer (\r
- IN EFI_ISA_IO_PROTOCOL *This,\r
- IN UINTN Pages,\r
- IN VOID *HostAddress\r
- )\r
-/*++\r
-\r
-Routine Description:\r
+/**\r
\r
Frees a common buffer \r
\r
-Arguments:\r
+ @param This - A pointer to the EFI_ISA_IO_PROTOCOL instance.\r
+ @param Pages - The number of pages to free.\r
+ @param HostAddress - The base address of the allocated range.\r
\r
- This - A pointer to the EFI_ISA_IO_PROTOCOL instance.\r
- Pages - The number of pages to free.\r
- HostAddress - The base address of the allocated range.\r
\r
-Returns:\r
+ @retval EFI_SUCCESS - The requested memory pages were freed.\r
+ @retval EFI_INVALID_PARAMETER - The memory was not allocated with EFI_ISA_IO.AllocateBufer().\r
\r
- EFI_SUCCESS - The requested memory pages were freed.\r
- EFI_INVALID_PARAMETER - The memory was not allocated with EFI_ISA_IO.AllocateBufer().\r
+**/\r
\r
---*/\r
+EFI_STATUS\r
+EFIAPI\r
+IsaIoFreeBuffer (\r
+ IN EFI_ISA_IO_PROTOCOL *This,\r
+ IN UINTN Pages,\r
+ IN VOID *HostAddress\r
+ )\r
{\r
EFI_STATUS Status;\r
EFI_PHYSICAL_ADDRESS PhysicalAddress;\r