arch/m68k/sun3x/prom.c
Source file repositories/reference/linux-study-clean/arch/m68k/sun3x/prom.c
File Facts
- System
- Linux kernel
- Corpus path
arch/m68k/sun3x/prom.c- Extension
.c- Size
- 3668 bytes
- Lines
- 165
- 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/types.hlinux/kernel.hlinux/tty.hlinux/console.hlinux/init.hlinux/mm.hlinux/string.hasm/page.hasm/setup.hasm/traps.hasm/sun3xprom.hasm/idprom.hasm/sun3ints.hasm/openprom.hasm/machines.h
Detected Declarations
function sun3x_haltfunction sun3x_rebootfunction sun3x_prom_writefunction sun3x_prom_initfunction sun3x_debug_setupfunction prom_getintdefaultfunction prom_getboolfunction prom_printffunction prom_get_idprom
Annotated Snippet
// SPDX-License-Identifier: GPL-2.0
/* Prom access routines for the sun3x */
#include <linux/types.h>
#include <linux/kernel.h>
#include <linux/tty.h>
#include <linux/console.h>
#include <linux/init.h>
#include <linux/mm.h>
#include <linux/string.h>
#include <asm/page.h>
#include <asm/setup.h>
#include <asm/traps.h>
#include <asm/sun3xprom.h>
#include <asm/idprom.h>
#include <asm/sun3ints.h>
#include <asm/openprom.h>
#include <asm/machines.h>
void (*sun3x_putchar)(int);
int (*sun3x_getchar)(void);
int (*sun3x_mayget)(void);
int (*sun3x_mayput)(int);
void (*sun3x_prom_reboot)(void);
e_vector sun3x_prom_abort;
struct linux_romvec *romvec;
/* prom vector table */
e_vector *sun3x_prom_vbr;
/* Handle returning to the prom */
static void sun3x_halt(void)
{
unsigned long flags;
/* Disable interrupts while we mess with things */
local_irq_save(flags);
/* Restore prom vbr */
asm volatile ("movec %0,%%vbr" : : "r" ((void*)sun3x_prom_vbr));
/* Restore prom NMI clock */
// sun3x_disable_intreg(5);
sun3_enable_irq(7);
/* Let 'er rip */
asm volatile ("trap #14");
/* Restore everything */
sun3_disable_irq(7);
sun3_enable_irq(5);
asm volatile ("movec %0,%%vbr" : : "r" ((void*)vectors));
local_irq_restore(flags);
}
void sun3x_reboot(void)
{
/* This never returns, don't bother saving things */
local_irq_disable();
/* Restore prom vbr */
asm volatile ("movec %0,%%vbr" : : "r" ((void*)sun3x_prom_vbr));
/* Restore prom NMI clock */
sun3_disable_irq(5);
sun3_enable_irq(7);
/* Let 'er rip */
(*romvec->pv_reboot)("vmlinux");
}
static void sun3x_prom_write(struct console *co, const char *s,
unsigned int count)
{
while (count--) {
if (*s == '\n')
sun3x_putchar('\r');
sun3x_putchar(*s++);
}
}
/* debug console - write-only */
static struct console sun3x_debug = {
.name = "debug",
.write = sun3x_prom_write,
.flags = CON_PRINTBUFFER,
.index = -1,
Annotation
- Immediate include surface: `linux/types.h`, `linux/kernel.h`, `linux/tty.h`, `linux/console.h`, `linux/init.h`, `linux/mm.h`, `linux/string.h`, `asm/page.h`.
- Detected declarations: `function sun3x_halt`, `function sun3x_reboot`, `function sun3x_prom_write`, `function sun3x_prom_init`, `function sun3x_debug_setup`, `function prom_getintdefault`, `function prom_getbool`, `function prom_printf`, `function prom_get_idprom`.
- 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.