Feat: lab 3 w/o adv 2
This commit is contained in:
27
kernel/include/timer.h
Normal file
27
kernel/include/timer.h
Normal file
@@ -0,0 +1,27 @@
|
||||
#pragma once
|
||||
|
||||
#include <stddef.h>
|
||||
|
||||
typedef void (*task_callback_func_t)(uint64_t);
|
||||
|
||||
typedef struct {
|
||||
uint64_t firing_tick;
|
||||
uint64_t interval;
|
||||
uint64_t repeat;
|
||||
|
||||
task_callback_func_t func;
|
||||
uint64_t param;
|
||||
} task_t;
|
||||
|
||||
typedef struct timer {
|
||||
struct timer *_l, *_r;
|
||||
uint32_t _d;
|
||||
|
||||
task_t data;
|
||||
} timer_t;
|
||||
|
||||
void add_task(task_t task);
|
||||
|
||||
void timer_irq_handler(void);
|
||||
|
||||
extern timer_t *global_timer;
|
||||
Reference in New Issue
Block a user