diff options
Diffstat (limited to 'task/exrtab.c')
-rw-r--r-- | task/exrtab.c | 19 |
1 files changed, 19 insertions, 0 deletions
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; +} |