l4::io Interface Reference

import "generic_io.idl";

List of all members.

Public Member Functions

Miscellaneous Services
Client registration and information purposes.

long register_client ([in] l4_io_drv_t type)
 Register new io client.
long unregister_client (l4_threadid_t client)
 Unregister io client.
long map_info ([out] fpage *info)
 Initiate mapping of io info page.
Resource Allocation
Allocation and release of shared system resources - ports, memory, DMA channels.

long request_region ([in] l4_uint16_t addr,[in] l4_uint16_t len,[out] l4_size_t *num,[out, size_is(num), max_is(l4_io_max_fpages), prealloc_client] fpage regions[])
 Register for exclusive use of IO port region.
long release_region ([in] l4_uint16_t addr,[in] l4_uint16_t len)
 Release IO port region.
long request_mem_region ([in] unsigned long addr,[in] unsigned long len,[in] unsigned long flags,[out] fpage *region)
 Register for exclusive use of IO memory region.
long search_mem_region ([in] unsigned long addr,[out] unsigned long *start,[out] l4_size_t *len)
 Search IO memory region given an address.
long release_mem_region ([in] unsigned long addr,[in] unsigned long len)
 Release IO memory region.
long request_dma ([in] unsigned long channel)
 Register for exclusive use of ISA DMA channel.
long release_dma ([in] unsigned long channel)
 Release ISA DMA channel.
long release_client ([in] l4_threadid_t client)
 Release all ressources of a client. For internal use by the event thread only.
PCI Services
Identification of devices and support for configuration space access.

long pci_find_slot ([in] unsigned long bus,[in] unsigned long slot,[out] l4_io_pci_dev_t *pci_dev)
 Locate PCI device from a given PCI slot.
long pci_find_device ([in] unsigned short vendor_id,[in] unsigned short device_id,[in] l4_io_pdev_t start_at,[out] l4_io_pci_dev_t *pci_dev)
 Search for PCI device by vendor/device id.
long pci_find_class ([in] unsigned long class_id,[in] l4_io_pdev_t start_at,[out] l4_io_pci_dev_t *pci_dev)
 Search for PCI device by class.
long pci_enable_device ([in] l4_io_pdev_t pdev)
 Initialize device before it's used by a driver.
long pci_disable_device ([in] l4_io_pdev_t pdev)
 Finalize device after use.
long pci_set_master ([in] l4_io_pdev_t pdev)
 Enable busmastering for PCI device.
long pci_set_power_state ([in] l4_io_pdev_t pdev,[in, out] int *state)
 Set power management state of PCI device.
long pci_read_config_byte ([in] l4_io_pdev_t pdev,[in] long offset,[out] byte *val)
 Read configuration BYTE registers of PCI device.
long pci_read_config_word ([in] l4_io_pdev_t pdev,[in] long offset,[out] l4_uint16_t *val)
 Read configuration WORD registers of PCI device.
long pci_read_config_dword ([in] l4_io_pdev_t pdev,[in] long offset,[out] l4_uint32_t *val)
 Read configuration DWORD registers of PCI device.
long pci_write_config_byte ([in] l4_io_pdev_t pdev,[in] long offset,[in] byte val)
 Write configuration BYTE registers of PCI device.
long pci_write_config_word ([in] l4_io_pdev_t pdev,[in] long offset,[in] unsigned short val)
 Write configuration WORD registers of PCI device.
long pci_write_config_dword ([in] l4_io_pdev_t pdev,[in] long offset,[in] unsigned long val)
 Write configuration DWORD registers of PCI device.


Detailed Description

I/O Server Interface

Member Function Documentation

long l4::io::register_client ( [in] l4_io_drv_t  type  ) 

Register new io client.

Parameters:
type client info
Returns:
0 on success, negative error code otherwise

long l4::io::unregister_client ( l4_threadid_t  client  ) 

Unregister io client.

Parameters:
client the client to unregister, must be equal to the caller if called by a client (this function is also called by the events thread).
Returns:
0 on success, negative error code otherwise

long l4::io::map_info ( [out] fpage *  info  ) 

Initiate mapping of io info page.

Parameters:
info flexpage for io info
Returns:
0 on success, negative error code otherwise

long l4::io::request_region ( [in] l4_uint16_t  addr,
[in] l4_uint16_t  len,
[out] l4_size_t *  num,
[out, size_is(num), max_is(l4_io_max_fpages), prealloc_client] fpage  regions[] 
)

Register for exclusive use of IO port region.

Parameters:
addr start of IO port region
len length of IO port region
Return values:
regions I/O flexpages describing the requested region
num number of valid entries in region array
Returns:
0 on success, negative error code otherwise
request_region() ALWAYS succeeds under Linux; here it could FAIL!

Note: The number of elements in the region array cannot exceed log2 (2^16) * 2, which is 32.

long l4::io::release_region ( [in] l4_uint16_t  addr,
[in] l4_uint16_t  len 
)

Release IO port region.

Parameters:
addr start of IO port region
len length of IO port region

long l4::io::request_mem_region ( [in] unsigned long  addr,
[in] unsigned long  len,
[in] unsigned long  flags,
[out] fpage *  region 
)

Register for exclusive use of IO memory region.

Parameters:
addr start of memory region
len length of memory region
flags bit 0=1: map memory cacheable (otherwise uncacheable) bit 1=1: set MTRR with attribute ``write combining'' to that physical memory range
Return values:
region fpage for memory region
Returns:
0 on success, negative error code otherwise
If available the region is reserved and replied as fpage.

