PebbleOS v4.47.0-1362-gd278268fe
Loading...
Searching...
No Matches
Remote processor drivers

Interface for remote processor drivers. More...

Data Structures

struct  pbl_rproc_ops
 Remote processor operations, implemented by the providers, called with the lock held. More...
 
struct  pbl_rproc_state
 Remote processor state, kept by the class. More...
 
struct  pbl_rproc
 Remote processor. More...
 

Macros

#define PBL_RPROC_STATE_DEFINE(sym)
 Define the state of a remote processor, for providers.
 
#define PBL_RPROC_INIT(sym, _name, _init, _parent, _ops)
 Initializer of a struct pbl_rproc, for providers.
 

Functions

int pbl_rproc_auto_boot (const struct pbl_rproc *rproc)
 Boot a remote processor from its provider's init, for providers.
 

Detailed Description

Interface for remote processor drivers.

A driver embeds a struct pbl_rproc in its instance, sets it up with PBL_RPROC_STATE_DEFINE() and PBL_RPROC_INIT(), and implements the struct pbl_rproc_ops the class calls.


Data Structure Documentation

◆ pbl_rproc_state

struct pbl_rproc_state

Remote processor state, kept by the class.

Data Fields
struct pbl_mutex lock Serializes boot and shutdown.
uint8_t power Number of boots not yet shut down.

◆ pbl_rproc

struct pbl_rproc

Remote processor.

Data Fields
struct pbl_device dev Device.
const struct pbl_rproc_ops * ops Operations.
struct pbl_rproc_state * state State.

Macro Definition Documentation

◆ PBL_RPROC_INIT

#define PBL_RPROC_INIT (   sym,
  _name,
  _init,
  _parent,
  _ops 
)
Value:
{ \
.dev = PBL_DEVICE_INIT_CLASS(sym, _name, _init, _parent, &pbl_rproc_class), \
.ops = (_ops), \
.state = &sym##_rproc_state, \
}
#define PBL_DEVICE_INIT_CLASS(sym, _name, _init, _parent, _cls)
Initializer for the struct pbl_device of device instance sym, in class _cls.
Definition device.h:153

Initializer of a struct pbl_rproc, for providers.

Parameters
symRemote processor symbol, with its PBL_RPROC_STATE_DEFINE().
_nameDevice name.
_initDevice init function.
_parentParent device, or NULL.
_opsOperations.

◆ PBL_RPROC_STATE_DEFINE

#define PBL_RPROC_STATE_DEFINE (   sym)
Value:
static struct pbl_rproc_state sym##_rproc_state = {.lock = PBL_MUTEX_INITIALIZER}
#define PBL_DEVICE_STATE_DEFINE(sym)
Define the runtime state of device instance sym.
Definition device.h:132
struct pbl_mutex lock
Serializes boot and shutdown.
Definition driver.h:37
Remote processor state, kept by the class.
Definition driver.h:35
#define PBL_MUTEX_INITIALIZER
Static initializer for an unlocked mutex.
Definition mutex.h:50

Define the state of a remote processor, for providers.

Parameters
symRemote processor symbol.

Function Documentation

◆ pbl_rproc_auto_boot()

int pbl_rproc_auto_boot ( const struct pbl_rproc *  rproc)

Boot a remote processor from its provider's init, for providers.

The boot is counted as one no client shuts down, so the processor keeps running.

Parameters
rprocRemote processor.
Returns
0 on success, or a negative errno from the provider.