Files
Astral/src/include/kernel/timer.h
T
Matheus e7f4245c6d kernel threads
kernel threads and preemptive multitasking
2022-08-13 15:26:12 -03:00

24 lines
458 B
C

#ifndef _TIMER_H_INCLUDE
#define _TIMER_H_INCLUDE
#include <stdbool.h>
#include <stddef.h>
#include <arch/regs.h>
typedef struct _timer_req{
// values callee should care about
void* (*func)(arch_regs*, void*);
void* argptr;
// internal values
struct _timer_req* next;
size_t ticks;
} timer_req;
void timer_init();
void timer_add(timer_req* req, size_t us, bool start);
void timer_resume();
void timer_stop();
void timer_irq(arch_regs* ctx);
#endif