]> Projects (at) Tadryanom (dot) Me - AdrOS.git/commit
feat: MIPS32 bring-up + refactor spinlock.h arch separation
authorTulio A M Mendes <[email protected]>
Sun, 15 Feb 2026 04:33:01 +0000 (01:33 -0300)
committerTulio A M Mendes <[email protected]>
Sun, 15 Feb 2026 04:33:01 +0000 (01:33 -0300)
commit8435521f6edff71a98b9323dacab48c98be116cb
tree85ddc8e2583eeeed946ec18df1bd230b782f33f3
parent0139d164d12c5176611767692999017591751927
feat: MIPS32 bring-up + refactor spinlock.h arch separation

MIPS bring-up (T20):
- src/arch/mips/boot.S: BSS zeroing, di/ehb interrupt disable, .set mips32r2
- src/arch/mips/stubs.c: UART console, VGA no-ops, kernel subsystem stubs
- src/arch/mips/linker.ld: proper sections, BSS markers, discard MIPS ABI sections
- src/arch/mips/arch_early_setup.c: boot message for Malta
- src/hal/mips/uart.c: fix UART base 0xBFD003F8 → 0xB80003F8 (ISA I/O @ 0x18000000)
- src/hal/mips/usermode.c: fix type mismatch (const void*)
- Makefile: -mno-abicalls -fno-pic -G0 -march=mips32r2, run-mips target
- Boots on QEMU Malta with UART console output

spinlock.h refactor (T21):
- Extract arch-specific cpu_relax/irq_save/irq_restore into per-arch headers:
  include/arch/x86/spinlock.h, include/arch/arm/spinlock.h,
  include/arch/riscv/spinlock.h, include/arch/mips/spinlock.h
- spinlock.h now uses dispatcher pattern (#include arch/ARCH/spinlock.h)
- No inline asm remains in the agnostic header
- spinlock_t, spin_lock/unlock, TTAS logic remain agnostic

Verified: x86 35/35 smoke, 47/47 host tests, ARM64/RISC-V/MIPS boot on QEMU
12 files changed:
Makefile
include/arch/arm/spinlock.h [new file with mode: 0644]
include/arch/mips/spinlock.h [new file with mode: 0644]
include/arch/riscv/spinlock.h [new file with mode: 0644]
include/arch/x86/spinlock.h [new file with mode: 0644]
include/spinlock.h
src/arch/mips/arch_early_setup.c
src/arch/mips/boot.S
src/arch/mips/linker.ld
src/arch/mips/stubs.c [new file with mode: 0644]
src/hal/mips/uart.c
src/hal/mips/usermode.c