diff options
| author | Jake Mannens <jake72360@gmail.com> | 2018-06-16 04:49:57 +1000 |
|---|---|---|
| committer | Jake Mannens <jake72360@gmail.com> | 2018-06-16 04:49:57 +1000 |
| commit | 3e9bdcca84e22c997a071dddf37449ead85aed75 (patch) | |
| tree | 06def7ef704b348cdef2b704d3357b79d22f00bd /include/asm | |
Initial commit
Diffstat (limited to 'include/asm')
| -rw-r--r-- | include/asm/io.h | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/include/asm/io.h b/include/asm/io.h new file mode 100644 index 0000000..6ca5bbc --- /dev/null +++ b/include/asm/io.h @@ -0,0 +1,14 @@ +/* + * asm/io.h + * + * Provides acces to x86 I/O functions + */ + +#define inb(port) ({ \ + unsigned char _val; \ + asm volatile ("inb %%dx, %%al" : "=a" (_val) : "d" (port)); \ + _val; \ + }) + +#define outb(port, val) \ + asm volatile ("outb %%al, %%dx" : : "d" (port), "a" (val)); |
