From 7753da66d7d72f441dadd76f357fd5ceb50e7c8f Mon Sep 17 00:00:00 2001 From: Christian Cunningham Date: Thu, 24 Mar 2022 18:52:56 -0700 Subject: Modularize Userspace --- include/cpu.h | 24 +++++++++++++----------- include/usr/string.h | 6 ++++++ include/usr/timed.h | 7 +++++++ include/usr/uart.h | 6 ++++++ 4 files changed, 32 insertions(+), 11 deletions(-) create mode 100644 include/usr/string.h create mode 100644 include/usr/timed.h create mode 100644 include/usr/uart.h (limited to 'include') 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 -- cgit v1.2.1