aboutsummaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
Diffstat (limited to 'include')
-rw-r--r--include/kmi/attrs.h1
-rw-r--r--include/kmi/notify.h4
-rw-r--r--include/kmi/syscalls.h7
-rw-r--r--include/kmi/tcb.h2
-rw-r--r--include/kmi/uapi.h26
5 files changed, 14 insertions, 26 deletions
diff --git a/include/kmi/attrs.h b/include/kmi/attrs.h
index 56aca34..9038690 100644
--- a/include/kmi/attrs.h
+++ b/include/kmi/attrs.h
@@ -50,6 +50,7 @@
/** Don't inline function. */
#define __noinline __attribute__((noinline))
+/** Always inline function. */
#define __inline inline __attribute__((always_inline))
/** Function should not return. */
diff --git a/include/kmi/notify.h b/include/kmi/notify.h
index c0c5d8b..4e5b8b6 100644
--- a/include/kmi/notify.h
+++ b/include/kmi/notify.h
@@ -14,8 +14,8 @@
#include <kmi/tcb.h>
/**
- * Try to send a notification to a thread. Sets up a new rpc call, should be
- * returned from with \ref ipc_ghost() to restore register state.
+ * Try to send a notification to a thread. Sets up a new rpc call and sets
+ * notify flag of the frame to true.
*
* If the thread is idle, immediately swap to it.
*
diff --git a/include/kmi/syscalls.h b/include/kmi/syscalls.h
index e3d5dad..28e7505 100644
--- a/include/kmi/syscalls.h
+++ b/include/kmi/syscalls.h
@@ -102,11 +102,8 @@ enum sys_code {
/** IPC response from server. */
SYS_IPC_RESP,
- /** IPC return without visible side effects. */
- SYS_IPC_GHOST,
-
/** Notify thread, essentially interrupt or signal. */
- SYS_NOTIFY,
+ SYS_IPC_NOTIFY,
/** @} */
/** @name Process management. */
@@ -191,7 +188,7 @@ enum sys_user {
/** Which notifications have arrived. */
enum notify_flag {
- /** A signal (\ref sys_notify()). */
+ /** A signal (\ref sys_ipc_notify()). */
NOTIFY_SIGNAL = (1 << 0),
/** A timer has expired. */
diff --git a/include/kmi/tcb.h b/include/kmi/tcb.h
index a3f119b..6cc63b5 100644
--- a/include/kmi/tcb.h
+++ b/include/kmi/tcb.h
@@ -115,7 +115,7 @@ struct tcb {
/** Memory mapping data. Only relevant in root thread. */
struct uvmem uvmem;
- /** Address of callback function in servers. */
+ /** Address of callback function. */
vm_t callback;
/** Address of this thread's stack base. */
diff --git a/include/kmi/uapi.h b/include/kmi/uapi.h
index 95c7000..6e5f865 100644
--- a/include/kmi/uapi.h
+++ b/include/kmi/uapi.h
@@ -552,7 +552,13 @@ SYSCALL_DECLARE5(ipc_tail, pid, d0, d1, d2, d3);
SYSCALL_DECLARE5(ipc_kick, pid, d0, d1, d2, d3);
/**
- * Response syscall.
+ * Response syscall. If the current rpc frame is a notification frame, the
+ * arguments will be ignored, turned out to be easier to implement than try to
+ * enforce an ipc_ghost(), especially in cases where the root process has
+ * already been killed. Generally this shouldn't be an issue, as the
+ * notification handler is always aware of when it's being called to handle a
+ * notification, and can tailor its ipc_resp() to return zero arguments or
+ * whatever.
*
* @param t Current tcb.
* @param d0 First response argument.
@@ -566,22 +572,6 @@ SYSCALL_DECLARE5(ipc_kick, pid, d0, d1, d2, d3);
SYSCALL_DECLARE4(ipc_resp, d0, d1, d2, d3);
/**
- * Returns to caller but without changing any visible state. Primarily used when
- * returning from interrupt handlers, like notifications, timers or external
- * devices.
- *
- * @param t Current tcb.
- * @param a Unused.
- * @param b Unused.
- * @param c Unused.
- * @param d Unused.
- * @param e Unused.
- *
- * Return OK.
- */
-SYSCALL_DECLARE0(ipc_ghost);
-
-/**
* Notify thread syscall.
*
* @param t Current tcb.
@@ -593,7 +583,7 @@ SYSCALL_DECLARE0(ipc_ghost);
*
* Returns \ref OK and 0.
*/
-SYSCALL_DECLARE1(notify, tid);
+SYSCALL_DECLARE1(ipc_notify, tid);
/** @} */
/** @name Process handling syscalls. */