This is Linux' request_mem_region()+ioremap().

long l4::io::search_mem_region ( [in] unsigned long  addr,
[out] unsigned long *  start,
[out] l4_size_t *  len 
)

Search IO memory region given an address.

Parameters:
addr Address to search
Return values:
start Start of region if found
len Length of region if found
Returns:
0 if region was found, <0 on error
XXX For me this function looks somewhat dubious and will not appear in the next l4io device manager version. - krishna

long l4::io::release_mem_region ( [in] unsigned long  addr,
[in] unsigned long  len 
)

Release IO memory region.

Parameters:
addr start of memory region
len length of memory region
Release initiates page flushing.

This'll be Linux' iounmap()+release_mem_region().

long l4::io::request_dma ( [in] unsigned long  channel  ) 

Register for exclusive use of ISA DMA channel.

Parameters:
channel DMA channel number
Returns:
0 on success, negative error code otherwise

long l4::io::release_dma ( [in] unsigned long  channel  ) 

Release ISA DMA channel.

Parameters:
channel DMA channel number

long l4::io::release_client ( [in] l4_threadid_t  client  ) 

Release all ressources of a client. For internal use by the event thread only.

Parameters:
client Client

long l4::io::pci_find_slot ( [in] unsigned long  bus,
[in] unsigned long  slot,
[out] l4_io_pci_dev_t pci_dev 
)

Locate PCI device from a given PCI slot.

Parameters:
bus number of PCI bus on which desired device resides
slot number of PCI slot in which desired device resides
Return values:
pci_dev data structure for PCI device found
Returns:
0 on success, negative error code otherwise

long l4::io::pci_find_device ( [in] unsigned short  vendor_id,
[in] unsigned short  device_id,
[in] l4_io_pdev_t  start_at,
[out] l4_io_pci_dev_t pci_dev 
)

Search for PCI device by vendor/device id.

Parameters:
vendor_id PCI vendor id to match (maybe PCI_ANY_ID)
device_id PCI device id to match (maybe PCI_ANY_ID)
start_at previous PCI device found, or 0 for new search
Return values:
pci_dev data structure for PCI device found
Returns:
0 on success, negative error code otherwise

long l4::io::pci_find_class ( [in] unsigned long  class_id,
[in] l4_io_pdev_t  start_at,
[out] l4_io_pci_dev_t pci_dev 
)

Search for PCI device by class.

Parameters:
class_id class designation
start_at previous PCI device found, or 0 for new search
Return values:
pci_dev data structure for PCI device found
Returns:
0 on success, negative error code otherwise

long l4::io::pci_enable_device ( [in] l4_io_pdev_t  pdev  ) 

Initialize device before it's used by a driver.

Parameters:
pdev handle of PCI device to be initialized
Returns:
0 on success, negative error code otherwise

long l4::io::pci_disable_device ( [in] l4_io_pdev_t  pdev  ) 

Finalize device after use.

Parameters:
pdev handle of PCI device to be initialized
Returns:
0 on success, negative error code otherwise

long l4::io::pci_set_master ( [in] l4_io_pdev_t  pdev  ) 

Enable busmastering for PCI device.

Parameters:
pdev handle of PCI device
Returns:
0 on success, negative error code otherwise

long l4::io::pci_set_power_state ( [in] l4_io_pdev_t  pdev,
[in, out] int *  state 
)

Set power management state of PCI device.

Parameters:
pdev handle of PCI device
state new PM state
Return values:
state old PM state
Returns:
0 on success, negative error code otherwise

long l4::io::pci_read_config_byte ( [in] l4_io_pdev_t  pdev,
[in] long  offset,
[out] byte *  val 
)

Read configuration BYTE registers of PCI device.

Parameters:
pdev PCI device handle
offset PCI configuration register
Return values:
val register value read
Returns:
0 on success, negative error code otherwise

long l4::io::pci_read_config_word ( [in] l4_io_pdev_t  pdev,
[in] long  offset,
[out] l4_uint16_t *  val 
)

Read configuration WORD registers of PCI device.

Parameters:
pdev PCI device
offset PCI configuration register
Return values:
val register value read
Returns:
0 on success, negative error code otherwise

long l4::io::pci_read_config_dword ( [in] l4_io_pdev_t  pdev,
[in] long  offset,
[out] l4_uint32_t *  val 
)

Read configuration DWORD registers of PCI device.

Parameters:
pdev PCI device
offset PCI configuration register
Return values:
val register value read
Returns:
0 on success, negative error code otherwise

long l4::io::pci_write_config_byte ( [in] l4_io_pdev_t  pdev,
[in] long  offset,
[in] byte  val 
)

Write configuration BYTE registers of PCI device.

Parameters:
pdev PCI device
offset PCI configuration register
val register value to write
Returns:
0 on success, negative error code otherwise

long l4::io::pci_write_config_word ( [in] l4_io_pdev_t  pdev,
[in] long  offset,
[in] unsigned short  val 
)

Write configuration WORD registers of PCI device.

Parameters:
pdev PCI device
offset PCI configuration register
val register value to write
Returns:
0 on success, negative error code otherwise

long l4::io::pci_write_config_dword ( [in] l4_io_pdev_t  pdev,
[in] long  offset,
[in] unsigned long  val 
)

Write configuration DWORD registers of PCI device.

Parameters:
pdev PCI device
offset PCI configuration register
val register value to write
Returns:
0 on success, negative error code otherwise


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

generic_io, written by Christian Helmuth  © 2003 Technische Universitaet Dresden