summaryrefslogtreecommitdiff
path: root/src/stem/sys.c
diff options
context:
space:
mode:
authorAlexis211 <alexis211@gmail.com>2010-02-03 15:22:30 +0100
committerAlexis211 <alexis211@gmail.com>2010-02-03 15:22:30 +0100
commit9c4310651a91e64c10a17f3190c895a49096aeb1 (patch)
treeaf87d115512249458f80f184d53db403c3f0bb0f /src/stem/sys.c
parent7f72a900c12ba62db12df0872cb66f79a27aa9d9 (diff)
downloadTCE-9c4310651a91e64c10a17f3190c895a49096aeb1.tar.gz
TCE-9c4310651a91e64c10a17f3190c895a49096aeb1.zip
Reogranization
Diffstat (limited to 'src/stem/sys.c')
-rw-r--r--src/stem/sys.c41
1 files changed, 0 insertions, 41 deletions
diff --git a/src/stem/sys.c b/src/stem/sys.c
deleted file mode 100644
index 71d1c31..0000000
--- a/src/stem/sys.c
+++ /dev/null
@@ -1,41 +0,0 @@
-#include "sys.h"
-#include "monitor.h"
-
-void outb(uint16_t port, uint8_t value) {
- asm volatile("outb %1, %0" : : "dN"(port), "a"(value));
-}
-
-void outw(uint16_t port, uint16_t value) {
- asm volatile("outw %1, %0" : : "dN"(port), "a"(value));
-}
-
-uint8_t inb(uint16_t port) {
- uint8_t ret;
- asm volatile("inb %1, %0" : "=a"(ret) : "dN"(port));
- return ret;
-}
-
-uint16_t inw(uint16_t port) {
- uint16_t ret;
- asm volatile("inw %1, %0" : "=a"(ret) : "dN"(port));
- return ret;
-}
-
-void panic(char* message, char* file, int line) {
- monitor_write(">> PANIC: >>");
- monitor_write(message); monitor_write("<< in file "); monitor_write(file);
- monitor_write("\nSystem halted T_T");
- asm volatile("cli; hlt");
-}
-
-static uint32_t if_locks = 1;
-
-void cli() {
- asm volatile("cli");
- if_locks++;
-}
-
-void sti() {
- if_locks--;
- if (if_locks == 0) asm volatile("sti");
-}