From edde0119fbc8d0d3d736d2db758ffaa5b6ce82af Mon Sep 17 00:00:00 2001 From: Chloe M Date: Wed, 15 Jul 2026 05:25:35 -0400 Subject: [PATCH] ptos/amd64: thread: Add HalThreadYield() Signed-off-by: Chloe M --- service/ptos/arch/amd64/ps/thread.c | 6 ++++++ service/ptos/head/hal/thread.h | 5 +++++ 2 files changed, 11 insertions(+) diff --git a/service/ptos/arch/amd64/ps/thread.c b/service/ptos/arch/amd64/ps/thread.c index 996ffc8..b831fe7 100644 --- a/service/ptos/arch/amd64/ps/thread.c +++ b/service/ptos/arch/amd64/ps/thread.c @@ -145,6 +145,12 @@ HalThreadInit(THREAD *Thread, ULONG Flags, UPTR Ip) return STATUS_SUCCESS; } +VOID +HalThreadYield(VOID) +{ + asm volatile("int $0x81"); +} + VOID HalPrimeThreadTimer(ULONG Usec) { diff --git a/service/ptos/head/hal/thread.h b/service/ptos/head/hal/thread.h index ce90b39..af5ab66 100644 --- a/service/ptos/head/hal/thread.h +++ b/service/ptos/head/hal/thread.h @@ -22,6 +22,11 @@ */ PT_STATUS HalThreadInit(THREAD *Thread, ULONG Flags, UPTR Ip); +/* + * Yield the current thread + */ +VOID HalThreadYield(VOID); + /* * Prime the scheduler timer *