FreeBSD/sys/dev/isci/isci.c
/**
 * @brief In this method the user must write to PCI memory via access.
 *        This method is used for access to memory space and IO space.
 *
 * @param[in]  controller The controller for which to read a DWORD.
 * @param[in]  address This parameter depicts the address into
 *             which to write.
 * @param[out] write_value This parameter depicts the value being written
 *             into the PCI memory location.
 *
 * @todo These PCI memory access calls likely needs to be optimized into macros?
 */
@brief In this method the user must write to PCI memory via access.
This method is used for access to memory space and IO space.

@param[in]  controller The controller for which to read a DWORD.
@param[in]  address This parameter depicts the address into
which to write.
@param[out] write_value This parameter depicts the value being written
into the PCI memory location.


@brief In this method the user must write to PCI memory via access . This method is used for access to memory space and IO space . @param [ in ] controller The controller for which to read a DWORD . @param [ in ] address This parameter depicts the address into which to write . @param [ out ] write_value This parameter depicts the value being written into the PCI memory location .
void
scic_cb_pci_write_dword(SCI_CONTROLLER_HANDLE_T scic_controller,
    void *address, uint32_t write_value)
{
	SCI_CONTROLLER_HANDLE_T scif_controller =
	    (SCI_CONTROLLER_HANDLE_T) sci_object_get_association(scic_controller);
	struct ISCI_CONTROLLER *isci_controller =
	    (struct ISCI_CONTROLLER *) sci_object_get_association(scif_controller);
	struct isci_softc *isci = isci_controller->isci;
	uint32_t bar = (uint32_t)(((POINTER_UINT)address & 0xF0000000) >> 28);
	bus_size_t offset = (bus_size_t)((POINTER_UINT)address & 0x0FFFFFFF);
	bus_space_write_4(isci->pci_bar[bar].bus_tag,
	    isci->pci_bar[bar].bus_handle, offset, write_value);
}
void scic_cb_pci_write_dword ( SCI_CONTROLLER_HANDLE_T scic_controller , void * address , uint32_t write_value ) { SCI_CONTROLLER_HANDLE_T scif_controller = ( SCI_CONTROLLER_HANDLE_T ) sci_object_get_association ( scic_controller ) ; struct ISCI_CONTROLLER * isci_controller = ( struct ISCI_CONTROLLER * ) sci_object_get_association ( scif_controller ) ; struct isci_softc * isci = isci_controller -> isci ; uint32_t bar = ( uint32_t ) ( ( ( POINTER_UINT ) address & 0xF0000000 ) >> 28 ) ; bus_size_t offset = ( bus_size_t ) ( ( POINTER_UINT ) address & 0x0FFFFFFF ) ; bus_space_write_4 ( isci -> pci_bar [ bar ] . bus_tag , isci -> pci_bar [ bar ] . bus_handle , offset , write_value ) ; }
@brief In this method the user must write to PCI memory via access.
@brief In this method the user must write to PCI memory via access .