Go to the source code of this file.
CPU port access functions.
- Author
- Keeton Feavel (keeto.nosp@m.nfea.nosp@m.vel@c.nosp@m.edar.nosp@m.ville.nosp@m..edu)
- Version
- 0.3
- Date
- 2020-06-30
- Copyright
- Copyright the Xyris Contributors (c) 2020
Definition in file ports.cpp.
◆ readByte()
uint8_t readByte |
( |
uint16_t |
port | ) |
|
Reads a byte (8 bits) off the CPU bus at a given port address.
- Parameters
-
- Returns
- uint8_t Returned data byte
Definition at line 13 of file ports.cpp.
15 asm volatile(
"inb %1, %0" :
"=a" (result) :
"Nd" (port));
◆ readLong()
uint32_t readLong |
( |
uint16_t |
port | ) |
|
Reads a long (32 bits) off the CPU bus at a given port address.
- Parameters
-
- Returns
- uint8_t Returned data long
Definition at line 37 of file ports.cpp.
39 asm volatile(
"inl %1, %0" :
"=a" (result) :
"Nd" (port));
◆ readWord()
uint16_t readWord |
( |
uint16_t |
port | ) |
|
Reads a word (16 bits) off the CPU bus at a given port address.
- Parameters
-
- Returns
- uint8_t Returned data word
Definition at line 27 of file ports.cpp.
29 asm volatile(
"inw %1, %0" :
"=a" (result) :
"Nd" (port));
◆ writeByte()
void writeByte |
( |
uint16_t |
port, |
|
|
uint8_t |
data |
|
) |
| |
Writes a byte (8 bits) to the CPU bus at a given port address.
- Parameters
-
port | Port address |
data | Byte to be written to the port |
Definition at line 19 of file ports.cpp.
20 asm volatile(
"outb %0, %1" : :
"a" (data),
"Nd" (port));
◆ writeByteSlow()
void writeByteSlow |
( |
uint16_t |
port, |
|
|
uint8_t |
data |
|
) |
| |
Writes a byte (8 bits) slowly to the CPU bus at a given port address.
- Parameters
-
port | Port address |
data | Byte to be written to the port |
Definition at line 23 of file ports.cpp.
24 asm volatile(
"outb %0, %1\njmp 1f\n1: jmp 1f\n1:" : :
"a" (data),
"Nd" (port));
◆ writeLong()
void writeLong |
( |
uint16_t |
port, |
|
|
uint32_t |
data |
|
) |
| |
Writes a long (32 bits) to the CPU bus at a given port address.
- Parameters
-
port | Port address |
data | Long to be written to the port |
Definition at line 43 of file ports.cpp.
44 asm volatile(
"outl %0, %1" : :
"a"(data),
"Nd" (port));
◆ writeWord()
void writeWord |
( |
uint16_t |
port, |
|
|
uint16_t |
data |
|
) |
| |
Writes a word (16 bits) to the CPU bus at a given port address.
- Parameters
-
port | Port address |
data | Word to be written to the port |
Definition at line 33 of file ports.cpp.
34 asm volatile(
"outw %0, %1" : :
"a" (data),
"Nd" (port));