Initial commit
This commit is contained in:
commit
bae9ffa930
11 changed files with 847 additions and 0 deletions
18
include/kernel/pio.h
Normal file
18
include/kernel/pio.h
Normal file
|
|
@ -0,0 +1,18 @@
|
|||
#ifndef _PIO_H_
|
||||
#define _PIO_H_
|
||||
|
||||
#include <stdint.h>
|
||||
|
||||
static inline void outb(uint16_t port, uint8_t val)
|
||||
{
|
||||
__asm__ volatile("outb %0, %1" : : "a"(val), "Nd"(port));
|
||||
}
|
||||
|
||||
static inline uint8_t inb(uint16_t port)
|
||||
{
|
||||
uint8_t ret;
|
||||
__asm__ volatile("inb %1, %0" : "=a"(ret) : "Nd"(port));
|
||||
return ret;
|
||||
}
|
||||
|
||||
#endif /* _PIO_H_ */
|
||||
Loading…
Reference in a new issue