From 8d3b090f6e5cc1d6220f76fab50c2dc06ee6efc6 Mon Sep 17 00:00:00 2001 From: Alex Kotov Date: Tue, 11 Jan 2022 12:11:40 +0500 Subject: [PATCH] Use TCC-compatible port I/O asm instructions --- include/kernaux/asm/i386.h | 4 ++-- include/kernaux/asm/x86_64.h | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/include/kernaux/asm/i386.h b/include/kernaux/asm/i386.h index e0e98c8..48c9b86 100644 --- a/include/kernaux/asm/i386.h +++ b/include/kernaux/asm/i386.h @@ -41,7 +41,7 @@ uint16_t kernaux_asm_i386_inportw(const uint16_t port) uint32_t kernaux_asm_i386_inportd(const uint16_t port) { register uint32_t result; - __asm__ volatile("ind %1, %0" : "=a" (result) : "dN" (port)); + __asm__ volatile("inl %1, %0" : "=a" (result) : "dN" (port)); return result; } @@ -57,7 +57,7 @@ void kernaux_asm_i386_outportw(const uint16_t port, const uint16_t value) void kernaux_asm_i386_outportd(const uint16_t port, const uint32_t value) { - __asm__ volatile("outd %1, %0" : : "dN" (port), "a" (value)); + __asm__ volatile("outl %1, %0" : : "dN" (port), "a" (value)); } #ifdef __cplusplus diff --git a/include/kernaux/asm/x86_64.h b/include/kernaux/asm/x86_64.h index fcf3564..e60321f 100644 --- a/include/kernaux/asm/x86_64.h +++ b/include/kernaux/asm/x86_64.h @@ -36,7 +36,7 @@ uint16_t kernaux_asm_x86_64_inportw(const uint16_t port) uint32_t kernaux_asm_x86_64_inportd(const uint16_t port) { register uint32_t result; - __asm__ volatile("ind %1, %0" : "=a" (result) : "dN" (port)); + __asm__ volatile("inl %1, %0" : "=a" (result) : "dN" (port)); return result; } @@ -59,7 +59,7 @@ void kernaux_asm_x86_64_outportw(const uint16_t port, const uint16_t value) void kernaux_asm_x86_64_outportd(const uint16_t port, const uint32_t value) { - __asm__ volatile("outd %1, %0" : : "dN" (port), "a" (value)); + __asm__ volatile("outl %1, %0" : : "dN" (port), "a" (value)); } void kernaux_asm_x86_64_outportq(const uint16_t port, const uint64_t value)