You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
49 lines
1.0 KiB
49 lines
1.0 KiB
3 years ago
|
#ifndef KERNEL_IO_H
|
||
|
#define KERNEL_IO_H
|
||
|
|
||
|
/**
|
||
|
* Wrapper function that reads a byte from the specified I/O port.
|
||
|
*
|
||
|
* "=a" (result) - put al register in the `result` var when finished
|
||
|
* "d" (port) - load edx with the specified `port`
|
||
|
*
|
||
|
* @param port
|
||
|
* @return the read byte
|
||
|
*/
|
||
|
u8_t io_byte_in(u16_t port);
|
||
|
|
||
|
/**
|
||
|
* Wrapper function that writes a byte to the specified I/O port.
|
||
|
*
|
||
|
* "a" (data) - load eal with `data`
|
||
|
* "d" (port) - load edx with `port`
|
||
|
*
|
||
|
* @param port
|
||
|
* @param data
|
||
|
*/
|
||
|
void io_byte_out(u16_t port, u8_t data);
|
||
|
|
||
|
/**
|
||
|
* Wrapper function that reads a word from the specified I/O port.
|
||
|
*
|
||
|
* "=a" (result) - put eax register in the `result` var when finished
|
||
|
* "d" (port) - load edx with the specified `port`
|
||
|
*
|
||
|
* @param port
|
||
|
* @return the read word
|
||
|
*/
|
||
|
u16_t io_word_in(u16_t port);
|
||
|
|
||
|
/**
|
||
|
* Wrapper function that writes a word to the specified I/O port.
|
||
|
*
|
||
|
* "a" (data) - load eax with `data`
|
||
|
* "d" (port) - load edx with `port`
|
||
|
*
|
||
|
* @param port
|
||
|
* @param data
|
||
|
*/
|
||
|
void io_word_out(u16_t port, u16_t data);
|
||
|
|
||
|
#endif //KERNEL_IO_H
|