blob: 7b313fca88b900593576523f0bbab9c88a4071be (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
|
#ifndef ARCH_IO_H
#define ARCH_IO_H
#include <stdint.h>
/* Helper functions for directly doing I/O */
extern inline uint8_t inb(void *port)
{
volatile unsigned char *addr = (unsigned char *)port;
uint8_t result;
result = *addr;
asm volatile ("mf.a"::: "memory");
return result;
}
extern inline void outb (uint8_t value, void *port)
{
volatile unsigned char *addr = (unsigned char *)port;
*addr = value;
asm volatile ("mf.a"::: "memory");
}
#endif /* ARCH_IO_H */
|