Overview   API Reference  

l4io_device Struct Reference

L4io host device to access physical devices from the host machine. More...

#include <l4io_device.hpp>

Inheritance diagram for l4io_device:

Inheritance graph
[legend]
Collaboration diagram for l4io_device:

Collaboration graph
[legend]

List of all members.

Public Member Functions

 l4io_device (machine_base &machine, const l4io_pci_dev_t &device, bool same_irq=false)
virtual uint32_t read_ioport (l4_port_t port, access_size access_size)
 Stub implementation, which always returns an invalid value.
virtual int write_ioport (l4_port_t port, uint32_t data, access_size access_size)
 Stub implementation, which always returns -L4_ENOTSUPP.
virtual l4_hva_t map_mmio_region (int flags, l4_gpa_t base, l4_gpa_t size=1)
 Stub implementation, which always returns an invalid value (0).
virtual int unmap_mmio_region (l4_gpa_t base, l4_gpa_t size=1)
 Stub implementation, which always returns -L4_ENOTSUPP.
virtual int reset (void)
 Resets the device's state back to defaults as when powering up the machine.
virtual l4_umword_t read_config_space (pci_config_header16::offset_t offset, access_size access_size)
 Emulates a device's PCI configuration space read access and returns the value that should have been read.
virtual int write_config_space (pci_config_header16::offset_t offset, l4_umword_t data, access_size access_size)
 Emulates a device's PCI configuration space write access.

Static Public Member Functions

static int create (vector< pci_device * > &devices, machine_base &machine, config_node &device_node)

Protected Types

typedef pci_device_base
< l4io_device_config_space > 
super_type

Protected Member Functions

virtual int ioregion_relocated (uint8_t region_num, l4_gpa_t old_base)
 Called whenever the PCI configuration space write handler updates an address register.
virtual int fill_config_space (void)
virtual int search_and_change_iospace_region (l4_port_t port)
template<typename WordT>
WordT read_l4io_config_space (const pci_config_header16::offset_t offset)
template<typename WordT>
int write_l4io_config_space (const pci_config_header16::offset_t offset, const WordT value)

Protected Attributes

const l4io_pci_dev_t device
bitops mmio_regions_requested
semaphore device_lock


Detailed Description

L4io host device to access physical devices from the host machine.

Member Function Documentation

uint32_t l4io_device::read_ioport ( l4_port_t  port,
access_size  access_size 
) [virtual]

Stub implementation, which always returns an invalid value.

Implemented here as a dummy to avoid unnecessary overriding in descendant classes. This function is intended to be overridden.

Reimplemented from device_base.

References iospace_handler::INVALID.

int l4io_device::write_ioport ( l4_port_t  port,
uint32_t  data,
access_size  access_size 
) [virtual]

Stub implementation, which always returns -L4_ENOTSUPP.

Implemented here as a dummy to avoid unnecessary overriding in descendant classes. This function is intended to be overridden.

Reimplemented from device_base.

l4_hva_t l4io_device::map_mmio_region ( int  flags,
l4_gpa_t  base,
l4_gpa_t  size = 1 
) [virtual]

int l4io_device::unmap_mmio_region ( l4_gpa_t  base,
l4_gpa_t  size = 1 
) [virtual]

l4_umword_t l4io_device::read_config_space ( pci_config_header16::offset_t  offset,
access_size  access_size 
) [virtual]

Emulates a device's PCI configuration space read access and returns the value that should have been read.

This function is intended to be overridden.

Reimplemented from pci_device_base< l4io_device_config_space >.

References pci_device_base< l4io_device_config_space >::config_space, pci_device_base< l4io_device_config_space >::name(), and pci_device_base< l4io_device_config_space >::read_config_space().

int l4io_device::write_config_space ( pci_config_header16::offset_t  offset,
l4_umword_t  data,
access_size  access_size 
) [virtual]

int l4io_device::ioregion_relocated ( uint8_t  region_num,
l4_gpa_t  old_base 
) [protected, virtual]

Called whenever the PCI configuration space write handler updates an address register.

The corresponding pci_ioregion has already been updated. Only resources may be freed/(re-)requested to respond to the new location's accesses. The default implementation simply unregisters and registers itself.

Reimplemented from pci_device_base< l4io_device_config_space >.

References pci_device_base< l4io_device_config_space >::ioregion_relocated(), pci_device_base< l4io_device_config_space >::ioregions, pci_ioregion::is_iospace(), pci_device_base< l4io_device_config_space >::name(), and pci_ioregion::print().


The documentation for this struct was generated from the following files:

L4vmm Reference Manual, written by Mario Schwalbe  © 2006-2008