arch/um/drivers/harddog_kern.c
Source file repositories/reference/linux-study-clean/arch/um/drivers/harddog_kern.c
File Facts
- System
- Linux kernel
- Corpus path
arch/um/drivers/harddog_kern.c- Extension
.c- Size
- 4101 bytes
- Lines
- 175
- Domain
- Architecture Layer
- Bucket
- arch/um
- 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.
- Touches user memory; correctness depends on fault-safe copying and privilege boundary handling.
- 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/module.hlinux/types.hlinux/kernel.hlinux/fs.hlinux/mm.hlinux/miscdevice.hlinux/watchdog.hlinux/reboot.hlinux/mutex.hlinux/init.hlinux/spinlock.hlinux/uaccess.hmconsole.hharddog.h
Detected Declarations
function harddog_openfunction harddog_releasefunction harddog_writefunction harddog_ioctl_unlockedfunction harddog_ioctl
Annotated Snippet
static const struct file_operations harddog_fops = {
.owner = THIS_MODULE,
.write = harddog_write,
.unlocked_ioctl = harddog_ioctl,
.compat_ioctl = compat_ptr_ioctl,
.open = harddog_open,
.release = harddog_release,
};
static struct miscdevice harddog_miscdev = {
.minor = WATCHDOG_MINOR,
.name = "watchdog",
.fops = &harddog_fops,
};
module_misc_device(harddog_miscdev);
Annotation
- Immediate include surface: `linux/module.h`, `linux/types.h`, `linux/kernel.h`, `linux/fs.h`, `linux/mm.h`, `linux/miscdevice.h`, `linux/watchdog.h`, `linux/reboot.h`.
- Detected declarations: `function harddog_open`, `function harddog_release`, `function harddog_write`, `function harddog_ioctl_unlocked`, `function harddog_ioctl`.
- Atlas domain: Architecture Layer / arch/um.
- Implementation status: pattern implementation candidate.
- This snippet crosses the user/kernel memory boundary; validate fault handling and access checks before translating the pattern.
- 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.