arch/mips/sgi-ip22/ip22-gio.c
Source file repositories/reference/linux-study-clean/arch/mips/sgi-ip22/ip22-gio.c
File Facts
- System
- Linux kernel
- Corpus path
arch/mips/sgi-ip22/ip22-gio.c- Extension
.c- Size
- 9561 bytes
- Lines
- 421
- Domain
- Architecture Layer
- Bucket
- arch/mips
- 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.
- 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/export.hlinux/kernel.hlinux/init.hlinux/slab.hasm/addrspace.hasm/paccess.hasm/gio_device.hasm/sgi/gio.hasm/sgi/hpc3.hasm/sgi/mc.hasm/sgi/ip22.h
Detected Declarations
function gio_match_devicefunction gio_dev_putfunction gio_release_devfunction gio_device_registerfunction gio_device_unregisterfunction gio_bus_matchfunction gio_device_probefunction gio_device_removefunction gio_device_shutdownfunction modalias_showfunction name_showfunction id_showfunction gio_device_ueventfunction gio_register_driverfunction gio_unregister_driverfunction gio_set_masterfunction ip22_gio_set_64bitfunction ip22_gio_idfunction ip22_is_gr2function ip22_check_giofunction ip22_gio_initmodule init ip22_gio_initexport gio_dev_getexport gio_dev_putexport gio_device_registerexport gio_device_unregisterexport gio_register_driverexport gio_unregister_driverexport gio_set_master
Annotated Snippet
static const struct bus_type gio_bus_type;
static struct {
const char *name;
__u8 id;
} gio_name_table[] = {
{ .name = "SGI Impact", .id = 0x10 },
{ .name = "Phobos G160", .id = 0x35 },
{ .name = "Phobos G130", .id = 0x36 },
{ .name = "Phobos G100", .id = 0x37 },
{ .name = "Set Engineering GFE", .id = 0x38 },
/* fake IDs */
{ .name = "SGI Newport", .id = 0x7e },
{ .name = "SGI GR2/GR3", .id = 0x7f },
};
static struct device *gio_bus;
/**
* gio_match_device - Tell if an of_device structure has a matching
* gio_match structure
* @ids: array of of device match structures to search in
* @dev: the of device structure to match against
*
* Used by a driver to check whether an of_device present in the
* system is in its list of supported devices.
*/
static const struct gio_device_id *
gio_match_device(const struct gio_device_id *match,
const struct gio_device *dev)
{
const struct gio_device_id *ids;
for (ids = match; ids->id != 0xff; ids++)
if (ids->id == dev->id.id)
return ids;
return NULL;
}
struct gio_device *gio_dev_get(struct gio_device *dev)
{
struct device *tmp;
if (!dev)
return NULL;
tmp = get_device(&dev->dev);
if (tmp)
return to_gio_device(tmp);
else
return NULL;
}
EXPORT_SYMBOL_GPL(gio_dev_get);
void gio_dev_put(struct gio_device *dev)
{
if (dev)
put_device(&dev->dev);
}
EXPORT_SYMBOL_GPL(gio_dev_put);
/**
* gio_release_dev - free an gio device structure when all users of it are finished.
* @dev: device that's been disconnected
*
* Will be called only by the device core when all users of this gio device are
* done.
*/
static void gio_release_dev(struct device *dev)
{
struct gio_device *giodev;
giodev = to_gio_device(dev);
kfree(giodev);
}
int gio_device_register(struct gio_device *giodev)
{
giodev->dev.bus = &gio_bus_type;
giodev->dev.parent = gio_bus;
giodev->dev.release = gio_release_dev;
return device_register(&giodev->dev);
}
EXPORT_SYMBOL_GPL(gio_device_register);
void gio_device_unregister(struct gio_device *giodev)
{
device_unregister(&giodev->dev);
}
Annotation
- Immediate include surface: `linux/export.h`, `linux/kernel.h`, `linux/init.h`, `linux/slab.h`, `asm/addrspace.h`, `asm/paccess.h`, `asm/gio_device.h`, `asm/sgi/gio.h`.
- Detected declarations: `function gio_match_device`, `function gio_dev_put`, `function gio_release_dev`, `function gio_device_register`, `function gio_device_unregister`, `function gio_bus_match`, `function gio_device_probe`, `function gio_device_remove`, `function gio_device_shutdown`, `function modalias_show`.
- Atlas domain: Architecture Layer / arch/mips.
- 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.