aboutsummaryrefslogtreecommitdiff
path: root/src/util
diff options
context:
space:
mode:
authorChristian Cunningham <cc@localhost>2022-01-05 14:27:09 -0800
committerChristian Cunningham <cc@localhost>2022-01-05 14:27:09 -0800
commit866a6ca0e749f4446b7fdc7579a6d553df85ec10 (patch)
treed259223d85c224d649c6c38675e99b155d50cf48 /src/util
parent3a8ed19bf83f11ff00c4904fab2cc083b7e33478 (diff)
Moved includes to its own directory
Diffstat (limited to 'src/util')
-rw-r--r--src/util/mutex.c6
-rw-r--r--src/util/mutex.h17
-rw-r--r--src/util/status.c15
-rw-r--r--src/util/status.h6
-rw-r--r--src/util/time.c3
-rw-r--r--src/util/time.h26
6 files changed, 13 insertions, 60 deletions
diff --git a/src/util/mutex.c b/src/util/mutex.c
index 1763de2..ade0be3 100644
--- a/src/util/mutex.c
+++ b/src/util/mutex.c
@@ -1,6 +1,6 @@
-#include "../cpu/atomic/swap.h"
-#include "../lib/mem.h"
-#include "../util/mutex.h"
+#include <cpu/atomic/swap.h>
+#include <lib/mem.h>
+#include <util/mutex.h>
unsigned char lock_mutex(struct Mutex* m, unsigned long pid)
{
diff --git a/src/util/mutex.h b/src/util/mutex.h
deleted file mode 100644
index 524a461..0000000
--- a/src/util/mutex.h
+++ /dev/null
@@ -1,17 +0,0 @@
-#ifndef UTIL_MUTEX_H
-#define UTIL_MUTEX_H
-
-#define NULL_PID 0
-#define SYS_PID 1
-#define SCHED_PID 2
-
-struct Mutex {
- void* addr;
- unsigned long pid;
-} __attribute__((packed, aligned(4)));;
-
-unsigned char lock_mutex(struct Mutex*, unsigned long);
-unsigned char release_mutex(struct Mutex*, unsigned long);
-struct Mutex* create_mutex(void* addr);
-
-#endif
diff --git a/src/util/status.c b/src/util/status.c
index 6ab21c0..f59ede6 100644
--- a/src/util/status.c
+++ b/src/util/status.c
@@ -1,10 +1,11 @@
-#include "../graphics/drawer.h"
-#include "../graphics/lfb.h"
-#include "../sys/core.h"
-#include "../sys/timer.h"
-#include "../util/mutex.h"
-#include "../util/status.h"
-#include "../util/time.h"
+#include <graphics/drawer.h>
+#include <graphics/lfb.h>
+#include <symbols.h>
+#include <sys/core.h>
+#include <sys/timer.h>
+#include <util/mutex.h>
+#include <util/status.h>
+#include <util/time.h>
void output_irq_status(void)
{
diff --git a/src/util/status.h b/src/util/status.h
deleted file mode 100644
index f6966dd..0000000
--- a/src/util/status.h
+++ /dev/null
@@ -1,6 +0,0 @@
-#ifndef UTIL_STATUS_H
-#define UTIL_STATUS_H
-
-void status(void);
-
-#endif
diff --git a/src/util/time.c b/src/util/time.c
index c09567f..035ff82 100644
--- a/src/util/time.c
+++ b/src/util/time.c
@@ -1,4 +1,5 @@
-#include "../sys/core.h"
+#include <symbols.h>
+#include <sys/core.h>
void routing_core0cntv_to_core0irq(void)
{
diff --git a/src/util/time.h b/src/util/time.h
deleted file mode 100644
index f6dacb0..0000000
--- a/src/util/time.h
+++ /dev/null
@@ -1,26 +0,0 @@
-#ifndef UTIL_TIME_H
-#define UTIL_TIME_H
-
-void routing_core0cntv_to_core0irq(void);
-unsigned long read_core0timer_pending(void);
-unsigned long long read_cntvct(void);
-unsigned long long read_cntvoff(void);
-unsigned long read_cntv_tval(void);
-void write_cntv_tval(unsigned long val);
-unsigned long read_cntfrq(void);
-
-static inline void enablecntv(void)
-{
- unsigned long cntv_ctl;
- cntv_ctl = 1;
- asm volatile ("mcr p15, 0, %0, c14, c3, 1" :: "r"(cntv_ctl) ); // write CNTV_CTL
-}
-
-static inline void disablecntv(void)
-{
- unsigned long cntv_ctl;
- cntv_ctl = 0;
- asm volatile ("mcr p15, 0, %0, c14, c3, 1" :: "r"(cntv_ctl) ); // write CNTV_CTL
-}
-
-#endif