include/linux/mailbox/riscv-rpmi-message.h
Source file repositories/reference/linux-study-clean/include/linux/mailbox/riscv-rpmi-message.h
File Facts
- System
- Linux kernel
- Corpus path
include/linux/mailbox/riscv-rpmi-message.h- Extension
.h- Size
- 5965 bytes
- Lines
- 244
- 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.
- Touches IRQ or DMA behavior; this matters for the representative real-device path.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/errno.hlinux/mailbox_client.hlinux/types.hlinux/wordpart.h
Detected Declarations
struct rpmi_message_headerstruct rpmi_messagestruct rpmi_notification_eventstruct rpmi_mbox_messageenum rpmi_error_codesenum rpmi_clock_service_idenum rpmi_sysmsi_service_idenum rpmi_mbox_attribute_idenum rpmi_mbox_message_typefunction rpmi_to_linux_errorfunction rpmi_mbox_init_get_attributefunction rpmi_mbox_init_set_attributefunction rpmi_mbox_init_send_with_responsefunction rpmi_mbox_init_send_without_responsefunction rpmi_mbox_send_message
Annotated Snippet
struct rpmi_message_header {
__le16 servicegroup_id;
u8 service_id;
u8 flags;
__le16 datalen;
__le16 token;
};
/* RPMI message */
struct rpmi_message {
struct rpmi_message_header header;
u8 data[];
};
/* RPMI notification event */
struct rpmi_notification_event {
__le16 event_datalen;
u8 event_id;
u8 reserved;
u8 event_data[];
};
/* RPMI error codes */
enum rpmi_error_codes {
RPMI_SUCCESS = 0,
RPMI_ERR_FAILED = -1,
RPMI_ERR_NOTSUPP = -2,
RPMI_ERR_INVALID_PARAM = -3,
RPMI_ERR_DENIED = -4,
RPMI_ERR_INVALID_ADDR = -5,
RPMI_ERR_ALREADY = -6,
RPMI_ERR_EXTENSION = -7,
RPMI_ERR_HW_FAULT = -8,
RPMI_ERR_BUSY = -9,
RPMI_ERR_INVALID_STATE = -10,
RPMI_ERR_BAD_RANGE = -11,
RPMI_ERR_TIMEOUT = -12,
RPMI_ERR_IO = -13,
RPMI_ERR_NO_DATA = -14,
RPMI_ERR_RESERVED_START = -15,
RPMI_ERR_RESERVED_END = -127,
RPMI_ERR_VENDOR_START = -128,
};
static inline int rpmi_to_linux_error(int rpmi_error)
{
switch (rpmi_error) {
case RPMI_SUCCESS:
return 0;
case RPMI_ERR_INVALID_PARAM:
case RPMI_ERR_BAD_RANGE:
case RPMI_ERR_INVALID_STATE:
return -EINVAL;
case RPMI_ERR_DENIED:
return -EPERM;
case RPMI_ERR_INVALID_ADDR:
case RPMI_ERR_HW_FAULT:
return -EFAULT;
case RPMI_ERR_ALREADY:
return -EALREADY;
case RPMI_ERR_BUSY:
return -EBUSY;
case RPMI_ERR_TIMEOUT:
return -ETIMEDOUT;
case RPMI_ERR_IO:
return -ECOMM;
case RPMI_ERR_FAILED:
case RPMI_ERR_NOTSUPP:
case RPMI_ERR_NO_DATA:
case RPMI_ERR_EXTENSION:
default:
return -EOPNOTSUPP;
}
}
/* RPMI service group IDs */
#define RPMI_SRVGRP_SYSTEM_MSI 0x00002
#define RPMI_SRVGRP_CLOCK 0x00008
/* RPMI clock service IDs */
enum rpmi_clock_service_id {
RPMI_CLK_SRV_ENABLE_NOTIFICATION = 0x01,
RPMI_CLK_SRV_GET_NUM_CLOCKS = 0x02,
RPMI_CLK_SRV_GET_ATTRIBUTES = 0x03,
RPMI_CLK_SRV_GET_SUPPORTED_RATES = 0x04,
RPMI_CLK_SRV_SET_CONFIG = 0x05,
RPMI_CLK_SRV_GET_CONFIG = 0x06,
RPMI_CLK_SRV_SET_RATE = 0x07,
RPMI_CLK_SRV_GET_RATE = 0x08,
RPMI_CLK_SRV_ID_MAX_COUNT
Annotation
- Immediate include surface: `linux/errno.h`, `linux/mailbox_client.h`, `linux/types.h`, `linux/wordpart.h`.
- Detected declarations: `struct rpmi_message_header`, `struct rpmi_message`, `struct rpmi_notification_event`, `struct rpmi_mbox_message`, `enum rpmi_error_codes`, `enum rpmi_clock_service_id`, `enum rpmi_sysmsi_service_id`, `enum rpmi_mbox_attribute_id`, `enum rpmi_mbox_message_type`, `function rpmi_to_linux_error`.
- Atlas domain: Core OS / Core Kernel Interface.
- Implementation status: source implementation candidate.
- IRQ or DMA behavior appears here, which is relevant to the selected PCIe/NVMe device path.
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.