arch/m68k/atari/atakeyb.c
Source file repositories/reference/linux-study-clean/arch/m68k/atari/atakeyb.c
File Facts
- System
- Linux kernel
- Corpus path
arch/m68k/atari/atakeyb.c- Extension
.c- Size
- 14517 bytes
- Lines
- 571
- 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/module.hlinux/sched.hlinux/kernel.hlinux/interrupt.hlinux/errno.hlinux/keyboard.hlinux/delay.hlinux/timer.hlinux/kd.hlinux/random.hlinux/init.hlinux/kbd_kern.hasm/atariints.hasm/atarihw.hasm/atarikb.hasm/atari_joystick.hasm/irq.h
Detected Declarations
function bytesfunction allowedfunction ikbd_resetfunction ikbd_mouse_button_actionfunction ikbd_mouse_rel_posfunction ikbd_mouse_abs_posfunction ikbd_mouse_kbd_modefunction ikbd_mouse_threshfunction ikbd_mouse_scalefunction ikbd_mouse_pos_getfunction ikbd_mouse_pos_setfunction ikbd_mouse_y0_botfunction ikbd_mouse_y0_topfunction ikbd_mouse_disablefunction ikbd_joystick_event_onfunction ikbd_joystick_event_offfunction ikbd_joystick_get_statefunction ikbd_joystick_monitorfunction ikbd_joystick_disablefunction atari_keyb_initexport atari_input_keyboard_interrupt_hookexport atari_input_mouse_interrupt_hookexport ikbd_mouse_rel_posexport ikbd_mouse_threshexport ikbd_mouse_y0_topexport ikbd_mouse_disableexport atari_keyb_init
Annotated Snippet
else if (IS_SYNC_CODE(scancode)) {
/* This code seem already to be the start of a new packet or a
* single scancode */
kb_state.state = KEYBOARD;
goto interpret_scancode;
} else {
/* Go to RESYNC state and skip this byte */
kb_state.state = RESYNC;
kb_state.len = 1; /* skip max. 1 another byte */
goto repeat;
}
}
if (acia_stat & ACIA_RDRF) {
/* received a character */
scancode = acia.key_data; /* get it or reset the ACIA, I'll get it! */
interpret_scancode:
switch (kb_state.state) {
case KEYBOARD:
switch (scancode) {
case 0xF7:
kb_state.state = AMOUSE;
kb_state.len = 0;
break;
case 0xF8:
case 0xF9:
case 0xFA:
case 0xFB:
kb_state.state = RMOUSE;
kb_state.len = 1;
kb_state.buf[0] = scancode;
break;
case 0xFC:
kb_state.state = CLOCK;
kb_state.len = 0;
break;
case 0xFE:
case 0xFF:
kb_state.state = JOYSTICK;
kb_state.len = 1;
kb_state.buf[0] = scancode;
break;
case 0xF1:
/* during self-test, note that 0xf1 received */
if (ikbd_self_test) {
++ikbd_self_test;
self_test_last_rcv = jiffies;
break;
}
fallthrough;
default:
break_flag = scancode & BREAK_MASK;
scancode &= ~BREAK_MASK;
if (ikbd_self_test) {
/* Scancodes sent during the self-test stand for broken
* keys (keys being down). The code *should* be a break
* code, but nevertheless some AT keyboard interfaces send
* make codes instead. Therefore, simply ignore
* break_flag...
*/
int keyval, keytyp;
set_bit(scancode, broken_keys);
self_test_last_rcv = jiffies;
/* new Linux scancodes; approx. */
keyval = scancode;
keytyp = KTYP(keyval) - 0xf0;
keyval = KVAL(keyval);
pr_warn("Key with scancode %d ", scancode);
if (keytyp == KT_LATIN || keytyp == KT_LETTER) {
if (keyval < ' ')
pr_cont("('^%c') ", keyval + '@');
else
pr_cont("('%c') ", keyval);
}
pr_cont("is broken -- will be ignored.\n");
break;
} else if (test_bit(scancode, broken_keys))
break;
if (atari_input_keyboard_interrupt_hook)
atari_input_keyboard_interrupt_hook((unsigned char)scancode, !break_flag);
break;
}
Annotation
- Immediate include surface: `linux/module.h`, `linux/sched.h`, `linux/kernel.h`, `linux/interrupt.h`, `linux/errno.h`, `linux/keyboard.h`, `linux/delay.h`, `linux/timer.h`.
- Detected declarations: `function bytes`, `function allowed`, `function ikbd_reset`, `function ikbd_mouse_button_action`, `function ikbd_mouse_rel_pos`, `function ikbd_mouse_abs_pos`, `function ikbd_mouse_kbd_mode`, `function ikbd_mouse_thresh`, `function ikbd_mouse_scale`, `function ikbd_mouse_pos_get`.
- 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.