arch/alpha/kernel/srmcons.c
Source file repositories/reference/linux-study-clean/arch/alpha/kernel/srmcons.c
File Facts
- System
- Linux kernel
- Corpus path
arch/alpha/kernel/srmcons.c- Extension
.c- Size
- 6043 bytes
- Lines
- 292
- Domain
- Architecture Layer
- Bucket
- arch/alpha
- Inferred role
- Architecture Layer: exported/initcall integration point
- Status
- integration 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.
- Exports symbols or registers init work; inspect boot/module ordering and who consumes the exported contract.
- 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/kernel.hlinux/init.hlinux/console.hlinux/delay.hlinux/mm.hlinux/slab.hlinux/spinlock.hlinux/timer.hlinux/tty.hlinux/tty_driver.hlinux/tty_flip.hasm/console.hlinux/uaccess.hproto.h
Detected Declarations
struct srmcons_privatefunction srmcons_do_receive_charsfunction srmcons_receive_charsfunction srmcons_do_writefunction srmcons_writefunction srmcons_write_roomfunction srmcons_openfunction srmcons_closefunction srmcons_initfunction srm_console_writefunction srm_console_devicefunction srm_console_setupfunction register_srm_consolefunction unregister_srm_consolemodule init srmcons_init
Annotated Snippet
device_initcall(srmcons_init);
/*
* The console driver
*/
static void
srm_console_write(struct console *co, const char *s, unsigned count)
{
unsigned long flags;
spin_lock_irqsave(&srmcons_callback_lock, flags);
srmcons_do_write(NULL, s, count);
spin_unlock_irqrestore(&srmcons_callback_lock, flags);
}
static struct tty_driver *
srm_console_device(struct console *co, int *index)
{
*index = co->index;
return srmcons_driver;
}
static int
srm_console_setup(struct console *co, char *options)
{
return 0;
}
static struct console srmcons = {
.name = "srm",
.write = srm_console_write,
.device = srm_console_device,
.setup = srm_console_setup,
.flags = CON_PRINTBUFFER | CON_BOOT,
.index = -1,
};
void __init
register_srm_console(void)
{
if (!srm_is_registered_console) {
callback_open_console();
register_console(&srmcons);
srm_is_registered_console = 1;
}
}
void __init
unregister_srm_console(void)
{
if (srm_is_registered_console) {
callback_close_console();
unregister_console(&srmcons);
srm_is_registered_console = 0;
}
}
Annotation
- Immediate include surface: `linux/kernel.h`, `linux/init.h`, `linux/console.h`, `linux/delay.h`, `linux/mm.h`, `linux/slab.h`, `linux/spinlock.h`, `linux/timer.h`.
- Detected declarations: `struct srmcons_private`, `function srmcons_do_receive_chars`, `function srmcons_receive_chars`, `function srmcons_do_write`, `function srmcons_write`, `function srmcons_write_room`, `function srmcons_open`, `function srmcons_close`, `function srmcons_init`, `function srm_console_write`.
- Atlas domain: Architecture Layer / arch/alpha.
- Implementation status: integration 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.