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
Multiuser, Capabilities and Access Controls (#54)
[lunaix-os.git]
/
lunaix-os
/
kernel
/
process
/
sched.c
diff --git
a/lunaix-os/kernel/process/sched.c
b/lunaix-os/kernel/process/sched.c
index 945fc01bf6db0a8ae5edb1fcc48f867732fb3cbd..112741c553de299db541357d39baca3487d9f373 100644
(file)
--- a/
lunaix-os/kernel/process/sched.c
+++ b/
lunaix-os/kernel/process/sched.c
@@
-1,7
+1,7
@@
-#include <
sys
/abi.h>
-#include <
sys/m
m/mempart.h>
+#include <
asm
/abi.h>
+#include <
as
m/mempart.h>
-#include <
sys
/cpu.h>
+#include <
asm
/cpu.h>
#include <lunaix/fs/taskfs.h>
#include <lunaix/mm/cake.h>
#include <lunaix/fs/taskfs.h>
#include <lunaix/mm/cake.h>
@@
-20,13
+20,11
@@
#include <lunaix/hart_state.h>
#include <lunaix/kpreempt.h>
#include <lunaix/hart_state.h>
#include <lunaix/kpreempt.h>
-#include <lunaix/generic/isrm.h>
-
#include <klibc/string.h>
struct thread empty_thread_obj;
#include <klibc/string.h>
struct thread empty_thread_obj;
-volatile struct proc_info* __current;
+volatile struct proc_info* __current
= NULL
;
volatile struct thread* current_thread = &empty_thread_obj;
struct scheduler sched_ctx;
volatile struct thread* current_thread = &empty_thread_obj;
struct scheduler sched_ctx;
@@
-221,7
+219,6
@@
schedule()
sched_ctx.procs_index = to_check->process->pid;
done:
sched_ctx.procs_index = to_check->process->pid;
done:
- isrm_notify_eos(0);
run(to_check);
fail("unexpected return from scheduler");
run(to_check);
fail("unexpected return from scheduler");
@@
-346,7
+343,7
@@
get_free_pid() {
;
if (unlikely(i == MAX_PROCESS)) {
;
if (unlikely(i == MAX_PROCESS)) {
-
panick
("Panic in Ponyville shimmer!");
+
fail
("Panic in Ponyville shimmer!");
}
return i;
}
return i;
@@
-396,6
+393,8
@@
alloc_process()
proc->created = clock_systime();
proc->pgid = proc->pid;
proc->created = clock_systime();
proc->pgid = proc->pid;
+ proc->root = vfs_sysroot;
+
proc->sigreg = vzalloc(sizeof(struct sigregistry));
proc->fdtable = vzalloc(sizeof(struct v_fdtable));
proc->sigreg = vzalloc(sizeof(struct sigregistry));
proc->fdtable = vzalloc(sizeof(struct v_fdtable));
@@
-593,7
+592,7
@@
terminate_proccess(struct proc_info* proc, int exit_code) {
assert(!kernel_process(proc));
if (proc->pid == 1) {
assert(!kernel_process(proc));
if (proc->pid == 1) {
-
panick
("Attempt to kill init");
+
fail
("Attempt to kill init");
}
terminate_proc_only(proc, exit_code);
}
terminate_proc_only(proc, exit_code);