arch/powerpc/platforms/ps3/system-bus.c
Source file repositories/reference/linux-study-clean/arch/powerpc/platforms/ps3/system-bus.c
File Facts
- System
- Linux kernel
- Corpus path
arch/powerpc/platforms/ps3/system-bus.c- Extension
.c- Size
- 19473 bytes
- Lines
- 808
- 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.
- Touches IRQ or DMA behavior; this matters for the representative real-device path.
- Allocates kernel memory; connect allocation flags and lifetime to context constraints.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/kernel.hlinux/init.hlinux/export.hlinux/dma-map-ops.hlinux/err.hlinux/slab.hasm/udbg.hasm/lv1call.hasm/firmware.hasm/cell-regs.hplatform.h
Detected Declarations
function ps3_is_devicefunction ps3_open_hv_device_sbfunction ps3_close_hv_device_sbfunction ps3_open_hv_device_gpufunction ps3_close_hv_device_gpufunction ps3_open_hv_devicefunction ps3_close_hv_devicefunction _dump_mmio_regionfunction ps3_sb_mmio_region_createfunction ps3_ioc0_mmio_region_createfunction ps3_mmio_region_createfunction ps3_sb_free_mmio_regionfunction ps3_ioc0_free_mmio_regionfunction ps3_free_mmio_regionfunction ps3_mmio_region_initfunction ps3_system_bus_matchfunction ps3_system_bus_probefunction ps3_system_bus_removefunction ps3_system_bus_shutdownfunction ps3_system_bus_ueventfunction modalias_showfunction ps3_system_bus_initfunction addressfunction ps3_free_coherentfunction storagefunction ps3_ioc0_map_physfunction ps3_unmap_physfunction ps3_sb_map_sgfunction for_each_sgfunction ps3_ioc0_map_sgfunction ps3_sb_unmap_sgfunction ps3_ioc0_unmap_sgfunction ps3_dma_supportedfunction ps3_system_bus_release_devicefunction ps3_system_bus_device_registerfunction ps3_system_bus_driver_registerfunction ps3_system_bus_driver_unregistermodule init ps3_system_bus_initexport ps3_open_hv_deviceexport ps3_close_hv_deviceexport ps3_mmio_region_createexport ps3_free_mmio_regionexport ps3_mmio_region_initexport ps3_system_bus_device_registerexport ps3_system_bus_driver_registerexport ps3_system_bus_driver_unregister
Annotated Snippet
const struct device_driver *_drv)
{
int result;
const struct ps3_system_bus_driver *drv = ps3_drv_to_system_bus_drv(_drv);
struct ps3_system_bus_device *dev = ps3_dev_to_system_bus_dev(_dev);
if (!dev->match_sub_id)
result = dev->match_id == drv->match_id;
else
result = dev->match_sub_id == drv->match_sub_id &&
dev->match_id == drv->match_id;
if (result)
pr_info("%s:%d: dev=%u.%u(%s), drv=%u.%u(%s): match\n",
__func__, __LINE__,
dev->match_id, dev->match_sub_id, dev_name(&dev->core),
drv->match_id, drv->match_sub_id, drv->core.name);
else
pr_debug("%s:%d: dev=%u.%u(%s), drv=%u.%u(%s): miss\n",
__func__, __LINE__,
dev->match_id, dev->match_sub_id, dev_name(&dev->core),
drv->match_id, drv->match_sub_id, drv->core.name);
return result;
}
static int ps3_system_bus_probe(struct device *_dev)
{
int result = 0;
struct ps3_system_bus_device *dev = ps3_dev_to_system_bus_dev(_dev);
struct ps3_system_bus_driver *drv;
BUG_ON(!dev);
dev_dbg(_dev, "%s:%d\n", __func__, __LINE__);
drv = ps3_system_bus_dev_to_system_bus_drv(dev);
BUG_ON(!drv);
if (drv->probe)
result = drv->probe(dev);
else
pr_debug("%s:%d: %s no probe method\n", __func__, __LINE__,
dev_name(&dev->core));
pr_debug(" <- %s:%d: %s\n", __func__, __LINE__, dev_name(&dev->core));
return result;
}
static void ps3_system_bus_remove(struct device *_dev)
{
struct ps3_system_bus_device *dev = ps3_dev_to_system_bus_dev(_dev);
struct ps3_system_bus_driver *drv;
BUG_ON(!dev);
dev_dbg(_dev, "%s:%d\n", __func__, __LINE__);
drv = ps3_system_bus_dev_to_system_bus_drv(dev);
BUG_ON(!drv);
if (drv->remove)
drv->remove(dev);
else
dev_dbg(&dev->core, "%s:%d %s: no remove method\n",
__func__, __LINE__, drv->core.name);
pr_debug(" <- %s:%d: %s\n", __func__, __LINE__, dev_name(&dev->core));
}
static void ps3_system_bus_shutdown(struct device *_dev)
{
struct ps3_system_bus_device *dev = ps3_dev_to_system_bus_dev(_dev);
struct ps3_system_bus_driver *drv;
BUG_ON(!dev);
dev_dbg(&dev->core, " -> %s:%d: match_id %d\n", __func__, __LINE__,
dev->match_id);
if (!dev->core.driver) {
dev_dbg(&dev->core, "%s:%d: no driver bound\n", __func__,
__LINE__);
return;
}
drv = ps3_system_bus_dev_to_system_bus_drv(dev);
BUG_ON(!drv);
dev_dbg(&dev->core, "%s:%d: %s -> %s\n", __func__, __LINE__,
dev_name(&dev->core), drv->core.name);
Annotation
- Immediate include surface: `linux/kernel.h`, `linux/init.h`, `linux/export.h`, `linux/dma-map-ops.h`, `linux/err.h`, `linux/slab.h`, `asm/udbg.h`, `asm/lv1call.h`.
- Detected declarations: `function ps3_is_device`, `function ps3_open_hv_device_sb`, `function ps3_close_hv_device_sb`, `function ps3_open_hv_device_gpu`, `function ps3_close_hv_device_gpu`, `function ps3_open_hv_device`, `function ps3_close_hv_device`, `function _dump_mmio_region`, `function ps3_sb_mmio_region_create`, `function ps3_ioc0_mmio_region_create`.
- 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.
- 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.