Remote processor class.
More...
Remote processor class.
A remote processor runs its own firmware, which the provider boots and halts. Clients reach the firmware through resources the provider describes, such as mailbox channels and shared memory, and hold the processor running between pbl_rproc_boot() and pbl_rproc_shutdown():
void pbl_rproc_shutdown(const struct pbl_rproc *rproc)
Release a boot, stopping the remote processor if it was the last one.
int pbl_rproc_boot(const struct pbl_rproc *rproc)
Boot a remote processor, or count one more user if it runs.
Boots are counted: the first one starts the processor and the last shutdown stops it. Both may wait, so call them from thread context.
◆ 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, |
|
|
|
_deps, |
|
|
|
_ops |
|
) |
| |
Value: { \
.ops = (_ops), \
.state = &sym##_rproc_state, \
}
#define PBL_DEVICE_INIT_CLASS(sym, _name, _init, _parent, _deps, _cls)
Initializer for the struct pbl_device of device instance sym, in class _cls.
Definition device.h:143
const struct pbl_device_class pbl_rproc_class
Class of the remote processors.
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. |
| _deps | Device dependencies. |
| _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:129
struct pbl_mutex lock
Serializes boot and shutdown.
Definition remoteproc.h:47
Remote processor state, kept by the class.
Definition remoteproc.h:45
#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_boot()
| int pbl_rproc_boot |
( |
const struct pbl_rproc * |
rproc | ) |
|
Boot a remote processor, or count one more user if it runs.
- Parameters
-
- Returns
- 0 on success, -ENODEV if it is not ready, or a negative errno from the provider.
◆ pbl_rproc_is_running()
| bool pbl_rproc_is_running |
( |
const struct pbl_rproc * |
rproc | ) |
|
Whether a remote processor runs.
- Parameters
-
◆ pbl_rproc_shutdown()
| void pbl_rproc_shutdown |
( |
const struct pbl_rproc * |
rproc | ) |
|
Release a boot, stopping the remote processor if it was the last one.
- Parameters
-
| rproc | Remote processor, booted. |
◆ pbl_rproc_class
Class of the remote processors.