aboutsummaryrefslogtreecommitdiff
path: root/src/kernel/io
diff options
context:
space:
mode:
authorMarvin Borner2020-03-18 16:41:21 +0100
committerMarvin Borner2020-03-18 16:41:21 +0100
commitc6657aac0c5d5ecf347bc082cb6df38e1174d297 (patch)
tree5db660dd74d9741cf1105290d4584d9a1fdb7020 /src/kernel/io
parentadd6efeb22ffb7695d5c9addcef073fc653f700e (diff)
Replaced asm calls with sweet function
Diffstat (limited to 'src/kernel/io')
-rw-r--r--src/kernel/io/io.c17
-rw-r--r--src/kernel/io/io.h4
2 files changed, 20 insertions, 1 deletions
diff --git a/src/kernel/io/io.c b/src/kernel/io/io.c
index 858f968..c4dad52 100644
--- a/src/kernel/io/io.c
+++ b/src/kernel/io/io.c
@@ -22,6 +22,21 @@ uint32_t inl(uint16_t port)
return value;
}
+void cli()
+{
+ asm volatile ("cli");
+}
+
+void sti()
+{
+ asm volatile ("sti");
+}
+
+void hlt()
+{
+ asm volatile ("hlt");
+}
+
void outb(uint16_t port, uint8_t data)
{
asm ("outb %0, %1"::"a" (data), "Nd"(port));
@@ -58,4 +73,4 @@ void serial_put(char ch)
{
while (is_transmit_empty() == 0);
outb(0x3f8, (uint8_t) ch);
-} \ No newline at end of file
+}
diff --git a/src/kernel/io/io.h b/src/kernel/io/io.h
index b62e90f..7d09dcb 100644
--- a/src/kernel/io/io.h
+++ b/src/kernel/io/io.h
@@ -24,6 +24,10 @@ uint16_t inw(uint16_t port);
*/
uint32_t inl(uint16_t port);
+void cli();
+void sti();
+void hlt();
+
/**
* Send data to the specified hardware port
* @param port The hardware port