add workqueue

This commit is contained in:
zy
2023-11-23 18:12:57 +08:00
parent 316174b71e
commit 1df11cd6e4
3 changed files with 92 additions and 78 deletions

View File

@@ -1,4 +1,5 @@
#include <linux/hrtimer.h>
#include <linux/workqueue.h>
#define MAX_TIMER_NUM (128) // max timer number
#define TIMER_MAX_WATCH_NUM (32) // A timer max watch number at once time
@@ -33,6 +34,10 @@ typedef struct {
unsigned sentinel; // sentinel
kernel_watch_arg
k_watch_args[TIMER_MAX_WATCH_NUM]; // all watched kernel_watch_arg
int threshold_num; // all over threshold number,
// 0 means no handle needed
int threshold_buffer[TIMER_MAX_WATCH_NUM]; //
struct work_struct wk; // for handle
} kernel_watch_timer;
// Global variable