From dc231741b7e9a91464c29627c491586e1cb21d81 Mon Sep 17 00:00:00 2001 From: Josh Holtrop Date: Tue, 28 Nov 2023 10:30:03 -0500 Subject: [PATCH] cpu: add swint() --- src/hulk/cpu.d | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/hulk/cpu.d b/src/hulk/cpu.d index f39aec6..0edd8dd 100644 --- a/src/hulk/cpu.d +++ b/src/hulk/cpu.d @@ -284,3 +284,9 @@ void cpuid1(uint * ebx, uint * ecx, uint * edx) { __asm("cpuid", "=*{ebx},=*{ecx},=*{edx},{eax}", ebx, ecx, edx, 1u); } + +void swint(int swint_id)() +{ + static assert((0 <= swint_id) && (swint_id <= 255)); + mixin(`__asm("int $$`, swint_id, `", "");`); +}