X-Git-Url: https://scm.lunaixsky.com/lunaix-os.git/blobdiff_plain/78cd005fac540973751b5a108c37a715bc64b5a2..refs/heads/nov/revmap:/lunaix-os/includes/lunaix/iopoll.h diff --git a/lunaix-os/includes/lunaix/iopoll.h b/lunaix-os/includes/lunaix/iopoll.h index 027f6fb..dae362c 100644 --- a/lunaix-os/includes/lunaix/iopoll.h +++ b/lunaix-os/includes/lunaix/iopoll.h @@ -3,10 +3,13 @@ #include #include -#include #include +struct thread; // +struct proc_info; // +struct v_fd; // + typedef struct llist_header poll_evt_q; struct poll_opts @@ -20,7 +23,7 @@ struct iopoller { poll_evt_q evt_listener; struct v_file* file_ref; - pid_t pid; + struct thread* thread; }; struct iopoll @@ -35,6 +38,12 @@ iopoll_listen_on(struct iopoller* listener, poll_evt_q* source) llist_append(source, &listener->evt_listener); } +static inline void +iopoll_init_evt_q(poll_evt_q* source) +{ + llist_init_head(source); +} + void iopoll_wake_pollers(poll_evt_q*); @@ -42,13 +51,13 @@ void iopoll_init(struct iopoll*); void -iopoll_free(pid_t, struct iopoll*); +iopoll_free(struct proc_info*); int -iopoll_install(pid_t, struct iopoll*, struct v_fd*); +iopoll_install(struct thread* thread, struct v_fd* fd); int -iopoll_remove(pid_t, struct iopoll*, int); +iopoll_remove(struct thread*, int); static inline void poll_setrevt(struct poll_info* pinfo, int evt)