arch/powerpc/include/asm/vio.h
Source file repositories/reference/linux-study-clean/arch/powerpc/include/asm/vio.h
File Facts
- System
- Linux kernel
- Corpus path
arch/powerpc/include/asm/vio.h- Extension
.h- Size
- 4649 bytes
- Lines
- 164
- Domain
- Architecture Layer
- Bucket
- arch/powerpc
- 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.
- 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/errno.hlinux/device.hlinux/dma-mapping.hlinux/mod_devicetable.hlinux/scatterlist.hasm/hvcall.h
Detected Declarations
struct iommu_tablestruct vio_pfo_opstruct vio_devstruct vio_driverstruct device_nodeenum vio_dev_familyfunction vio_enable_interrupts
Annotated Snippet
extern const struct bus_type vio_bus_type;
struct iommu_table;
/*
* Platform Facilities Option (PFO)-specific data
*/
/* Starting unit address for PFO devices on the VIO BUS */
#define VIO_BASE_PFO_UA 0x50000000
/**
* vio_pfo_op - PFO operation parameters
*
* @flags: h_call subfunctions and modifiers
* @in: Input data block logical real address
* @inlen: If non-negative, the length of the input data block. If negative,
* the length of the input data descriptor list in bytes.
* @out: Output data block logical real address
* @outlen: If non-negative, the length of the input data block. If negative,
* the length of the input data descriptor list in bytes.
* @csbcpb: Logical real address of the 4k naturally-aligned storage block
* containing the CSB & optional FC field specific CPB
* @timeout: # of milliseconds to retry h_call, 0 for no timeout.
* @hcall_err: pointer to return the h_call return value, else NULL
*/
struct vio_pfo_op {
u64 flags;
s64 in;
s64 inlen;
s64 out;
s64 outlen;
u64 csbcpb;
void *done;
unsigned long handle;
unsigned int timeout;
long hcall_err;
};
/* End PFO specific data */
enum vio_dev_family {
VDEVICE, /* The OF node is a child of /vdevice */
PFO, /* The OF node is a child of /ibm,platform-facilities */
};
/**
* vio_dev - This structure is used to describe virtual I/O devices.
*
* @desired: set from return of driver's get_desired_dma() function
* @entitled: bytes of IO data that has been reserved for this device.
* @allocated: bytes of IO data currently in use by the device.
* @allocs_failed: number of DMA failures due to insufficient entitlement.
*/
struct vio_dev {
const char *name;
const char *type;
uint32_t unit_address;
uint32_t resource_id;
unsigned int irq;
struct {
size_t desired;
size_t entitled;
size_t allocated;
atomic_t allocs_failed;
} cmo;
enum vio_dev_family family;
struct device dev;
};
struct vio_driver {
const char *name;
const struct vio_device_id *id_table;
int (*probe)(struct vio_dev *dev, const struct vio_device_id *id);
void (*remove)(struct vio_dev *dev);
void (*shutdown)(struct vio_dev *dev);
/* A driver must have a get_desired_dma() function to
* be loaded in a CMO environment if it uses DMA.
*/
unsigned long (*get_desired_dma)(struct vio_dev *dev);
const struct dev_pm_ops *pm;
struct device_driver driver;
};
extern int __vio_register_driver(struct vio_driver *drv, struct module *owner,
const char *mod_name);
/*
* vio_register_driver must be a macro so that KBUILD_MODNAME can be expanded
*/
#define vio_register_driver(driver) \
Annotation
- Immediate include surface: `linux/errno.h`, `linux/device.h`, `linux/dma-mapping.h`, `linux/mod_devicetable.h`, `linux/scatterlist.h`, `asm/hvcall.h`.
- Detected declarations: `struct iommu_table`, `struct vio_pfo_op`, `struct vio_dev`, `struct vio_driver`, `struct device_node`, `enum vio_dev_family`, `function vio_enable_interrupts`.
- Atlas domain: Architecture Layer / arch/powerpc.
- Implementation status: pattern 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.