From ace65b453151845bc361f21f3e5b651c35f9f126 Mon Sep 17 00:00:00 2001 From: Jon Santmyer Date: Wed, 22 May 2024 13:00:41 -0400 Subject: massive refactor for mp and organization --- task/exrtab.c | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 task/exrtab.c (limited to 'task/exrtab.c') diff --git a/task/exrtab.c b/task/exrtab.c new file mode 100644 index 0000000..82b9e29 --- /dev/null +++ b/task/exrtab.c @@ -0,0 +1,19 @@ +#include "arch/processor.h" +#include "assert.h" + +void +_exrtab_push(void *v) +{ + processor_t *proc = processor_current(); + proc->exrtab[proc->ert_i++] = (uintptr_t)v; +} + +void* +_exrtab_pop(void) +{ + processor_t *proc = processor_current(); + + assert(proc->ert_i != 0); + uintptr_t r = proc->exrtab[--proc->ert_i]; + return (void*)r; +} -- cgit v1.2.1