arch/m68k/sun3/prom/console.c
Source file repositories/reference/linux-study-clean/arch/m68k/sun3/prom/console.c
File Facts
- System
- Linux kernel
- Corpus path
arch/m68k/sun3/prom/console.c- Extension
.c- Size
- 4014 bytes
- Lines
- 171
- 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/openprom.hasm/oplib.hlinux/string.h
Detected Declarations
function Copyrightfunction prom_nbputcharfunction prom_getcharfunction prom_putcharfunction prom_query_input_devicefunction prom_query_output_device
Annotated Snippet
switch(*romvec->pv_stdin) {
case PROMDEV_KBD: return PROMDEV_IKBD;
case PROMDEV_TTYA: return PROMDEV_ITTYA;
case PROMDEV_TTYB: return PROMDEV_ITTYB;
default:
return PROMDEV_I_UNK;
};
case PROM_V3:
case PROM_P1275:
local_irq_save(flags);
st_p = (*romvec->pv_v2devops.v2_inst2pkg)(*romvec->pv_v2bootargs.fd_stdin);
__asm__ __volatile__("ld [%0], %%g6\n\t" : :
"r" (¤t_set[smp_processor_id()]) :
"memory");
local_irq_restore(flags);
if(prom_node_has_property(st_p, "keyboard"))
return PROMDEV_IKBD;
prom_getproperty(st_p, "device_type", propb, sizeof(propb));
if(strncmp(propb, "serial", sizeof("serial")))
return PROMDEV_I_UNK;
prom_getproperty(prom_root_node, "stdin-path", propb, sizeof(propb));
p = propb;
while(*p) p++; p -= 2;
if(p[0] == ':') {
if(p[1] == 'a')
return PROMDEV_ITTYA;
else if(p[1] == 'b')
return PROMDEV_ITTYB;
}
return PROMDEV_I_UNK;
};
}
#endif
/* Query for output device type */
#if 0
enum prom_output_device
prom_query_output_device()
{
unsigned long flags;
int st_p;
char propb[64];
char *p;
int propl;
switch(prom_vers) {
case PROM_V0:
switch(*romvec->pv_stdin) {
case PROMDEV_SCREEN: return PROMDEV_OSCREEN;
case PROMDEV_TTYA: return PROMDEV_OTTYA;
case PROMDEV_TTYB: return PROMDEV_OTTYB;
};
break;
case PROM_V2:
case PROM_V3:
case PROM_P1275:
local_irq_save(flags);
st_p = (*romvec->pv_v2devops.v2_inst2pkg)(*romvec->pv_v2bootargs.fd_stdout);
__asm__ __volatile__("ld [%0], %%g6\n\t" : :
"r" (¤t_set[smp_processor_id()]) :
"memory");
local_irq_restore(flags);
propl = prom_getproperty(st_p, "device_type", propb, sizeof(propb));
if (propl >= 0 && propl == sizeof("display") &&
strncmp("display", propb, sizeof("display")) == 0)
{
return PROMDEV_OSCREEN;
}
if(prom_vers == PROM_V3) {
if(strncmp("serial", propb, sizeof("serial")))
return PROMDEV_O_UNK;
prom_getproperty(prom_root_node, "stdout-path", propb, sizeof(propb));
p = propb;
while(*p) p++; p -= 2;
if(p[0]==':') {
if(p[1] == 'a')
return PROMDEV_OTTYA;
else if(p[1] == 'b')
return PROMDEV_OTTYB;
}
return PROMDEV_O_UNK;
} else {
/* This works on SS-2 (an early OpenFirmware) still. */
switch(*romvec->pv_stdin) {
case PROMDEV_TTYA: return PROMDEV_OTTYA;
case PROMDEV_TTYB: return PROMDEV_OTTYB;
};
}
break;
Annotation
- Immediate include surface: `linux/types.h`, `linux/kernel.h`, `linux/sched.h`, `asm/openprom.h`, `asm/oplib.h`, `linux/string.h`.
- Detected declarations: `function Copyright`, `function prom_nbputchar`, `function prom_getchar`, `function prom_putchar`, `function prom_query_input_device`, `function prom_query_output_device`.
- 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.