mirror of
https://gitlab.com/sortix/sortix.git
synced 2023-02-13 20:55:38 -05:00
Moved CPU code shared by x86 and x64 into x86-family.
This commit is contained in:
parent
4728809c00
commit
9995354f95
7 changed files with 154 additions and 125 deletions
|
|
@ -29,40 +29,5 @@ namespace Sortix
|
|||
{
|
||||
namespace X64
|
||||
{
|
||||
void OutPortB(uint16_t Port, uint8_t Value)
|
||||
{
|
||||
asm volatile ("outb %1, %0" : : "dN" (Port), "a" (Value));
|
||||
}
|
||||
|
||||
void OutPortW(uint16_t Port, uint16_t Value)
|
||||
{
|
||||
asm volatile ("outw %1, %0" : : "dN" (Port), "a" (Value));
|
||||
}
|
||||
|
||||
void OutPortL(uint16_t Port, uint32_t Value)
|
||||
{
|
||||
asm volatile ("outl %1, %0" : : "dN" (Port), "a" (Value));
|
||||
}
|
||||
|
||||
uint8_t InPortB(uint16_t Port)
|
||||
{
|
||||
uint8_t Result;
|
||||
asm volatile("inb %1, %0" : "=a" (Result) : "dN" (Port));
|
||||
return Result;
|
||||
}
|
||||
|
||||
uint16_t InPortW(uint16_t Port)
|
||||
{
|
||||
uint16_t Result;
|
||||
asm volatile("inw %1, %0" : "=a" (Result) : "dN" (Port));
|
||||
return Result;
|
||||
}
|
||||
|
||||
uint32_t InPortL(uint16_t Port)
|
||||
{
|
||||
uint32_t Result;
|
||||
asm volatile("inl %1, %0" : "=a" (Result) : "dN" (Port));
|
||||
return Result;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue