Use FD taps for event delivery for #alarm
[akaros.git] / kern / include / devalarm.h
1 /* Copyright (c) 2013 The Regents of the University of California
2  * Barret Rhoden <brho@cs.berkeley.edu>
3  * See LICENSE for details.
4  *
5  * Alarm device includes (needed for the linkage to struct proc) */
6
7 #pragma once
8
9 #include <sys/queue.h>
10 #include <kref.h>
11 #include <alarm.h>
12 #include <atomic.h>
13 #include <fdtap.h>
14
15 struct proc_alarm {
16         TAILQ_ENTRY(proc_alarm)         link;
17         int                                                     id;
18         struct kref                                     kref;
19         struct alarm_waiter                     a_waiter;
20         struct proc                                     *proc;
21         spinlock_t                                      tap_lock;
22         struct fdtap_slist                      fd_taps;
23 };
24 TAILQ_HEAD(proc_alarm_list, proc_alarm);
25
26 struct proc_alarm_set {
27         struct proc_alarm_list          list;
28         spinlock_t                                      lock;
29         struct timer_chain                      *tchain;
30         int                                                     id_counter;
31 };
32
33 void devalarm_init(struct proc *p);