Feat: lab 3 w/o adv 2

This commit is contained in:
2025-03-26 15:30:57 +08:00
parent c5fc7e3102
commit 924bb67417
25 changed files with 617 additions and 113 deletions

27
kernel/include/timer.h Normal file
View 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;