arch/m68k/sun3/prom/misc.c
Source file repositories/reference/linux-study-clean/arch/m68k/sun3/prom/misc.c
File Facts
- System
- Linux kernel
- Corpus path
arch/m68k/sun3/prom/misc.c- Extension
.c- Size
- 1839 bytes
- Lines
- 96
- 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.
Dependency Surface
linux/types.hlinux/kernel.hlinux/sched.hasm/sun3-head.hasm/idprom.hasm/openprom.hasm/oplib.hasm/movs.h
Detected Declarations
function Copyrightfunction prom_cmdlinefunction prom_get_idpromfunction prom_versionfunction prom_getrevfunction prom_getprev
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 <asm/sun3-head.h>
#include <asm/idprom.h>
#include <asm/openprom.h>
#include <asm/oplib.h>
#include <asm/movs.h>
/* Reset and reboot the machine with the command 'bcommand'. */
void
prom_reboot(char *bcommand)
{
unsigned long flags;
local_irq_save(flags);
(*(romvec->pv_reboot))(bcommand);
local_irq_restore(flags);
}
/* Drop into the prom, with the chance to continue with the 'go'
* prom command.
*/
void
prom_cmdline(void)
{
}
/* Drop into the prom, but completely terminate the program.
* No chance of continuing.
*/
void
prom_halt(void)
{
unsigned long flags;
again:
local_irq_save(flags);
(*(romvec->pv_halt))();
local_irq_restore(flags);
goto again; /* PROM is out to get me -DaveM */
}
typedef void (*sfunc_t)(void);
/* Get the idprom and stuff it into buffer 'idbuf'. Returns the
* format type. 'num_bytes' is the number of bytes that your idbuf
* has space for. Returns 0xff on error.
*/
unsigned char
prom_get_idprom(char *idbuf, int num_bytes)
{
int i, oldsfc;
GET_SFC(oldsfc);
SET_SFC(FC_CONTROL);
for(i=0;i<num_bytes; i++)
{
/* There is a problem with the GET_CONTROL_BYTE
macro; defining the extra variable
gets around it.
*/
int c;
GET_CONTROL_BYTE(SUN3_IDPROM_BASE + i, c);
idbuf[i] = c;
}
SET_SFC(oldsfc);
return idbuf[0];
}
/* Get the major prom version number. */
int
prom_version(void)
{
return romvec->pv_romvers;
}
/* Get the prom plugin-revision. */
int
prom_getrev(void)
{
return prom_rev;
}
/* Get the prom firmware print revision. */
Annotation
- Immediate include surface: `linux/types.h`, `linux/kernel.h`, `linux/sched.h`, `asm/sun3-head.h`, `asm/idprom.h`, `asm/openprom.h`, `asm/oplib.h`, `asm/movs.h`.
- Detected declarations: `function Copyright`, `function prom_cmdline`, `function prom_get_idprom`, `function prom_version`, `function prom_getrev`, `function prom_getprev`.
- 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.