git://scm.lunaixsky.com
/
lunaix-os.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge branch 'signal-dev'
[lunaix-os.git]
/
lunaix-os
/
kernel
/
signal.c
diff --git
a/lunaix-os/kernel/signal.c
b/lunaix-os/kernel/signal.c
index 49f1e534f6c65d06c4d0ba916847867e66cc491c..80a709831627f014aac41320b972e17b6b09b038 100644
(file)
--- a/
lunaix-os/kernel/signal.c
+++ b/
lunaix-os/kernel/signal.c
@@
-1,6
+1,7
@@
#include <lunaix/process.h>
#include <lunaix/sched.h>
#include <lunaix/signal.h>
#include <lunaix/process.h>
#include <lunaix/sched.h>
#include <lunaix/signal.h>
+#include <lunaix/status.h>
#include <lunaix/syscall.h>
extern struct scheduler sched_ctx; /* kernel/sched.c */
#include <lunaix/syscall.h>
extern struct scheduler sched_ctx; /* kernel/sched.c */
@@
-62,6
+63,7
@@
__DEFINE_LXSYSCALL1(int, sigreturn, struct proc_sig, *sig_ctx)
{
__current->intr_ctx = sig_ctx->prev_context;
__current->sig_mask &= ~__SIGNAL(sig_ctx->sig_num);
{
__current->intr_ctx = sig_ctx->prev_context;
__current->sig_mask &= ~__SIGNAL(sig_ctx->sig_num);
+ __current->flags &= ~PROC_FINPAUSE;
schedule();
}
schedule();
}
@@
-101,4
+103,17
@@
__DEFINE_LXSYSCALL2(int, signal, int, signum, sighandler_t, handler)
__current->sig_handler[signum] = (void*)handler;
return 0;
__current->sig_handler[signum] = (void*)handler;
return 0;
+}
+
+__DEFINE_LXSYSCALL(int, pause)
+{
+ __current->flags |= PROC_FINPAUSE;
+
+ __SYSCALL_INTERRUPTIBLE({
+ while ((__current->flags & PROC_FINPAUSE)) {
+ sched_yield();
+ }
+ })
+ __current->k_status = EINTR;
+ return -1;
}
\ No newline at end of file
}
\ No newline at end of file