arch/m68k/atari/debug.c
Source file repositories/reference/linux-study-clean/arch/m68k/atari/debug.c
File Facts
- System
- Linux kernel
- Corpus path
arch/m68k/atari/debug.c- Extension
.c- Size
- 9073 bytes
- Lines
- 330
- 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.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/types.hlinux/tty.hlinux/console.hlinux/init.hlinux/delay.hlinux/module.hasm/atarihw.hasm/atariints.h
Detected Declarations
function ata_mfp_outfunction atari_mfp_console_writefunction ata_scc_outfunction atari_scc_console_writefunction ata_midi_outfunction atari_midi_console_writefunction ata_par_outfunction atari_par_console_writefunction atari_mfp_console_wait_keyfunction atari_scc_console_wait_keyfunction atari_midi_console_wait_keyfunction atari_init_mfp_portfunction atari_init_scc_portfunction atari_init_midi_portfunction atari_debug_setupexport atari_SCC_reset_done
Annotated Snippet
if (*str == '\n') {
if (!ata_par_out('\r')) {
printer_present = 0;
return;
}
}
if (!ata_par_out(*str++)) {
printer_present = 0;
return;
}
}
}
#if 0
int atari_mfp_console_wait_key(struct console *co)
{
while (!(st_mfp.rcv_stat & 0x80)) /* wait for rx buf filled */
barrier();
return st_mfp.usart_dta;
}
int atari_scc_console_wait_key(struct console *co)
{
do {
MFPDELAY();
} while (!(atari_scc.cha_b_ctrl & 0x01)); /* wait for rx buf filled */
MFPDELAY();
return atari_scc.cha_b_data;
}
int atari_midi_console_wait_key(struct console *co)
{
while (!(acia.mid_ctrl & ACIA_RDRF)) /* wait for rx buf filled */
barrier();
return acia.mid_data;
}
#endif
/*
* The following two functions do a quick'n'dirty initialization of the MFP or
* SCC serial ports. They're used by the debugging interface, kgdb, and the
* serial console code.
*/
static void __init atari_init_mfp_port(int cflag)
{
/*
* timer values for 1200...115200 bps; > 38400 select 110, 134, or 150
* bps, resp., and work only correct if there's a RSVE or RSSPEED
*/
static int baud_table[9] = { 16, 11, 8, 4, 2, 1, 175, 143, 128 };
int baud = cflag & CBAUD;
int parity = (cflag & PARENB) ? ((cflag & PARODD) ? 0x04 : 0x06) : 0;
int csize = ((cflag & CSIZE) == CS7) ? 0x20 : 0x00;
if (cflag & CBAUDEX)
baud += B38400;
if (baud < B1200 || baud > B38400+2)
baud = B9600; /* use default 9600bps for non-implemented rates */
baud -= B1200; /* baud_table[] starts at 1200bps */
st_mfp.trn_stat &= ~0x01; /* disable TX */
st_mfp.usart_ctr = parity | csize | 0x88; /* 1:16 clk mode, 1 stop bit */
st_mfp.tim_ct_cd &= 0x70; /* stop timer D */
st_mfp.tim_dt_d = baud_table[baud];
st_mfp.tim_ct_cd |= 0x01; /* start timer D, 1:4 */
st_mfp.trn_stat |= 0x01; /* enable TX */
}
#define SCC_WRITE(reg, val) \
do { \
atari_scc.cha_b_ctrl = (reg); \
MFPDELAY(); \
atari_scc.cha_b_ctrl = (val); \
MFPDELAY(); \
} while (0)
/* loops_per_jiffy isn't initialized yet, so we can't use udelay(). This does a
* delay of ~ 60us. */
#define LONG_DELAY() \
do { \
int i; \
for (i = 100; i > 0; --i) \
MFPDELAY(); \
} while (0)
static void __init atari_init_scc_port(int cflag)
{
static int clksrc_table[9] =
/* reg 11: 0x50 = BRG, 0x00 = RTxC, 0x28 = TRxC */
{ 0x50, 0x50, 0x50, 0x50, 0x50, 0x50, 0x50, 0x00, 0x00 };
Annotation
- Immediate include surface: `linux/types.h`, `linux/tty.h`, `linux/console.h`, `linux/init.h`, `linux/delay.h`, `linux/module.h`, `asm/atarihw.h`, `asm/atariints.h`.
- Detected declarations: `function ata_mfp_out`, `function atari_mfp_console_write`, `function ata_scc_out`, `function atari_scc_console_write`, `function ata_midi_out`, `function atari_midi_console_write`, `function ata_par_out`, `function atari_par_console_write`, `function atari_mfp_console_wait_key`, `function atari_scc_console_wait_key`.
- Atlas domain: Architecture Layer / arch/m68k.
- 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.