]> Projects (at) Tadryanom (dot) Me - AdrOS.git/commit
refactor: abstract x86 register accesses in syscall dispatcher via sc_* macros
authorTulio A M Mendes <[email protected]>
Fri, 13 Feb 2026 01:09:53 +0000 (22:09 -0300)
committerTulio A M Mendes <[email protected]>
Fri, 13 Feb 2026 02:44:55 +0000 (23:44 -0300)
commit4f6f83b7c073adfe18015810b046a768cab6e253
treeb505529888972c1ecfebc3cf799759e073282105
parent3cd5a8ba98d7f31f0d4192576bb1003d402c6d1b
refactor: abstract x86 register accesses in syscall dispatcher via sc_* macros

- include/arch/x86/arch_syscall.h: define sc_num/sc_arg0..4/sc_ret/
  sc_ip/sc_usp macros mapping to x86 INT 0x80 ABI registers
  (eax/ebx/ecx/edx/esi/edi/eip/useresp)
- include/arch_syscall.h: generic dispatch header with non-x86 stubs
- src/kernel/syscall.c: replace all ~200 direct regs->eax/ebx/ecx/
  edx/esi/edi/eip/useresp accesses with arch-agnostic sc_* macros
  across syscall_handler, posix_ext_syscall_dispatch, and
  socket_syscall_dispatch

syscall.c now contains zero x86-specific register names. To port to
ARM, only arch/arm/arch_syscall.h needs to map sc_* to ARM registers
(r7/r0-r4/pc/sp).
include/arch/x86/arch_syscall.h [new file with mode: 0644]
include/arch_syscall.h [new file with mode: 0644]
src/kernel/syscall.c