aboutsummaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorChristian Cunningham <cc@localhost>2022-02-04 16:33:19 -0700
committerChristian Cunningham <cc@localhost>2022-02-04 16:33:19 -0700
commit6e7f93d6a09865937dde1124a6c3f36eebcd9d82 (patch)
tree085d3b687b4c6175592a4d3cf9b0afdf75503837 /include
parentaaf7667a36a0268de87f1913fd9a87e1cbf7da92 (diff)
Move tests to own file
Diffstat (limited to 'include')
-rw-r--r--include/cpu.h14
-rw-r--r--include/drivers/uart.h1
-rw-r--r--include/tests/test.h6
3 files changed, 8 insertions, 13 deletions
diff --git a/include/cpu.h b/include/cpu.h
index 0f4993f..19f0e56 100644
--- a/include/cpu.h
+++ b/include/cpu.h
@@ -80,21 +80,9 @@ static inline void* getirqstack(void)
#define syscall_h_expand_and_quote(text) syscall_h_quote(text)
#define sys0(sys_n) asm volatile("svc #" syscall_h_expand_and_quote(sys_n) ::: "r0", "r1", "r2", "r3");
+#define sys0_64(sys_n,addr) asm volatile("svc #" syscall_h_expand_and_quote(sys_n) "\nmov r2, %0\nstr r1, [r2]\nstr r0, [r2, #4]" ::"r"(addr): "r0", "r1", "r2", "r3", "memory");
#define sys1(sys_n,arg0) asm volatile("svc #" syscall_h_expand_and_quote(sys_n) ::[r0]"r"(arg0): "r0", "r1", "r2", "r3");
-__attribute__((always_inline)) static inline unsigned long long get_sys_time(void)
-{
- union {
- struct {
- unsigned long lo;
- unsigned long hi;
- }s;
- unsigned long long llv;
- }t;
- asm volatile("svc #1\nmov %0, r1\nmov %1, r0" : "=r"(t.s.lo), "=r"(t.s.hi));
- return t.llv;
-}
-
#define SYS_YIELD 0
#define SYS_TIME 1
#define SYS_SCHED 2
diff --git a/include/drivers/uart.h b/include/drivers/uart.h
index 1491f20..6317068 100644
--- a/include/drivers/uart.h
+++ b/include/drivers/uart.h
@@ -4,6 +4,7 @@
#define PRINTS_DBG(X) uart_char('[');uart_string(__FILE__);uart_char(':');uart_10(__LINE__);uart_string("] ");uart_string(X);uart_char('\n');
#define PRINTX_DBG(X) uart_char('[');uart_string(__FILE__);uart_char(':');uart_10(__LINE__);uart_string("] ");uart_hex((unsigned long)X);uart_char('\n');
#define PRINTI_DBG(X) uart_char('[');uart_string(__FILE__);uart_char(':');uart_10(__LINE__);uart_string("] ");uart_10((unsigned long)X);uart_char('\n');
+#define PRINT64(x) uart_hex(x>>32);uart_hexn(x);
extern void uart_char(unsigned char c);
extern void uart_string(char* message);
diff --git a/include/tests/test.h b/include/tests/test.h
new file mode 100644
index 0000000..239f53b
--- /dev/null
+++ b/include/tests/test.h
@@ -0,0 +1,6 @@
+#ifndef TESTS_TEST_H
+#define TESTS_TEST_H
+
+void test_entry(void);
+
+#endif