#include <stddef.h>
#include <stdbool.h>
#include <stdint.h>
#include <sys/kassert.h>
#include <sys/queue.h>
#include <sys/spinlock.h>
#include <sys/kmem.h>
#include <sys/mp.h>
#include <sys/ktime.h>
#include <sys/ktimer.h>
Go to the source code of this file.
◆ TIMER_WHEEL_LENGTH
#define TIMER_WHEEL_LENGTH 256 |
◆ KTimer_Cancel()
Definition at line 77 of file ktimer.c.
78{
80
83
85}
void KTimer_Release(KTimerEvent *evt)
#define LIST_REMOVE(elm, field)
void Spinlock_Unlock(Spinlock *lock) __UNLOCK_EX(*lock)
void Spinlock_Lock(Spinlock *lock) __LOCK_EX(*lock)
◆ KTimer_Create()
Definition at line 41 of file ktimer.c.
42{
43 int slot;
45
50
53
56
57 return evt;
58}
#define TIMER_WHEEL_LENGTH
#define LIST_INSERT_HEAD(head, elm, field)
◆ KTimer_Process()
Definition at line 88 of file ktimer.c.
89{
91
93 return;
94 }
95
97
99
102
103
109 }
110 }
111
112
115 }
116
118}
UnixEpoch KTime_GetEpoch()
#define LIST_FOREACH_SAFE(var, head, field, tvar)
◆ KTimer_Release()
Definition at line 68 of file ktimer.c.
69{
71 if (__sync_fetch_and_sub(&evt->
refCount, 1) == 1) {
72 KTimerEvent_Free(evt);
73 }
74}
◆ KTimer_Retain()
Definition at line 61 of file ktimer.c.
62{
64 __sync_fetch_and_add(&evt->
refCount, 1);
65}
◆ LIST_HEAD()
static LIST_HEAD |
( |
TimerWheelHead |
, |
|
|
DEFINE_SLAB( |
KTimerEvent |
|
) |
| |
|
static |
Definition at line 18 of file ktimer.c.
26{
27 int i;
28
31
32
37 }
38}
void Slab_Init(Slab *slab, const char *name, uintptr_t objsz, uintptr_t align)
#define SPINLOCK_TYPE_NORMAL
void Spinlock_Init(Spinlock *lock, const char *name, uint64_t type)
◆ timerHead
◆ timerNow