Interface for remote processor drivers.
More...
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.
◆ 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
◆ PBL_RPROC_INIT
| #define PBL_RPROC_INIT |
( |
|
sym, |
|
|
|
_name, |
|
|
|
_init, |
|
|
|
_parent, |
|
|
|
_ops |
|
) |
| |
Value: { \
.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
-
| sym | Remote processor symbol, with its PBL_RPROC_STATE_DEFINE(). |
| _name | Device name. |
| _init | Device init function. |
| _parent | Parent device, or NULL. |
| _ops | Operations. |
◆ PBL_RPROC_STATE_DEFINE
| #define PBL_RPROC_STATE_DEFINE |
( |
|
sym | ) |
|
Value:
#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
-
| sym | Remote processor symbol. |
◆ 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
-
- Returns
- 0 on success, or a negative errno from the provider.