]> Projects (at) Tadryanom (dot) Me - AdrOS.git/commit
refactor: move gdt.h/idt.h out of generic include/ into arch-specific paths
authorTulio A M Mendes <[email protected]>
Tue, 10 Feb 2026 04:27:48 +0000 (01:27 -0300)
committerTulio A M Mendes <[email protected]>
Tue, 10 Feb 2026 04:27:48 +0000 (01:27 -0300)
commitc42c5d1cb7ffe458e604242b01156e2a8ddb1ad8
tree60fda6ea5900fac59db4cb348f9ace68c91193f7
parent127f2ac2fefdb1f4bf1a103013e91db5f29f0529
refactor: move gdt.h/idt.h out of generic include/ into arch-specific paths

gdt.h and idt.h are x86-only concepts (Global Descriptor Table,
Interrupt Descriptor Table) that do not exist on ARM/RISC-V/MIPS.
They should not live in the generic include/ directory.

Changes:
- Delete include/gdt.h wrapper; all 3 consumers (arch/x86/ and
  hal/x86/) now include arch/x86/gdt.h directly.
- Delete include/idt.h wrapper; create include/interrupts.h as
  the generic abstraction (provides struct registers + isr_handler_t
  with arch-specific dispatch).
- Generic kernel code (syscall.c, uaccess.c, process.h) now
  includes interrupts.h instead of idt.h.
- x86-only code (idt.c, timer HAL, keyboard HAL, usermode, etc.)
  now includes arch/x86/idt.h directly.
- Remove unused idt.h and io.h includes from kernel/main.c.

Passes: make, cppcheck, QEMU smoke test.
15 files changed:
include/arch/x86/usermode.h
include/gdt.h [deleted file]
include/idt.h [deleted file]
include/interrupts.h [new file with mode: 0644]
include/process.h
src/arch/x86/arch_early_setup.c
src/arch/x86/gdt.c
src/arch/x86/idt.c
src/arch/x86/usermode.c
src/hal/x86/cpu.c
src/hal/x86/keyboard.c
src/hal/x86/timer.c
src/kernel/main.c
src/kernel/syscall.c
src/kernel/uaccess.c