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:
parent
67b3469318
commit
8d3b090f6e
2 changed files with 4 additions and 4 deletions
|
@ -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
|
||||
|
|
|
@ -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)
|
||||
|
|
Loading…
Reference in a new issue