include/linux/raspberrypi/vchiq_core.h
Source file repositories/reference/linux-study-clean/include/linux/raspberrypi/vchiq_core.h
File Facts
- System
- Linux kernel
- Corpus path
include/linux/raspberrypi/vchiq_core.h- Extension
.h- Size
- 18256 bytes
- Lines
- 647
- 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/mutex.hlinux/completion.hlinux/dma-mapping.hlinux/dev_printk.hlinux/kthread.hlinux/kref.hlinux/rcupdate.hlinux/seq_file.hlinux/spinlock_types.hlinux/wait.hvchiq.hvchiq_cfg.h
Detected Declarations
struct vchiq_bulkstruct vchiq_bulk_queuestruct remote_eventstruct opaque_platform_statestruct vchiq_slotstruct vchiq_slot_infostruct vchiq_servicestruct service_stats_structstruct vchiq_service_quotastruct vchiq_shared_statestruct vchiq_slot_zerostruct vchiq_statestruct state_stats_structstruct pageliststruct vchiq_pagelist_infostruct bulk_waiterstruct vchiq_configenum vchiq_connstateenum vchiq_bulk_dirfunction vchiq_remote_initialised
Annotated Snippet
struct vchiq_bulk {
short mode;
short dir;
void *cb_data;
void __user *cb_userdata;
struct bulk_waiter *waiter;
dma_addr_t dma_addr;
int size;
void *remote_data;
int remote_size;
int actual;
void *offset;
void __user *uoffset;
};
struct vchiq_bulk_queue {
int local_insert; /* Where to insert the next local bulk */
int remote_insert; /* Where to insert the next remote bulk (master) */
int process; /* Bulk to transfer next */
int remote_notify; /* Bulk to notify the remote client of next (mstr) */
int remove; /* Bulk to notify the local client of, and remove, next */
struct vchiq_bulk bulks[VCHIQ_NUM_SERVICE_BULKS];
};
/*
* Remote events provide a way of presenting several virtual doorbells to a
* peer (ARM host to VPU) using only one physical doorbell. They can be thought
* of as a way for the peer to signal a semaphore, in this case implemented as
* a workqueue.
*
* Remote events remain signalled until acknowledged by the receiver, and they
* are non-counting. They are designed in such a way as to minimise the number
* of interrupts and avoid unnecessary waiting.
*
* A remote_event is as small data structures that live in shared memory. It
* comprises two booleans - armed and fired:
*
* The sender sets fired when they signal the receiver.
* If fired is set, the receiver has been signalled and need not wait.
* The receiver sets the armed field before they begin to wait.
* If armed is set, the receiver is waiting and wishes to be woken by interrupt.
*/
struct remote_event {
int armed;
int fired;
u32 __unused;
};
struct opaque_platform_state;
struct vchiq_slot {
char data[VCHIQ_SLOT_SIZE];
};
struct vchiq_slot_info {
/* Use two counters rather than one to avoid the need for a mutex. */
short use_count;
short release_count;
};
/*
* VCHIQ is a reliable connection-oriented datagram protocol.
*
* A VCHIQ service is equivalent to a TCP connection, except:
* + FOURCCs are used for the rendezvous, and port numbers are assigned at the
* time the connection is established.
* + There is less of a distinction between server and client sockets, the only
* difference being which end makes the first move.
* + For a multi-client server, the server creates new "listening" services as
* the existing one becomes connected - there is no need to specify the
* maximum number of clients up front.
* + Data transfer is reliable but packetized (messages have defined ends).
* + Messages can be either short (capable of fitting in a slot) and in-band,
* or copied between external buffers (bulk transfers).
*/
struct vchiq_service {
struct vchiq_service_base base;
unsigned int handle;
struct kref ref_count;
struct rcu_head rcu;
int srvstate;
void (*userdata_term)(void *userdata);
unsigned int localport;
unsigned int remoteport;
int public_fourcc;
int client_id;
char auto_close;
char sync;
char closing;
char trace;
Annotation
- Immediate include surface: `linux/mutex.h`, `linux/completion.h`, `linux/dma-mapping.h`, `linux/dev_printk.h`, `linux/kthread.h`, `linux/kref.h`, `linux/rcupdate.h`, `linux/seq_file.h`.
- Detected declarations: `struct vchiq_bulk`, `struct vchiq_bulk_queue`, `struct remote_event`, `struct opaque_platform_state`, `struct vchiq_slot`, `struct vchiq_slot_info`, `struct vchiq_service`, `struct service_stats_struct`, `struct vchiq_service_quota`, `struct vchiq_shared_state`.
- 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.