aboutsummaryrefslogtreecommitdiff
path: root/include/apos
diff options
context:
space:
mode:
authorKimplul <kimi.h.kuparinen@gmail.com>2022-11-13 17:16:28 +0200
committerKimplul <kimi.h.kuparinen@gmail.com>2022-11-13 17:16:28 +0200
commit1a0188fac0c0f265c4495b83592389b8b3645462 (patch)
treec1687724dd7f7ccf6d9d0d134c2766f14d3e39f5 /include/apos
parente6dc962ef7758c438039d7f8ac7e2bf3ebcb5c10 (diff)
downloadkmi-1a0188fac0c0f265c4495b83592389b8b3645462.tar.gz
kmi-1a0188fac0c0f265c4495b83592389b8b3645462.zip
outline rpc stack handling
Diffstat (limited to 'include/apos')
-rw-r--r--include/apos/caps.h5
-rw-r--r--include/apos/conf.h14
-rw-r--r--include/apos/tcb.h8
3 files changed, 26 insertions, 1 deletions
diff --git a/include/apos/caps.h b/include/apos/caps.h
index be64663..e762d0f 100644
--- a/include/apos/caps.h
+++ b/include/apos/caps.h
@@ -20,7 +20,7 @@ enum {
/** Thread is allowed to set capabilities of other threads. */
CAP_CAPS = (1 << 0),
- /** Thread is allowed to modify process statuses, exec/fork/etc. */
+ /** Thread is allowed to modify process statuses, create/exec/fork/etc. */
CAP_PROC = (1 << 1),
/** Thread is allowed to force interrupt to callback in other thread. */
@@ -28,6 +28,9 @@ enum {
/** Thread is allowed to shut down system. */
CAP_POWER = (1 << 3),
+
+ /** Thread is allowed to access configuration parameters. */
+ CAP_CONF = (1 << 4),
};
/**
diff --git a/include/apos/conf.h b/include/apos/conf.h
index 467b1e3..33fa8e5 100644
--- a/include/apos/conf.h
+++ b/include/apos/conf.h
@@ -23,10 +23,24 @@ extern size_t __thread_stack_size;
/**
* Provides access to the runtime global parameter.
+ * Must be at most RPC_STACK_TOP - RPC_STACK_BASE.
+ *
* \see __thread_stack_size.
* \global
* \todo This should probably also be a function instead.
*/
extern size_t __call_stack_size;
+/**
+ * Provides access to the runtime global parameter. This sets the maximum size
+ * a single rpc stack instance can be.
+ *
+ * Must be at most a fourth of \ref __call_stack_size?
+ * (that way we can maybe pretty quickly check that we're running out of memory
+ * for stack stuff and can return an error about it)
+ *
+ * \global
+ */
+extern size_t __rpc_stack_size;
+
#endif /* APOS_CONF_H */
diff --git a/include/apos/tcb.h b/include/apos/tcb.h
index 6097153..981f352 100644
--- a/include/apos/tcb.h
+++ b/include/apos/tcb.h
@@ -389,4 +389,12 @@ void save_context(struct tcb *t);
*/
void load_context(struct tcb *t);
+/**
+ * Check that we have enough rpc stack.
+ *
+ * @param t Thread whose rpc stack to check.
+ * @return \ref true if we have enough, \ref false otherwise.
+ */
+bool enough_rpc_stack(struct tcb *t);
+
#endif /* APOS_TCB_H */