DragonOS/kernel/driver/timers/timer.h

50 lines
1002 B
C
Raw Normal View History

2022-04-08 12:04:12 +00:00
#pragma once
#include <common/glib.h>
#include "HPET/HPET.h"
#include "rtc/rtc.h"
uint64_t volatile timer_jiffies = 0; // 系统时钟计数
void timer_init();
2022-04-08 13:26:42 +00:00
void do_timer_softirq(void* data);
/**
* @brief
*
*/
struct timer_func_list_t
{
struct List list;
uint64_t expire_jiffies;
void (*func)(void* data);
void* data;
}timer_func_head;
/**
* @brief
*
* @param timer_func
* @param func
* @param data
* @param expire_jiffies
*/
void timer_func_init(struct timer_func_list_t * timer_func, void (*func)(void*data), void*data,uint64_t expire_jiffies);
/**
* @brief
*
* @param timer_func
*/
void timer_func_add(struct timer_func_list_t* timer_func);
/**
* @brief
*
* @param timer_func
*/
void timer_func_del(struct timer_func_list_t* timer_func);