From 9cbb043238f094a2897646f74e6a6cd04e0df189 Mon Sep 17 00:00:00 2001 From: Gabriel Date: Mon, 17 Feb 2025 23:04:58 +0100 Subject: [PATCH] core/x86_64: Make in/out wrappers inline --- core/src/arch/x86_64/ioports.zig | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/core/src/arch/x86_64/ioports.zig b/core/src/arch/x86_64/ioports.zig index d028d35..647bb1e 100644 --- a/core/src/arch/x86_64/ioports.zig +++ b/core/src/arch/x86_64/ioports.zig @@ -1,11 +1,11 @@ -pub fn inb(port: u16) u8 { +pub inline fn inb(port: u16) u8 { return asm volatile ("inb %[port], %[result]" : [result] "={al}" (-> u8), : [port] "N{dx}" (port), ); } -pub fn outb(port: u16, value: u8) void { +pub inline fn outb(port: u16, value: u8) void { return asm volatile ("outb %[data], %[port]" : : [port] "{dx}" (port), @@ -13,14 +13,14 @@ pub fn outb(port: u16, value: u8) void { ); } -pub fn inw(port: u16) u16 { +pub inline fn inw(port: u16) u16 { return asm volatile ("inw %[port], %[result]" : [result] "={ax}" (-> u16), : [port] "N{dx}" (port), ); } -pub fn outw(port: u16, value: u16) void { +pub inline fn outw(port: u16, value: u16) void { return asm volatile ("outw %[data], %[port]" : : [port] "{dx}" (port), @@ -28,14 +28,14 @@ pub fn outw(port: u16, value: u16) void { ); } -pub fn inl(port: u16) u32 { +pub inline fn inl(port: u16) u32 { return asm volatile ("inl %[port], %[result]" : [result] "={eax}" (-> u16), : [port] "N{dx}" (port), ); } -pub fn outl(port: u16, value: u32) void { +pub inline fn outl(port: u16, value: u32) void { return asm volatile ("outw %[data], %[port]" : : [port] "{dx}" (port),