From 39713a3736145483dd3310c3605f940ca34f05c3 Mon Sep 17 00:00:00 2001 From: Loic Guegan Date: Mon, 12 Apr 2021 10:13:21 +0200 Subject: Refactoring --- src/core/asm.h | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 src/core/asm.h (limited to 'src/core/asm.h') diff --git a/src/core/asm.h b/src/core/asm.h new file mode 100644 index 0000000..be265d8 --- /dev/null +++ b/src/core/asm.h @@ -0,0 +1,13 @@ +#ifndef ASM_H +#define ASM_H + +#define outb(port,value) \ + asm volatile ("outb %%al, %%dx" :: "a"(value), "d" (port) ) + +#define outbj(port,value) \ + asm volatile ("outb %%al, %%dx;" :: "a" (value), "d"(port) ) + +#define inb(port,dst) \ + asm volatile ("inb %%dx, %%al": "=a" (dst) : "d" (port)) + +#endif \ No newline at end of file -- cgit v1.2.3