]> 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)
commit8dfb49f18e8abfe5aa19ffcd1ccc1d7f51a12ab1
tree6da8a1c2cd69039568ba09d27b51346cc767a8ec
parent995914dfc4492640b4eb473d044ca2d48a6982d7
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