aboutsummaryrefslogtreecommitdiff
path: root/src/sys/schedule.c
diff options
context:
space:
mode:
authorChristian Cunningham <cc@localhost>2022-01-23 12:59:27 -0700
committerChristian Cunningham <cc@localhost>2022-01-23 12:59:27 -0700
commit5bb02975ac5f541245af9b4f6c0be4ffaa2d8463 (patch)
tree6e101458a5d763cb3fd66d7dc0baeef409a81d47 /src/sys/schedule.c
parentbb09366a7cafeb8ab91b55b98f15934f0f512d47 (diff)
Draw Exception info to screen
Diffstat (limited to 'src/sys/schedule.c')
-rw-r--r--src/sys/schedule.c20
1 files changed, 20 insertions, 0 deletions
diff --git a/src/sys/schedule.c b/src/sys/schedule.c
index ea5b465..ebf60bc 100644
--- a/src/sys/schedule.c
+++ b/src/sys/schedule.c
@@ -1,4 +1,5 @@
#include <globals.h>
+#include <graphics/lfb.h>
#include <drivers/uart.h>
#include <sys/schedule.h>
#include <util/mutex.h>
@@ -48,6 +49,25 @@ struct RStack get_stack(void)
return r;
}
+void draw_stacks(void)
+{
+ unsigned long ioff = 0;
+ unsigned long yoff = 320;
+#define STACK_DRAW_WIDTH 32
+#define STACK_DRAW_SIZE 3
+ for(int i = 0; i < MAX_THREADS; i++) {
+ if(stacks_table[i])
+ draw_cbox(ioff, yoff, STACK_DRAW_SIZE, STACK_DRAW_SIZE, 0xFFFFFF);
+ else
+ draw_cbox(ioff, yoff, STACK_DRAW_SIZE, STACK_DRAW_SIZE, 0x000000);
+ ioff += STACK_DRAW_SIZE;
+ if(ioff % STACK_DRAW_WIDTH == 0) {
+ yoff += STACK_DRAW_SIZE;
+ ioff = 0;
+ }
+ }
+}
+
void add_thread(void* pc, void* arg, unsigned char priority)
{
//void* sp = get_stack();