RTEMS CPU Kit with SuperCore  4.11.3
Macros | Functions | Variables
drvmgr.c File Reference
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <drvmgr/drvmgr.h>
#include <drvmgr/drvmgr_confdefs.h>
#include "drvmgr_internal.h"
Include dependency graph for drvmgr.c:

Macros

#define DBG(x...)
 

Functions

void _DRV_Manager_init_level (int level)
 Take all devices into init level 'level', all devices registered later will directly be taken into this level as well, ensuring that all registerd devices has been taken into the level.
 
void _DRV_Manager_initialization (void)
 Initialize data structures of the driver management system. More...
 
void drvmgr_init_update (void)
 
int drvmgr_root_drv_register (struct drvmgr_drv *drv)
 Register Root Bus device driver.
 
int drvmgr_drv_register (struct drvmgr_drv *drv)
 Register a driver.
 
int drvmgr_dev_register (struct drvmgr_dev *dev)
 Register a device.
 
int drvmgr_bus_register (struct drvmgr_bus *bus)
 Register a bus.
 
int drvmgr_alloc_dev (struct drvmgr_dev **pdev, int extra)
 Allocate a device structure, if no memory available rtems_error_fatal_occurred is called. More...
 
int drvmgr_alloc_bus (struct drvmgr_bus **pbus, int extra)
 Allocate a bus structure, if no memory available rtems_error_fatal_occurred is called. More...
 
void drvmgr_bus_res_add (struct drvmgr_bus *bus, struct drvmgr_bus_res *bres)
 Add resources to a bus, typically used by a bus driver. More...
 

Variables

struct drvmgr drvmgr
 

Function Documentation

◆ _DRV_Manager_initialization()

void _DRV_Manager_initialization ( void  )

Initialize data structures of the driver management system.

Calls predefined register driver functions so that drivers can register themselves.

Referenced by drvmgr_init(), and rtems_initialize_before_drivers().

◆ drvmgr_alloc_bus()

int drvmgr_alloc_bus ( struct drvmgr_bus **  pbus,
int  extra 
)

Allocate a bus structure, if no memory available rtems_error_fatal_occurred is called.

The 'extra' argment tells how many bytes extra space is to be allocated after the device structure, this is typically used for "businfo" structures. The extra space is always aligned to a 4-byte boundary.

◆ drvmgr_alloc_dev()

int drvmgr_alloc_dev ( struct drvmgr_dev **  pdev,
int  extra 
)

Allocate a device structure, if no memory available rtems_error_fatal_occurred is called.

The 'extra' argment tells how many bytes extra space is to be allocated after the device structure, this is typically used for "businfo" structures. The extra space is always aligned to a 4-byte boundary.

◆ drvmgr_bus_res_add()

void drvmgr_bus_res_add ( struct drvmgr_bus bus,
struct drvmgr_bus_res bres 
)

Add resources to a bus, typically used by a bus driver.

Parameters
busThe Bus to add the resources to.
resAn array with Driver resources, all together are called bus resources.

References drvmgr_bus_res::next, and drvmgr_bus::reslist.

Variable Documentation

◆ drvmgr

struct drvmgr drvmgr
Initial value:
= {
.level = 0,
.initializing_objs = 0,
.lock = 0,
.root_dev = {0},
.root_drv = NULL,
.drivers = LIST_INITIALIZER(struct drvmgr_drv, next),
.buses = {
LIST_INITIALIZER(struct drvmgr_bus, next),
LIST_INITIALIZER(struct drvmgr_bus, next),
LIST_INITIALIZER(struct drvmgr_bus, next),
LIST_INITIALIZER(struct drvmgr_bus, next),
LIST_INITIALIZER(struct drvmgr_bus, next),
},
.buses_inactive = LIST_INITIALIZER(struct drvmgr_bus, next),
.devices = {
LIST_INITIALIZER(struct drvmgr_dev, next),
LIST_INITIALIZER(struct drvmgr_dev, next),
LIST_INITIALIZER(struct drvmgr_dev, next),
LIST_INITIALIZER(struct drvmgr_dev, next),
LIST_INITIALIZER(struct drvmgr_dev, next),
},
.devices_inactive = LIST_INITIALIZER(struct drvmgr_dev, next),
}
Bus information.
Definition: drvmgr.h:233
Device information.
Definition: drvmgr.h:271
Device driver description.
Definition: drvmgr.h:301