diff options
author | Christian Cunningham <cc@localhost> | 2022-01-02 16:56:56 -0800 |
---|---|---|
committer | Christian Cunningham <cc@localhost> | 2022-01-02 16:56:56 -0800 |
commit | 1d05efd6126377049f153c443fb2ca3ba8a2bb95 (patch) | |
tree | 695685a14a56176a95ad9653c91c41ab3bf01996 | |
parent | 23acc27565157bf8caf896f0099ad10c192326e6 (diff) |
Started Preparing Context Switching
-rw-r--r-- | src/sys/core.c | 2 | ||||
-rw-r--r-- | src/sys/schedule.h | 7 | ||||
-rw-r--r-- | src/sys/schedule.q.c | 5 |
3 files changed, 6 insertions, 8 deletions
diff --git a/src/sys/core.c b/src/sys/core.c index 079fc78..fda4d86 100644 --- a/src/sys/core.c +++ b/src/sys/core.c @@ -33,8 +33,6 @@ void sysinit(void) // Enable Timer // As an IRQ store32(1<<0, IRQ_BASIC_ENABLE); - // As a FIQ - //store32(0xC0, FIQ_CONTROL); // Get the frequency cntfrq = read_cntfrq(); // Clear cntv interrupt and set next 1 second timer diff --git a/src/sys/schedule.h b/src/sys/schedule.h index 2fd6acd..c8e938d 100644 --- a/src/sys/schedule.h +++ b/src/sys/schedule.h @@ -1,6 +1,12 @@ #ifndef SYS_SCHEDULE_H #define SYS_SCHEDULE_H +#define STACK_SIZE 0x1000 +struct TaskMemory { + unsigned long reg[16]; + unsigned char stack[STACK_SIZE]; +}; + struct Task { unsigned char priority; void (*task)(void); @@ -23,7 +29,6 @@ struct Scheduler { #endif void add_fxn(void (*task)(void), unsigned char priority); -void add_task(struct Task*); unsigned int get_task_length(void); void execute_task(void); diff --git a/src/sys/schedule.q.c b/src/sys/schedule.q.c index 818ba66..88488da 100644 --- a/src/sys/schedule.q.c +++ b/src/sys/schedule.q.c @@ -16,11 +16,6 @@ void add_fxn(void (*task)(void), unsigned char priority) struct Task* t = (struct Task*)malloc(sizeof(struct Task)); t->priority = priority; t->task = task; - add_task(t); -} - -void add_task(struct Task* t) -{ pushq(scheduler.tasks, t); } |