Overview   API Reference  

pci_ioregion Struct Reference

Class describing a PCI I/O region (mechanism) as defined by the address registers in the PCI configuration space. More...

#include <pci_ioregion.hpp>

Inheritance diagram for pci_ioregion:

Inheritance graph
[legend]
Collaboration diagram for pci_ioregion:

Collaboration graph
[legend]

List of all members.

Public Types

enum  type {
  UNUSED = 0x00, IOSPACE = 0x01, MEM = 0x02, MEM_PREFETCH = 0x04,
  ROM = 0x08, IOMEMORY = MEM | MEM_PREFETCH | ROM, ALL_MASK = UNUSED | IOSPACE | MEM | MEM_PREFETCH | ROM | IOMEMORY
}
 This PCI I/O region's type. More...
typedef resource_region< l4_gpa_t > super_type

Public Member Functions

 pci_ioregion (const enum type type, const l4_gpa_t base, const l4_gpa_t size, const l4_hva_t virtual_base=0)
 pci_ioregion (const union pci_config_header64::base_address &reg, const l4_gpa_t size, const l4_hva_t virtual_base=0)
 pci_ioregion (const union pci_config_header64::expansion_ROM_address &reg, const l4_gpa_t size, const l4_hva_t virtual_base)
pci_ioregionoperator() (const enum type type, const l4_gpa_t base, const l4_gpa_t size, const l4_hva_t virtual_base=0)
pci_ioregionoperator() (const union pci_config_header64::base_address &reg, const l4_gpa_t size, const l4_hva_t virtual_base=0)
pci_ioregionoperator() (const union pci_config_header64::expansion_ROM_address &reg, const l4_gpa_t size, const l4_hva_t virtual_base)
pci_ioregionreset (void)
 Resets this PCI I/O region's physical base address to 0 as when powering up the machine.
bool is (const enum type type) const
 Returns whether this PCI I/O region is the specified type.
bool is_iospace (void) const
 Returns whether this PCI I/O region is an I/O space region.
bool is_iomemory (void) const
 Returns whether this PCI I/O region is an I/O memory region.
bool is_located (void) const
 Returns whether this PCI I/O region has been located by the client operating system.
bool is_used (void) const
 Returns whether this PCI I/O region is used by the owning PCI device.
l4_gpa_t size_mask (void) const
 Returns this PCI I/O region's size mask.
template<typename WordT>
WordT base2bar (void) const
 Calculates the word for the current base to be stored in the PCI configuration space (in CPU byte order).
template<typename WordT>
WordT size2bar (void) const
 Calculates the word for the current size to be stored in the PCI configuration space (in CPU byte order).
 operator l4_umword_t (void) const
 Calculates the word for the current base to be stored in the PCI configuration space (in CPU byte order).
const char * type2string (void) const
 Returns this PCI I/O region's type as string.
int print (const char *prefix="", const char *suffix="") const
 Prints this PCI I/O region's base, end, size, and type.
int print_short (const char *prefix="", const char *suffix="") const
 Prints this PCI I/O region's base, size, and type.

Static Public Member Functions

template<typename WordT>
static WordT register_value (const enum type type, const WordT value)
 Calculates the word for the specified value (usually base or size) to be stored in the PCI configuration space (in CPU byte order).
static const char * type2string (const enum type type)
 Returns the specified PCI I/O region type as string.

Public Attributes

enum pci_ioregion::type type
 This PCI I/O region's type.
l4_hva_t virtual_base
 This PCI I/O region's corresponding virtual base address, if applicable.


Detailed Description

Class describing a PCI I/O region (mechanism) as defined by the address registers in the PCI configuration space.

A value of 0 has a special meaning for base & size: A 0 base indicates that the region is not located by the client operating system. A 0 size indicates that the region is not used by the device.


Member Enumeration Documentation

This PCI I/O region's type.

Enumerator:
UNUSED  currently not used
IOSPACE  I/O space.
MEM  mapped memory
MEM_PREFETCH  prefetchable (cachable) mapped memory
ROM  expansion ROM
IOMEMORY  any type of I/O memory (used in search functions)
ALL_MASK  mask with all used bits set


Member Function Documentation

l4_gpa_t pci_ioregion::size_mask ( void   )  const [inline]

Returns this PCI I/O region's size mask.

That is a value with the upper bits set and the lower (not modifiable) bits cleared.

Referenced by size2bar().


Member Data Documentation

This PCI I/O region's corresponding virtual base address, if applicable.

For I/O memory regions, this value should be initialized upon construction. I/O space regions don't need it.

Referenced by l4io_device::map_mmio_region(), and l4io_device::unmap_mmio_region().


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

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