error: return usable error strings, not nothing.
[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 <event.h>
13 #include <atomic.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         struct event_queue                      *ev_q;
22 };
23 TAILQ_HEAD(proc_alarm_list, proc_alarm);
24
25 struct proc_alarm_set {
26         struct proc_alarm_list          list;
27         spinlock_t                                      lock;
28         struct timer_chain                      *tchain;
29         int                                                     id_counter;
30 };
31
32 void devalarm_init(struct proc *p);