vfs: Remove the guts of the VFS
[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 #include <rendez.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 cond_var                         cv;
22         qlock_t                                         qlock;
23         struct proc                                     *proc;
24         struct fdtap_slist                      fd_taps;
25         unsigned long                           period;
26         unsigned long                           count;
27 };
28 TAILQ_HEAD(proc_alarm_list, proc_alarm);
29
30 struct proc_alarm_set {
31         struct proc_alarm_list          list;
32         spinlock_t                                      lock;
33         struct timer_chain                      *tchain;
34         int                                                     id_counter;
35 };
36
37 void devalarm_init(struct proc *p);