aboutsummaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorChristian Cunningham <cc@localhost>2022-03-24 18:52:56 -0700
committerChristian Cunningham <cc@localhost>2022-03-24 18:52:56 -0700
commit7753da66d7d72f441dadd76f357fd5ceb50e7c8f (patch)
treec79cee644108ecb65952eff2104127a19e72d0c4 /include
parent78493b1d441ef888910cf958a16f260bc3c1a7bd (diff)
Modularize Userspace
Diffstat (limited to 'include')
-rw-r--r--include/cpu.h24
-rw-r--r--include/usr/string.h6
-rw-r--r--include/usr/timed.h7
-rw-r--r--include/usr/uart.h6
4 files changed, 32 insertions, 11 deletions
diff --git a/include/cpu.h b/include/cpu.h
index 43eeed3..d16beb5 100644
--- a/include/cpu.h
+++ b/include/cpu.h
@@ -88,16 +88,18 @@ static inline void* getirqstack(void)
asm volatile("svc #" syscall_h_expand_and_quote(sys_n) ::"r"(r0): "memory"); \
}
-#define SYS_YIELD 0
-#define SYS_TIME 1
-#define SYS_SCHED 2
-#define SYS_YIELD_HIGH 2
-#define SYS_ADD_THREAD 3
-#define SYS_LOCK 4
-#define SYS_UNLOCK 5
-#define SYS_SEMAPHORE_P 6
-#define SYS_SEMAPHORE_V 7
-#define SYS_SEMAPHORE_IV 8
-#define SYS_TIME_2 9
+#define SYS_YIELD 0x00000
+#define SYS_TIME 0x00001
+#define SYS_SCHED 0x00002
+#define SYS_YIELD_HIGH 0x00002
+#define SYS_ADD_THREAD 0x00003
+#define SYS_LOCK 0x00004
+#define SYS_UNLOCK 0x00005
+#define SYS_SEMAPHORE_P 0x00006
+#define SYS_SEMAPHORE_V 0x00007
+#define SYS_SEMAPHORE_IV 0x00008
+#define SYS_TIME_2 0x00009
+#define SYS_ENABLE_CNTV 0x0000A
+#define SYS_DISABLE_CNTV 0x0000B
#endif
diff --git a/include/usr/string.h b/include/usr/string.h
new file mode 100644
index 0000000..7da44a8
--- /dev/null
+++ b/include/usr/string.h
@@ -0,0 +1,6 @@
+#ifndef USR_STRING_H
+#define USR_STRING_H
+
+char* ulong_to_string(unsigned long value, char* data);
+
+#endif
diff --git a/include/usr/timed.h b/include/usr/timed.h
new file mode 100644
index 0000000..f3f941a
--- /dev/null
+++ b/include/usr/timed.h
@@ -0,0 +1,7 @@
+#ifndef USR_TIMED_H
+#define USR_TIMED_H
+
+void loop(void);
+void loopt(void);
+
+#endif
diff --git a/include/usr/uart.h b/include/usr/uart.h
new file mode 100644
index 0000000..2214012
--- /dev/null
+++ b/include/usr/uart.h
@@ -0,0 +1,6 @@
+#ifndef USR_UART_H
+#define USR_UART_H
+
+void handle_data(unsigned char data);
+
+#endif