arch/m68k/amiga/config.c
Source file repositories/reference/linux-study-clean/arch/m68k/amiga/config.c
File Facts
- System
- Linux kernel
- Corpus path
arch/m68k/amiga/config.c- Extension
.c- Size
- 21003 bytes
- Lines
- 859
- Domain
- Architecture Layer
- Bucket
- arch/m68k
- 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.
- Touches IRQ or DMA behavior; this matters for the representative real-device path.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/types.hlinux/kernel.hlinux/mm.hlinux/seq_file.hlinux/clocksource.hlinux/console.hlinux/rtc.hlinux/init.hlinux/delay.hlinux/interrupt.hlinux/zorro.hlinux/module.hlinux/keyboard.hasm/bootinfo.hasm/bootinfo-amiga.hasm/byteorder.hasm/setup.hasm/amigahw.hasm/amigaints.hasm/irq.hasm/machdep.hasm/io.hasm/config.hamiga.h
Detected Declarations
struct savekmsgfunction amiga_parse_bootinfofunction amiga_identifyfunction amiga_random_get_entropyfunction config_amigafunction ciab_timer_handlerfunction amiga_sched_initfunction amiga_read_clkfunction amiga_resetfunction amiga_mem_console_writefunction amiga_savekmsg_setupfunction amiga_serial_putcfunction amiga_serial_console_writefunction amiga_serial_putsfunction amiga_serial_console_wait_keyfunction amiga_serial_getsfunction amiga_debug_setupfunction amiga_heartbeatfunction amiga_get_modelfunction amiga_get_hardware_listexport amiga_eclockexport amiga_colorclockexport amiga_chipsetexport amiga_vblankexport amiga_hw_presentexport key_maps
Annotated Snippet
struct savekmsg {
unsigned long magic1; /* SAVEKMSG_MAGIC1 */
unsigned long magic2; /* SAVEKMSG_MAGIC2 */
unsigned long magicptr; /* address of magic1 */
unsigned long size;
char data[];
};
static struct savekmsg *savekmsg;
static void amiga_mem_console_write(struct console *co, const char *s,
unsigned int count)
{
if (savekmsg->size + count <= SAVEKMSG_MAXMEM-sizeof(struct savekmsg)) {
memcpy(savekmsg->data + savekmsg->size, s, count);
savekmsg->size += count;
}
}
static int __init amiga_savekmsg_setup(char *arg)
{
bool registered;
if (!MACH_IS_AMIGA || strcmp(arg, "mem"))
return 0;
if (amiga_chip_size < SAVEKMSG_MAXMEM) {
pr_err("Not enough chipram for debugging\n");
return -ENOMEM;
}
/* Just steal the block, the chipram allocator isn't functional yet */
amiga_chip_size -= SAVEKMSG_MAXMEM;
savekmsg = ZTWO_VADDR(CHIP_PHYSADDR + amiga_chip_size);
savekmsg->magic1 = SAVEKMSG_MAGIC1;
savekmsg->magic2 = SAVEKMSG_MAGIC2;
savekmsg->magicptr = ZTWO_PADDR(savekmsg);
savekmsg->size = 0;
registered = !!amiga_console_driver.write;
amiga_console_driver.write = amiga_mem_console_write;
if (!registered)
register_console(&amiga_console_driver);
return 0;
}
early_param("debug", amiga_savekmsg_setup);
static void amiga_serial_putc(char c)
{
amiga_custom.serdat = (unsigned char)c | 0x100;
while (!(amiga_custom.serdatr & 0x2000))
;
}
static void amiga_serial_console_write(struct console *co, const char *s,
unsigned int count)
{
while (count--) {
if (*s == '\n')
amiga_serial_putc('\r');
amiga_serial_putc(*s++);
}
}
#if 0
void amiga_serial_puts(const char *s)
{
amiga_serial_console_write(NULL, s, strlen(s));
}
int amiga_serial_console_wait_key(struct console *co)
{
int ch;
while (!(amiga_custom.intreqr & IF_RBF))
barrier();
ch = amiga_custom.serdatr & 0xff;
/* clear the interrupt, so that another character can be read */
amiga_custom.intreq = IF_RBF;
return ch;
}
void amiga_serial_gets(struct console *co, char *s, int len)
{
int ch, cnt = 0;
while (1) {
ch = amiga_serial_console_wait_key(co);
Annotation
- Immediate include surface: `linux/types.h`, `linux/kernel.h`, `linux/mm.h`, `linux/seq_file.h`, `linux/clocksource.h`, `linux/console.h`, `linux/rtc.h`, `linux/init.h`.
- Detected declarations: `struct savekmsg`, `function amiga_parse_bootinfo`, `function amiga_identify`, `function amiga_random_get_entropy`, `function config_amiga`, `function ciab_timer_handler`, `function amiga_sched_init`, `function amiga_read_clk`, `function amiga_reset`, `function amiga_mem_console_write`.
- Atlas domain: Architecture Layer / arch/m68k.
- Implementation status: integration implementation candidate.
- IRQ or DMA behavior appears here, which is relevant to the selected PCIe/NVMe device path.
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.