arch/sparc/include/asm/vio.h
Source file repositories/reference/linux-study-clean/arch/sparc/include/asm/vio.h
File Facts
- System
- Linux kernel
- Corpus path
arch/sparc/include/asm/vio.h- Extension
.h- Size
- 11996 bytes
- Lines
- 509
- Domain
- Architecture Layer
- Bucket
- arch/sparc
- Inferred role
- Architecture Layer: operation-table or driver-model contract
- Status
- pattern implementation candidate
Why This File Exists
CPU and platform-specific kernel glue: boot entry, traps, syscall entry, interrupts, page tables, context switch, and low-level barriers.
- CPU and platform-specific kernel glue: boot entry, traps, syscall entry, interrupts, page tables, context switch, and low-level barriers.
- 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/kernel.hlinux/device.hlinux/mod_devicetable.hlinux/timer.hlinux/spinlock.hlinux/completion.hlinux/list.hlinux/log2.hasm/ldc.hasm/mdesc.h
Detected Declarations
struct vio_msg_tagstruct vio_rdxstruct vio_ver_infostruct vio_dring_registerstruct vio_dring_unregisterstruct vio_dring_datastruct vio_dring_hdrstruct vio_disk_attr_infostruct vio_disk_descstruct vio_disk_vtocstruct vio_disk_geomstruct vio_disk_devidstruct vio_disk_efistruct vio_net_attr_infostruct vio_net_mcast_infostruct vio_net_descstruct vio_net_dextstruct vio_dring_statestruct vio_vccstruct vio_devstruct vio_driverstruct vio_versionstruct vio_driver_statestruct vio_driver_opsstruct vio_completionstruct vio_driver_statefunction vio_dring_availfunction vio_dring_nextfunction vio_dring_prevfunction vio_version_beforefunction vio_version_afterfunction vio_version_after_eq
Annotated Snippet
struct device_driver driver;
bool no_irq;
};
struct vio_version {
u16 major;
u16 minor;
};
struct vio_driver_state;
struct vio_driver_ops {
int (*send_attr)(struct vio_driver_state *vio);
int (*handle_attr)(struct vio_driver_state *vio, void *pkt);
void (*handshake_complete)(struct vio_driver_state *vio);
};
struct vio_completion {
struct completion com;
int err;
int waiting_for;
};
struct vio_driver_state {
/* Protects VIO handshake and, optionally, driver private state. */
spinlock_t lock;
struct ldc_channel *lp;
u32 _peer_sid;
u32 _local_sid;
struct vio_dring_state drings[2];
#define VIO_DRIVER_TX_RING 0
#define VIO_DRIVER_RX_RING 1
u8 hs_state;
#define VIO_HS_INVALID 0x00
#define VIO_HS_GOTVERS 0x01
#define VIO_HS_GOT_ATTR 0x04
#define VIO_HS_SENT_DREG 0x08
#define VIO_HS_SENT_RDX 0x10
#define VIO_HS_GOT_RDX_ACK 0x20
#define VIO_HS_GOT_RDX 0x40
#define VIO_HS_SENT_RDX_ACK 0x80
#define VIO_HS_COMPLETE (VIO_HS_GOT_RDX_ACK | VIO_HS_SENT_RDX_ACK)
u8 dev_class;
u8 dr_state;
#define VIO_DR_STATE_TXREG 0x01
#define VIO_DR_STATE_RXREG 0x02
#define VIO_DR_STATE_TXREQ 0x10
#define VIO_DR_STATE_RXREQ 0x20
u8 debug;
#define VIO_DEBUG_HS 0x01
#define VIO_DEBUG_DATA 0x02
void *desc_buf;
unsigned int desc_buf_len;
struct vio_completion *cmp;
struct vio_dev *vdev;
struct timer_list timer;
struct vio_version ver;
struct vio_version *ver_table;
int ver_table_entries;
char *name;
struct vio_driver_ops *ops;
};
static inline bool vio_version_before(struct vio_driver_state *vio,
u16 major, u16 minor)
{
u32 have = (u32)vio->ver.major << 16 | vio->ver.minor;
u32 want = (u32)major << 16 | minor;
return have < want;
}
static inline bool vio_version_after(struct vio_driver_state *vio,
u16 major, u16 minor)
{
u32 have = (u32)vio->ver.major << 16 | vio->ver.minor;
u32 want = (u32)major << 16 | minor;
Annotation
- Immediate include surface: `linux/kernel.h`, `linux/device.h`, `linux/mod_devicetable.h`, `linux/timer.h`, `linux/spinlock.h`, `linux/completion.h`, `linux/list.h`, `linux/log2.h`.
- Detected declarations: `struct vio_msg_tag`, `struct vio_rdx`, `struct vio_ver_info`, `struct vio_dring_register`, `struct vio_dring_unregister`, `struct vio_dring_data`, `struct vio_dring_hdr`, `struct vio_disk_attr_info`, `struct vio_disk_desc`, `struct vio_disk_vtoc`.
- Atlas domain: Architecture Layer / arch/sparc.
- 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.