]>
Projects (at) Tadryanom (dot) Me - AdrOS.git/commit
feat: setitimer/getitimer syscalls with repeating interval timer support
Phase D2+D3 complete — implements POSIX interval timers.
Kernel changes:
- process.h: added alarm_interval (repeat ticks for ITIMER_REAL),
itimer_virt_value/interval, itimer_prof_value/interval fields
- scheduler.c process_wake_check: alarm queue now auto-requeues
repeating timers (alarm_interval != 0) on expiry; added per-tick
ITIMER_VIRTUAL (user mode) and ITIMER_PROF (user+kernel) accounting
that delivers SIGVTALRM/SIGPROF respectively
- syscall.c: implemented SYSCALL_SETITIMER (92) and SYSCALL_GETITIMER (93)
supporting ITIMER_REAL, ITIMER_VIRTUAL, ITIMER_PROF; alarm() updated
to clear alarm_interval (one-shot only) and use TICKS_PER_SEC constant
- syscall.h: added SYSCALL_SETITIMER=92, SYSCALL_GETITIMER=93
Userland:
- signal.h: added SIGVTALRM=26, SIGPROF=27
- sys/time.h: new header with struct timeval, struct itimerval,
ITIMER_REAL/VIRTUAL/PROF defines, setitimer/getitimer prototypes
- syscall.h: added SYS_SETITIMER=92, SYS_GETITIMER=93
- unistd.c: added setitimer() and getitimer() wrappers
Timer resolution: 20ms (50Hz tick). Conversions use
USEC_PER_TICK=20000 for timeval<->ticks.
20/20 smoke tests pass.