include/linux/remoteproc.h
Source file repositories/reference/linux-study-clean/include/linux/remoteproc.h
File Facts
- System
- Linux kernel
- Corpus path
include/linux/remoteproc.h- Extension
.h- Size
- 15441 bytes
- Lines
- 446
- Domain
- Core OS
- Bucket
- Core Kernel Interface
- Inferred role
- Core OS: implementation source
- Status
- source implementation candidate
Why This File Exists
Core operating-system implementation surface: boot, tasks, memory, VFS, syscall-facing interfaces, synchronization, credentials, and isolation.
- Core operating-system implementation surface: boot, tasks, memory, VFS, syscall-facing interfaces, synchronization, credentials, and isolation.
- Uses kernel synchronization; read lock ordering, sleepability, and interrupt context assumptions before translating.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/types.hlinux/mutex.hlinux/virtio.hlinux/cdev.hlinux/completion.hlinux/idr.hlinux/of.hlinux/rsc_table.h
Detected Declarations
struct rprocstruct rproc_mem_entrystruct firmwarestruct rproc_opsstruct rproc_dump_segmentstruct rprocstruct rproc_subdevstruct rproc_vringstruct rproc_vdevenum rsc_handling_statusenum rproc_stateenum rproc_crash_typeenum rproc_dump_mechanismenum rproc_features
Annotated Snippet
struct rproc_mem_entry {
void *va;
bool is_iomem;
dma_addr_t dma;
size_t len;
u32 da;
void *priv;
char name[32];
struct list_head node;
u32 rsc_offset;
u32 flags;
u32 of_resm_idx;
int (*alloc)(struct rproc *rproc, struct rproc_mem_entry *mem);
int (*release)(struct rproc *rproc, struct rproc_mem_entry *mem);
};
struct firmware;
/**
* enum rsc_handling_status - return status of rproc_ops handle_rsc hook
* @RSC_HANDLED: resource was handled
* @RSC_IGNORED: resource was ignored
*/
enum rsc_handling_status {
RSC_HANDLED = 0,
RSC_IGNORED = 1,
};
/**
* struct rproc_ops - platform-specific device handlers
* @prepare: prepare device for code loading
* @unprepare: unprepare device after stop
* @start: power on the device and boot it
* @stop: power off the device
* @attach: attach to a device that his already powered up
* @detach: detach from a device, leaving it powered up
* @kick: kick a virtqueue (virtqueue id given as a parameter)
* @da_to_va: optional platform hook to perform address translations
* @parse_fw: parse firmware to extract information (e.g. resource table)
* @handle_rsc: optional platform hook to handle vendor resources. Should return
* RSC_HANDLED if resource was handled, RSC_IGNORED if not handled
* and a negative value on error
* @find_loaded_rsc_table: find the loaded resource table from firmware image
* @get_loaded_rsc_table: get resource table installed in memory
* by external entity
* @load: load firmware to memory, where the remote processor
* expects to find it
* @sanity_check: sanity check the fw image
* @get_boot_addr: get boot address to entry point specified in firmware
* @panic: optional callback to react to system panic, core will delay
* panic at least the returned number of milliseconds
* @coredump: collect firmware dump after the subsystem is shutdown
*/
struct rproc_ops {
int (*prepare)(struct rproc *rproc);
int (*unprepare)(struct rproc *rproc);
int (*start)(struct rproc *rproc);
int (*stop)(struct rproc *rproc);
int (*attach)(struct rproc *rproc);
int (*detach)(struct rproc *rproc);
void (*kick)(struct rproc *rproc, int vqid);
void * (*da_to_va)(struct rproc *rproc, u64 da, size_t len, bool *is_iomem);
int (*parse_fw)(struct rproc *rproc, const struct firmware *fw);
int (*handle_rsc)(struct rproc *rproc, u32 rsc_type, void *rsc,
int offset, int avail);
struct resource_table *(*find_loaded_rsc_table)(
struct rproc *rproc, const struct firmware *fw);
struct resource_table *(*get_loaded_rsc_table)(
struct rproc *rproc, size_t *size);
int (*load)(struct rproc *rproc, const struct firmware *fw);
int (*sanity_check)(struct rproc *rproc, const struct firmware *fw);
u64 (*get_boot_addr)(struct rproc *rproc, const struct firmware *fw);
unsigned long (*panic)(struct rproc *rproc);
void (*coredump)(struct rproc *rproc);
};
/**
* enum rproc_state - remote processor states
* @RPROC_OFFLINE: device is powered off
* @RPROC_SUSPENDED: device is suspended; needs to be woken up to receive
* a message.
* @RPROC_RUNNING: device is up and running
* @RPROC_CRASHED: device has crashed; need to start recovery
* @RPROC_DELETED: device is deleted
* @RPROC_ATTACHED: device has been booted by another entity and the core
* has attached to it
* @RPROC_DETACHED: device has been booted by another entity and waiting
* for the core to attach to it
* @RPROC_LAST: just keep this one at the end
*
Annotation
- Immediate include surface: `linux/types.h`, `linux/mutex.h`, `linux/virtio.h`, `linux/cdev.h`, `linux/completion.h`, `linux/idr.h`, `linux/of.h`, `linux/rsc_table.h`.
- Detected declarations: `struct rproc`, `struct rproc_mem_entry`, `struct firmware`, `struct rproc_ops`, `struct rproc_dump_segment`, `struct rproc`, `struct rproc_subdev`, `struct rproc_vring`, `struct rproc_vdev`, `enum rsc_handling_status`.
- Atlas domain: Core OS / Core Kernel Interface.
- Implementation status: source implementation candidate.
- Synchronization appears in or near this file; preserve lock ordering, sleepability, and interrupt-context constraints.
Implementation Notes
- This generated page is the file-by-file coverage layer; curated subsystem chapters should link here when they synthesize a multi-file control flow.
- Core OS pages should be promoted from atlas-only to deep-reviewed when they explain data structures, invariants, locking, lifecycle, and C implementation snippets.
- Driver-family pages are intentionally pattern-oriented unless they are part of the selected PCIe/NVMe representative device path.