From 54df2c4c0a61c03cba268e45e0fd85bf2a7e564b Mon Sep 17 00:00:00 2001 From: Kimplul Date: Fri, 23 Sep 2022 01:03:34 +0300 Subject: add notify_state to tcb --- include/apos/tcb.h | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) (limited to 'include/apos') diff --git a/include/apos/tcb.h b/include/apos/tcb.h index 41b5237..72dcc98 100644 --- a/include/apos/tcb.h +++ b/include/apos/tcb.h @@ -49,7 +49,7 @@ /* forward declaration */ struct tcb; -/** Convenience structure for \see tcb. */ +/** Convenience structure for \ref tcb. */ struct tcb_ctx { /** Virtual address space of context. */ struct vmem *vmem; @@ -61,6 +61,18 @@ struct tcb_ctx { struct tcb *prev; }; +/** Enum for notification states. */ +enum tcb_notify_state { + /** Thread has notifcations queued. */ + NOTIFY_QUEUED, + + /** Thread is running notification handler. */ + NOTIFY_RUNNING, + + /** Thread is free to be notified. */ + NOTIFY_WAITING +}; + /** Thread control block. Main way to handle threads. */ struct tcb { /** Arch-specific data. */ @@ -128,6 +140,9 @@ struct tcb { /** RPC context of thread. */ struct tcb_ctx rpc; + + /** Notifcation state of thread. */ + enum tcb_notify notify_state; }; /** -- cgit v1.3