mirror of
https://github.com/Mathewnd/Astral.git
synced 2026-10-29 05:38:21 +00:00
e7f4245c6d
kernel threads and preemptive multitasking
24 lines
458 B
C
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
|