arch/sparc/prom/misc_32.c
Source file repositories/reference/linux-study-clean/arch/sparc/prom/misc_32.c
File Facts
- System
- Linux kernel
- Corpus path
arch/sparc/prom/misc_32.c- Extension
.c- Size
- 2699 bytes
- Lines
- 129
- Domain
- Architecture Layer
- Bucket
- arch/sparc
- 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.
Dependency Surface
linux/types.hlinux/kernel.hlinux/sched.hlinux/module.hasm/openprom.hasm/oplib.hasm/auxio.h
Detected Declarations
function prom_rebootfunction prom_fevalfunction prom_cmdlinefunction prom_haltfunction prom_setsyncfunction prom_get_idpromfunction prom_versionfunction prom_getrevfunction prom_getprevexport prom_feval
Annotated Snippet
// SPDX-License-Identifier: GPL-2.0
/*
* misc.c: Miscellaneous prom functions that don't belong
* anywhere else.
*
* Copyright (C) 1995 David S. Miller (davem@caip.rutgers.edu)
*/
#include <linux/types.h>
#include <linux/kernel.h>
#include <linux/sched.h>
#include <linux/module.h>
#include <asm/openprom.h>
#include <asm/oplib.h>
#include <asm/auxio.h>
extern void restore_current(void);
DEFINE_SPINLOCK(prom_lock);
/* Reset and reboot the machine with the command 'bcommand'. */
void
prom_reboot(char *bcommand)
{
unsigned long flags;
spin_lock_irqsave(&prom_lock, flags);
(*(romvec->pv_reboot))(bcommand);
/* Never get here. */
restore_current();
spin_unlock_irqrestore(&prom_lock, flags);
}
/* Forth evaluate the expression contained in 'fstring'. */
void
prom_feval(char *fstring)
{
unsigned long flags;
if(!fstring || fstring[0] == 0)
return;
spin_lock_irqsave(&prom_lock, flags);
if(prom_vers == PROM_V0)
(*(romvec->pv_fortheval.v0_eval))(strlen(fstring), fstring);
else
(*(romvec->pv_fortheval.v2_eval))(fstring);
restore_current();
spin_unlock_irqrestore(&prom_lock, flags);
}
EXPORT_SYMBOL(prom_feval);
/* Drop into the prom, with the chance to continue with the 'go'
* prom command.
*/
void
prom_cmdline(void)
{
unsigned long flags;
spin_lock_irqsave(&prom_lock, flags);
(*(romvec->pv_abort))();
restore_current();
spin_unlock_irqrestore(&prom_lock, flags);
set_auxio(AUXIO_LED, 0);
}
/* Drop into the prom, but completely terminate the program.
* No chance of continuing.
*/
void __noreturn
prom_halt(void)
{
unsigned long flags;
again:
spin_lock_irqsave(&prom_lock, flags);
(*(romvec->pv_halt))();
/* Never get here. */
restore_current();
spin_unlock_irqrestore(&prom_lock, flags);
goto again; /* PROM is out to get me -DaveM */
}
typedef void (*sfunc_t)(void);
/* Set prom sync handler to call function 'funcp'. */
void
prom_setsync(sfunc_t funcp)
{
if(!funcp) return;
*romvec->pv_synchook = funcp;
}
Annotation
- Immediate include surface: `linux/types.h`, `linux/kernel.h`, `linux/sched.h`, `linux/module.h`, `asm/openprom.h`, `asm/oplib.h`, `asm/auxio.h`.
- Detected declarations: `function prom_reboot`, `function prom_feval`, `function prom_cmdline`, `function prom_halt`, `function prom_setsync`, `function prom_get_idprom`, `function prom_version`, `function prom_getrev`, `function prom_getprev`, `export prom_feval`.
- Atlas domain: Architecture Layer / arch/sparc.
- 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.