BXE: malloc fixups
[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 #ifndef ROS_KERN_DEVALARM_H
8 #define ROS_KERN_DEVALARM_H
9
10 #include <sys/queue.h>
11 #include <kref.h>
12 #include <alarm.h>
13 #include <event.h>
14 #include <atomic.h>
15
16 struct proc_alarm {
17         TAILQ_ENTRY(proc_alarm)         link;
18         int                                                     id;
19         struct kref                                     kref;
20         struct alarm_waiter                     a_waiter;
21         struct proc                                     *proc;
22         struct event_queue                      *ev_q;
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);
34
35 #endif /* ROS_KERN_DEVALARM_H */