include/linux/rpmsg.h
Source file repositories/reference/linux-study-clean/include/linux/rpmsg.h
File Facts
- System
- Linux kernel
- Corpus path
include/linux/rpmsg.h- Extension
.h- Size
- 8959 bytes
- Lines
- 328
- Domain
- Core OS
- Bucket
- Core Kernel Interface
- Inferred role
- Core OS: operation-table or driver-model contract
- Status
- pattern 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.
- Defines an operation table; this is where Linux turns generic core objects into subsystem-specific behavior.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/types.hlinux/device.hlinux/err.hlinux/mod_devicetable.hlinux/kref.hlinux/mutex.hlinux/poll.hlinux/rpmsg/byteorder.huapi/linux/rpmsg.h
Detected Declarations
struct rpmsg_devicestruct rpmsg_endpointstruct rpmsg_device_opsstruct rpmsg_endpoint_opsstruct rpmsg_channel_infostruct rpmsg_devicestruct rpmsg_endpointstruct rpmsg_driverfunction rpmsg16_to_cpufunction cpu_to_rpmsg16function rpmsg32_to_cpufunction cpu_to_rpmsg32function rpmsg64_to_cpufunction cpu_to_rpmsg64function rpmsg_register_device_overridefunction rpmsg_register_devicefunction rpmsg_unregister_devicefunction __register_rpmsg_driverfunction unregister_rpmsg_driverfunction rpmsg_destroy_eptfunction rpmsg_sendfunction rpmsg_sendtofunction rpmsg_trysendfunction rpmsg_trysendtofunction rpmsg_pollfunction rpmsg_get_mtufunction rpmsg_set_flow_control
Annotated Snippet
struct device_driver drv;
const struct rpmsg_device_id *id_table;
int (*probe)(struct rpmsg_device *dev);
void (*remove)(struct rpmsg_device *dev);
int (*callback)(struct rpmsg_device *, void *, int, void *, u32);
int (*flowcontrol)(struct rpmsg_device *, void *, bool);
};
static inline u16 rpmsg16_to_cpu(struct rpmsg_device *rpdev, __rpmsg16 val)
{
if (!rpdev)
return __rpmsg16_to_cpu(rpmsg_is_little_endian(), val);
else
return __rpmsg16_to_cpu(rpdev->little_endian, val);
}
static inline __rpmsg16 cpu_to_rpmsg16(struct rpmsg_device *rpdev, u16 val)
{
if (!rpdev)
return __cpu_to_rpmsg16(rpmsg_is_little_endian(), val);
else
return __cpu_to_rpmsg16(rpdev->little_endian, val);
}
static inline u32 rpmsg32_to_cpu(struct rpmsg_device *rpdev, __rpmsg32 val)
{
if (!rpdev)
return __rpmsg32_to_cpu(rpmsg_is_little_endian(), val);
else
return __rpmsg32_to_cpu(rpdev->little_endian, val);
}
static inline __rpmsg32 cpu_to_rpmsg32(struct rpmsg_device *rpdev, u32 val)
{
if (!rpdev)
return __cpu_to_rpmsg32(rpmsg_is_little_endian(), val);
else
return __cpu_to_rpmsg32(rpdev->little_endian, val);
}
static inline u64 rpmsg64_to_cpu(struct rpmsg_device *rpdev, __rpmsg64 val)
{
if (!rpdev)
return __rpmsg64_to_cpu(rpmsg_is_little_endian(), val);
else
return __rpmsg64_to_cpu(rpdev->little_endian, val);
}
static inline __rpmsg64 cpu_to_rpmsg64(struct rpmsg_device *rpdev, u64 val)
{
if (!rpdev)
return __cpu_to_rpmsg64(rpmsg_is_little_endian(), val);
else
return __cpu_to_rpmsg64(rpdev->little_endian, val);
}
#if IS_ENABLED(CONFIG_RPMSG)
int rpmsg_register_device_override(struct rpmsg_device *rpdev,
const char *driver_override);
int rpmsg_register_device(struct rpmsg_device *rpdev);
int rpmsg_unregister_device(struct device *parent,
struct rpmsg_channel_info *chinfo);
int __register_rpmsg_driver(struct rpmsg_driver *drv, struct module *owner);
void unregister_rpmsg_driver(struct rpmsg_driver *drv);
void rpmsg_destroy_ept(struct rpmsg_endpoint *);
struct rpmsg_endpoint *rpmsg_create_ept(struct rpmsg_device *,
rpmsg_rx_cb_t cb, void *priv,
struct rpmsg_channel_info chinfo);
int rpmsg_send(struct rpmsg_endpoint *ept, const void *data, int len);
int rpmsg_sendto(struct rpmsg_endpoint *ept, const void *data, int len, u32 dst);
int rpmsg_trysend(struct rpmsg_endpoint *ept, const void *data, int len);
int rpmsg_trysendto(struct rpmsg_endpoint *ept, const void *data, int len, u32 dst);
__poll_t rpmsg_poll(struct rpmsg_endpoint *ept, struct file *filp,
poll_table *wait);
ssize_t rpmsg_get_mtu(struct rpmsg_endpoint *ept);
int rpmsg_set_flow_control(struct rpmsg_endpoint *ept, bool pause, u32 dst);
#else
static inline int rpmsg_register_device_override(struct rpmsg_device *rpdev,
const char *driver_override)
{
return -ENXIO;
}
Annotation
- Immediate include surface: `linux/types.h`, `linux/device.h`, `linux/err.h`, `linux/mod_devicetable.h`, `linux/kref.h`, `linux/mutex.h`, `linux/poll.h`, `linux/rpmsg/byteorder.h`.
- Detected declarations: `struct rpmsg_device`, `struct rpmsg_endpoint`, `struct rpmsg_device_ops`, `struct rpmsg_endpoint_ops`, `struct rpmsg_channel_info`, `struct rpmsg_device`, `struct rpmsg_endpoint`, `struct rpmsg_driver`, `function rpmsg16_to_cpu`, `function cpu_to_rpmsg16`.
- Atlas domain: Core OS / Core Kernel Interface.
- Implementation status: pattern implementation candidate.
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.