1 #ifndef __LUNAIX_IOPOLL_H
2 #define __LUNAIX_IOPOLL_H
4 #include <lunaix/device.h>
5 #include <lunaix/ds/llist.h>
7 #include <usr/lunaix/poll.h>
9 struct v_fd; // <lunaix/fs.h>
11 typedef struct llist_header poll_evt_q;
15 struct pollfd** upoll;
22 poll_evt_q evt_listener;
23 struct v_file* file_ref;
29 struct iopoller** pollers;
34 iopoll_listen_on(struct iopoller* listener, poll_evt_q* source)
36 llist_append(source, &listener->evt_listener);
40 iopoll_init_evt_q(poll_evt_q* source)
42 llist_init_head(source);
46 iopoll_wake_pollers(poll_evt_q*);
49 iopoll_init(struct iopoll*);
52 iopoll_free(pid_t, struct iopoll*);
55 iopoll_install(pid_t, struct iopoll*, struct v_fd*);
58 iopoll_remove(pid_t, struct iopoll*, int);
61 poll_setrevt(struct poll_info* pinfo, int evt)
63 pinfo->revents = (pinfo->revents & ~evt) | evt;
67 poll_checkevt(struct poll_info* pinfo, int evt)
69 return pinfo->events & evt;
72 #endif /* __LUNAIX_POLL_H */