aboutsummaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorKimplul <kimi.h.kuparinen@gmail.com>2024-07-06 20:50:36 +0300
committerKimplul <kimi.h.kuparinen@gmail.com>2024-07-06 20:50:36 +0300
commit9c0f26d26366ff7def20d5be6aff5e0f93976ad6 (patch)
tree3872c5a1018a232e51da3f774ca54ae2e9967427 /include
parente9da1d29939a74e186afc39f2fce8e085764fea0 (diff)
downloadkmi-9c0f26d26366ff7def20d5be6aff5e0f93976ad6.tar.gz
kmi-9c0f26d26366ff7def20d5be6aff5e0f93976ad6.zip
adjust stack handling
Diffstat (limited to 'include')
-rw-r--r--include/arch/tcb.h7
-rw-r--r--include/kmi/tcb.h16
2 files changed, 16 insertions, 7 deletions
diff --git a/include/arch/tcb.h b/include/arch/tcb.h
index 931b800..b8b0961 100644
--- a/include/arch/tcb.h
+++ b/include/arch/tcb.h
@@ -42,6 +42,13 @@ void setup_rpc_stack(struct tcb *t);
void destroy_rpc_stack(struct tcb *t);
/**
+ * Reset RPC stack to top.
+ *
+ * @param t Thread whose RPC stack should be reset.
+ */
+void reset_rpc_stack(struct tcb *t);
+
+/**
* @return Max size of one individual RPC stack instance.
*/
size_t max_rpc_size();
diff --git a/include/kmi/tcb.h b/include/kmi/tcb.h
index b7fd3d6..a06d801 100644
--- a/include/kmi/tcb.h
+++ b/include/kmi/tcb.h
@@ -122,18 +122,13 @@ struct tcb {
vm_t thread_stack;
/** Address of this thread's stack top. */
- vm_t thread_stack_top;
+ vm_t thread_stack_size;
/** Current address of usable rpc stack. */
vm_t rpc_stack;
- /** \todo Check if each thread should be allowed more than just one
- * region of thread local storage. */
- /** Possible thread local storage. */
- vm_t thread_storage;
-
/** Reference count to process. */
- atomic_int_fast32_t refcount;
+ long refcount;
/** Process context of thread. */
struct tcb_ctx proc;
@@ -322,6 +317,13 @@ struct tcb *get_tcb(id_t tid);
stat_t alloc_stack(struct tcb *t);
/**
+ * Free thread stack.
+ *
+ * @param t Thread whose stack to free.
+ */
+void free_stack(struct tcb *t);
+
+/**
* Set address to jump to when returning to userspace.
*
* @param t Thread return address to set.