genode/os/include/pci_session/pci_session.h

75 lines
2.0 KiB
C
Raw Normal View History

2011-12-22 16:19:25 +01:00
/*
* \brief PCI session interface
* \author Norman Feske
* \date 2008-01-28
*/
/*
2013-01-10 21:44:47 +01:00
* Copyright (C) 2008-2013 Genode Labs GmbH
2011-12-22 16:19:25 +01:00
*
* This file is part of the Genode OS framework, which is distributed
* under the terms of the GNU General Public License version 2.
*/
#ifndef _INCLUDE__PCI_SESSION__PCI_SESSION_H_
#define _INCLUDE__PCI_SESSION__PCI_SESSION_H_
#include <pci_device/pci_device.h>
#include <session/session.h>
namespace Pci {
typedef Genode::Capability<Device> Device_capability;
struct Session : Genode::Session
{
static const char *service_name() { return "PCI"; }
virtual ~Session() { }
/**
* Find first accessible device
*/
virtual Device_capability first_device() = 0;
/**
* Find next accessible device
*
* \param prev_device previous device
*
* The 'prev_device' argument is used to iterate through all
* devices.
*/
virtual Device_capability next_device(Device_capability prev_device) = 0;
/**
* Free server-internal data structures representing the device
*
* Use this function to relax the heap partition of your PCI session.
*/
virtual void release_device(Device_capability device) = 0;
/**
* Provide mapping to device configuration space of 4k, known as
* "Enhanced Configuration Access Mechanism (ECAM) for PCI Express
*/
virtual Genode::Io_mem_dataspace_capability config_extended(Device_capability) = 0;
2011-12-22 16:19:25 +01:00
/*********************
** RPC declaration **
*********************/
GENODE_RPC(Rpc_first_device, Device_capability, first_device);
GENODE_RPC(Rpc_next_device, Device_capability, next_device,
Device_capability);
2011-12-22 16:19:25 +01:00
GENODE_RPC(Rpc_release_device, void, release_device, Device_capability);
GENODE_RPC(Rpc_config_extended, Genode::Io_mem_dataspace_capability,
config_extended, Device_capability);
2011-12-22 16:19:25 +01:00
GENODE_RPC_INTERFACE(Rpc_first_device, Rpc_next_device,
Rpc_release_device, Rpc_config_extended);
2011-12-22 16:19:25 +01:00
};
}
#endif /* _INCLUDE__PCI_SESSION__PCI_SESSION_H_ */