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
refactor: add user space printf.
[lunaix-os.git]
/
lunaix-os
/
kernel
/
sched.c
diff --git
a/lunaix-os/kernel/sched.c
b/lunaix-os/kernel/sched.c
index 4a0e254151799fdc6fc32674a36172c890be16c7..2274238061df347181a092c2008b560d2af46ddf 100644
(file)
--- a/
lunaix-os/kernel/sched.c
+++ b/
lunaix-os/kernel/sched.c
@@
-94,7
+94,7
@@
check_sleepers()
if (wtime && now >= wtime) {
pos->sleep.wakeup_time = 0;
if (wtime && now >= wtime) {
pos->sleep.wakeup_time = 0;
- pos->state = PS_
STOPPED
;
+ pos->state = PS_
READY
;
}
if (atime && now >= atime) {
}
if (atime && now >= atime) {
@@
-123,7
+123,7
@@
schedule()
int ptr = prev_ptr;
if (!(__current->state & ~PS_RUNNING)) {
int ptr = prev_ptr;
if (!(__current->state & ~PS_RUNNING)) {
- __current->state = PS_
STOPPED
;
+ __current->state = PS_
READY
;
}
check_sleepers();
}
check_sleepers();
@@
-133,7
+133,7
@@
redo:
do {
ptr = (ptr + 1) % sched_ctx.ptable_len;
next = &sched_ctx._procs[ptr];
do {
ptr = (ptr + 1) % sched_ctx.ptable_len;
next = &sched_ctx._procs[ptr];
- } while (next->state != PS_
STOPPED
&& ptr != prev_ptr);
+ } while (next->state != PS_
READY
&& ptr != prev_ptr);
sched_ctx.procs_index = ptr;
sched_ctx.procs_index = ptr;
@@
-148,6
+148,7
@@
redo:
void
sched_yieldk()
{
void
sched_yieldk()
{
+ cpu_enable_interrupt();
cpu_int(LUNAIX_SCHED);
}
cpu_int(LUNAIX_SCHED);
}
@@
-233,7
+234,7
@@
repeat:
status_flags |= PEXITTERM;
goto done;
}
status_flags |= PEXITTERM;
goto done;
}
- if (proc->state == PS_
STOPPED
&& (options & WUNTRACED)) {
+ if (proc->state == PS_
READY
&& (options & WUNTRACED)) {
status_flags |= PEXITSTOP;
goto done;
}
status_flags |= PEXITSTOP;
goto done;
}
@@
-279,10
+280,11
@@
alloc_process()
proc->pgid = proc->pid;
proc->fdtable = vzalloc(sizeof(struct v_fdtable));
proc->pgid = proc->pid;
proc->fdtable = vzalloc(sizeof(struct v_fdtable));
- llist_init_head(&proc->mm.regions);
+ llist_init_head(&proc->mm.regions
.head
);
llist_init_head(&proc->children);
llist_init_head(&proc->grp_member);
llist_init_head(&proc->sleep.sleepers);
llist_init_head(&proc->children);
llist_init_head(&proc->grp_member);
llist_init_head(&proc->sleep.sleepers);
+ waitq_init(&proc->waitqueue);
return proc;
}
return proc;
}
@@
-304,7
+306,7
@@
commit_process(struct proc_info* process)
llist_append(&process->parent->children, &process->siblings);
llist_append(&process->parent->children, &process->siblings);
- process->state = PS_
STOPPED
;
+ process->state = PS_
READY
;
}
// from <kernel/process.c>
}
// from <kernel/process.c>