libmetal
|
Data Structures | |
struct | metal_bus_ops |
struct | metal_bus |
struct | metal_device |
Macros | |
#define | METAL_MAX_DEVICE_REGIONS 32 |
Functions | |
int | metal_bus_register (struct metal_bus *bus) |
Register a libmetal bus. More... | |
int | metal_bus_unregister (struct metal_bus *bus) |
Unregister a libmetal bus. More... | |
int | metal_bus_find (const char *name, struct metal_bus **bus) |
Find a libmetal bus by name. More... | |
int | metal_register_generic_device (struct metal_device *device) |
Statically register a generic libmetal device. More... | |
int | metal_device_open (const char *bus_name, const char *dev_name, struct metal_device **device) |
Open a libmetal device by name. More... | |
void | metal_device_close (struct metal_device *device) |
Close a libmetal device. More... | |
static struct metal_io_region * | metal_device_io_region (struct metal_device *device, unsigned int index) |
Get an I/O region accessor for a device region. More... | |
Variables | |
struct metal_bus | metal_generic_bus |
#define METAL_MAX_DEVICE_REGIONS 32 |
int metal_bus_find | ( | const char * | name, |
struct metal_bus ** | bus | ||
) |
Find a libmetal bus by name.
[in] | name | Bus name. |
[out] | bus | Returned bus handle. |
int metal_bus_register | ( | struct metal_bus * | bus | ) |
Register a libmetal bus.
[in] | bus | Pre-initialized bus structure. |
int metal_bus_unregister | ( | struct metal_bus * | bus | ) |
Unregister a libmetal bus.
[in] | bus | Pre-registered bus structure. |
void metal_device_close | ( | struct metal_device * | device | ) |
Close a libmetal device.
[in] | device | Device handle. |
|
inlinestatic |
Get an I/O region accessor for a device region.
[in] | device | Device handle. |
[in] | index | Region index. |
int metal_device_open | ( | const char * | bus_name, |
const char * | dev_name, | ||
struct metal_device ** | device | ||
) |
Open a libmetal device by name.
[in] | bus_name | Bus name. |
[in] | dev_name | Device name. |
[out] | device | Returned device handle. |
int metal_register_generic_device | ( | struct metal_device * | device | ) |
Statically register a generic libmetal device.
In non-Linux systems, devices are always required to be statically registered at application initialization. In Linux system, devices can be dynamically opened via sysfs or libfdt based enumeration at runtime. This interface is used for static registration of devices. Subsequent calls to metal_device_open() look up in this list of pre-registered devices on the "generic" bus. "generic" bus is used on non-Linux system to group the memory mapped devices.
[in] | device | Generic device. |
struct metal_bus metal_generic_bus |
Libmetal generic bus.