1
0
Fork 0
mirror of https://github.com/tailix/libkernaux.git synced 2024-11-13 11:04:27 -05:00

Use TCC-compatible port I/O asm instructions

This commit is contained in:
Alex Kotov 2022-01-11 12:11:40 +05:00
parent 67b3469318
commit 8d3b090f6e
Signed by: kotovalexarian
GPG key ID: 553C0EBBEB5D5F08
2 changed files with 4 additions and 4 deletions

View file

@ -41,7 +41,7 @@ uint16_t kernaux_asm_i386_inportw(const uint16_t port)
uint32_t kernaux_asm_i386_inportd(const uint16_t port) uint32_t kernaux_asm_i386_inportd(const uint16_t port)
{ {
register uint32_t result; register uint32_t result;
__asm__ volatile("ind %1, %0" : "=a" (result) : "dN" (port)); __asm__ volatile("inl %1, %0" : "=a" (result) : "dN" (port));
return result; 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) 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 #ifdef __cplusplus

View file

@ -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) uint32_t kernaux_asm_x86_64_inportd(const uint16_t port)
{ {
register uint32_t result; register uint32_t result;
__asm__ volatile("ind %1, %0" : "=a" (result) : "dN" (port)); __asm__ volatile("inl %1, %0" : "=a" (result) : "dN" (port));
return result; 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) 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) void kernaux_asm_x86_64_outportq(const uint16_t port, const uint64_t value)