arch/sparc/prom/misc_64.c
Source file repositories/reference/linux-study-clean/arch/sparc/prom/misc_64.c
File Facts
- System
- Linux kernel
- Corpus path
arch/sparc/prom/misc_64.c- Extension
.c- Size
- 9028 bytes
- Lines
- 448
- 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.
Dependency Surface
linux/types.hlinux/kernel.hlinux/sched.hlinux/interrupt.hlinux/delay.hlinux/module.hasm/openprom.hasm/oplib.hasm/ldc.h
Detected Declarations
function Copyrightfunction prom_sun4v_guest_soft_statefunction prom_rebootfunction prom_fevalfunction prom_cmdlinefunction prom_haltfunction prom_halt_power_offfunction prom_get_idpromfunction prom_get_mmu_ihandlefunction prom_get_memory_ihandlefunction tlb_loadfunction prom_itlb_loadfunction prom_dtlb_loadfunction prom_mapfunction prom_unmapfunction prom_retainfunction prom_getunumberfunction prom_sleepselffunction prom_sleepsystemfunction prom_wakeupsystemfunction prom_startcpufunction prom_startcpu_cpuidfunction prom_stopcpu_cpuidfunction prom_stopselffunction prom_idleselffunction prom_resumecpuexport 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)
* Copyright (C) 1996,1997 Jakub Jelinek (jj@sunsite.mff.cuni.cz)
*/
#include <linux/types.h>
#include <linux/kernel.h>
#include <linux/sched.h>
#include <linux/interrupt.h>
#include <linux/delay.h>
#include <linux/module.h>
#include <asm/openprom.h>
#include <asm/oplib.h>
#include <asm/ldc.h>
static int prom_service_exists(const char *service_name)
{
unsigned long args[5];
args[0] = (unsigned long) "test";
args[1] = 1;
args[2] = 1;
args[3] = (unsigned long) service_name;
args[4] = (unsigned long) -1;
p1275_cmd_direct(args);
if (args[4])
return 0;
return 1;
}
void prom_sun4v_guest_soft_state(void)
{
const char *svc = "SUNW,soft-state-supported";
unsigned long args[3];
if (!prom_service_exists(svc))
return;
args[0] = (unsigned long) svc;
args[1] = 0;
args[2] = 0;
p1275_cmd_direct(args);
}
/* Reset and reboot the machine with the command 'bcommand'. */
void prom_reboot(const char *bcommand)
{
unsigned long args[4];
#ifdef CONFIG_SUN_LDOMS
if (ldom_domaining_enabled)
ldom_reboot(bcommand);
#endif
args[0] = (unsigned long) "boot";
args[1] = 1;
args[2] = 0;
args[3] = (unsigned long) bcommand;
p1275_cmd_direct(args);
}
/* Forth evaluate the expression contained in 'fstring'. */
void prom_feval(const char *fstring)
{
unsigned long args[5];
if (!fstring || fstring[0] == 0)
return;
args[0] = (unsigned long) "interpret";
args[1] = 1;
args[2] = 1;
args[3] = (unsigned long) fstring;
args[4] = (unsigned long) -1;
p1275_cmd_direct(args);
}
EXPORT_SYMBOL(prom_feval);
/* Drop into the prom, with the chance to continue with the 'go'
* prom command.
*/
void prom_cmdline(void)
{
unsigned long args[3];
Annotation
- Immediate include surface: `linux/types.h`, `linux/kernel.h`, `linux/sched.h`, `linux/interrupt.h`, `linux/delay.h`, `linux/module.h`, `asm/openprom.h`, `asm/oplib.h`.
- Detected declarations: `function Copyright`, `function prom_sun4v_guest_soft_state`, `function prom_reboot`, `function prom_feval`, `function prom_cmdline`, `function prom_halt`, `function prom_halt_power_off`, `function prom_get_idprom`, `function prom_get_mmu_ihandle`, `function prom_get_memory_ihandle`.
- Atlas domain: Architecture Layer / arch/sparc.
- Implementation status: integration 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.