arch/m68k/kernel/early_printk.c
Source file repositories/reference/linux-study-clean/arch/m68k/kernel/early_printk.c
File Facts
- System
- Linux kernel
- Corpus path
arch/m68k/kernel/early_printk.c- Extension
.c- Size
- 1430 bytes
- Lines
- 57
- Domain
- Architecture Layer
- Bucket
- arch/m68k
- Inferred role
- Architecture Layer: implementation source
- Status
- source 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 or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/kernel.hlinux/console.hlinux/init.hlinux/string.hasm/setup.h../mvme147/mvme147.h../mvme16x/mvme16x.h
Detected Declarations
function setup_early_printkfunction unregister_early_console
Annotated Snippet
#include <linux/kernel.h>
#include <linux/console.h>
#include <linux/init.h>
#include <linux/string.h>
#include <asm/setup.h>
#include "../mvme147/mvme147.h"
#include "../mvme16x/mvme16x.h"
asmlinkage void __init debug_cons_nputs(struct console *c, const char *s, unsigned int n);
static struct console early_console_instance = {
.name = "debug",
.flags = CON_PRINTBUFFER | CON_BOOT,
.index = -1
};
static int __init setup_early_printk(char *buf)
{
if (early_console || buf)
return 0;
if (MACH_IS_MVME147)
early_console_instance.write = mvme147_scc_write;
else if (MACH_IS_MVME16x)
early_console_instance.write = mvme16x_cons_write;
else
early_console_instance.write = debug_cons_nputs;
early_console = &early_console_instance;
register_console(early_console);
return 0;
}
early_param("earlyprintk", setup_early_printk);
static int __init unregister_early_console(void)
{
/*
* debug_cons_nputs() defined in arch/m68k/kernel/head.S cannot be
* called after init sections are discarded (for platforms that use it).
*/
if (early_console && early_console->write == debug_cons_nputs)
return unregister_console(early_console);
return 0;
}
late_initcall(unregister_early_console);
Annotation
- Immediate include surface: `linux/kernel.h`, `linux/console.h`, `linux/init.h`, `linux/string.h`, `asm/setup.h`, `../mvme147/mvme147.h`, `../mvme16x/mvme16x.h`.
- Detected declarations: `function setup_early_printk`, `function unregister_early_console`.
- Atlas domain: Architecture Layer / arch/m68k.
- Implementation status: source 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.