RTEMS CPU Kit with SuperCore  4.11.2
Functions
drvmgr_for_each_list_dev.c File Reference
#include <drvmgr/drvmgr.h>
#include <drvmgr/drvmgr_list.h>
#include "drvmgr_internal.h"
Include dependency graph for drvmgr_for_each_list_dev.c:

Functions

int drvmgr_for_each_listdev (struct drvmgr_list *devlist, unsigned int state_set_mask, unsigned int state_clr_mask, int(*func)(struct drvmgr_dev *dev, void *arg), void *arg)
 Calls func() for every device found matching the search requirements of set_mask and clr_mask. More...
 

Function Documentation

◆ drvmgr_for_each_listdev()

int drvmgr_for_each_listdev ( struct drvmgr_list devlist,
unsigned int  state_set_mask,
unsigned int  state_clr_mask,
int(*)(struct drvmgr_dev *dev, void *arg)  func,
void *  arg 
)

Calls func() for every device found matching the search requirements of set_mask and clr_mask.

Each bit set in set_mask must be set in the device state bit mask (dev->state), and Each bit in the clr_mask must be cleared in the device state bit mask (dev->state). There are three special cases:

  1. If state_set_mask and state_clr_mask are zero the state bits are ignored and all cores are treated as a match.
  2. If state_set_mask is zero the function func will not be called due to a bit being set in the state mask.
  3. If state_clr_mask is zero the function func will not be called due to a bit being cleared in the state mask.

If the function func() returns a non-zero value then for_each_dev will return imediatly with the same return value as func() returned.

Parameters
devlistThe list to iterate though searching for devices.
state_set_maskDefines the bits that must be set in dev->state
state_clr_maskDefines the bits that must be cleared in dev->state
funcFunction called on each