aboutsummaryrefslogtreecommitdiff
path: root/kernel/proc
diff options
context:
space:
mode:
Diffstat (limited to 'kernel/proc')
-rw-r--r--kernel/proc/fork.c2
-rw-r--r--kernel/proc/kthread.c14
-rw-r--r--kernel/proc/proc.c14
-rw-r--r--kernel/proc/sched.c23
4 files changed, 0 insertions, 53 deletions
diff --git a/kernel/proc/fork.c b/kernel/proc/fork.c
index a6436ba..cd54a7c 100644
--- a/kernel/proc/fork.c
+++ b/kernel/proc/fork.c
@@ -57,8 +57,6 @@ static uintptr_t fork_setup_stack(const regs_t *regs, void *kstack)
*/
long do_fork(struct regs *regs)
{
- // NOT_YET_IMPLEMENTED("VM: do_fork");
-
// Create a new process
proc_t *child_proc = proc_create("cf");
if (child_proc == NULL)
diff --git a/kernel/proc/kthread.c b/kernel/proc/kthread.c
index b837721..775be6b 100644
--- a/kernel/proc/kthread.c
+++ b/kernel/proc/kthread.c
@@ -68,9 +68,6 @@ void kthread_init()
kthread_t *kthread_create(proc_t *proc, kthread_func_t func, long arg1,
void *arg2)
{
- // NOT_YET_IMPLEMENTED("PROCS: kthread_create");
- dbg(DBG_THR, "ATTEMPT to create a new thread with proc name=%s, id=%d\n", proc->p_name, proc->p_pid);
-
kthread_t *new_thread = slab_obj_alloc(kthread_allocator);
if (new_thread == NULL)
{
@@ -102,8 +99,6 @@ kthread_t *kthread_create(proc_t *proc, kthread_func_t func, long arg1,
// put this thread on the process's thread list
list_insert_tail(&proc->p_threads, &new_thread->kt_plink);
- dbg(DBG_THR, "SUCCESFULLY created a new THREAD with proc name=%s, id=%d\n", proc->p_name, proc->p_pid);
-
return new_thread;
}
@@ -121,8 +116,6 @@ kthread_t *kthread_create(proc_t *proc, kthread_func_t func, long arg1,
*/
kthread_t *kthread_clone(kthread_t *thr)
{
- // NOT_YET_IMPLEMENTED("VM: kthread_clone");
-
kthread_t *new_thread = slab_obj_alloc(kthread_allocator);
if (new_thread == NULL)
{
@@ -197,12 +190,8 @@ void kthread_destroy(kthread_t *thr)
*/
void kthread_cancel(kthread_t *thr, void *retval)
{
- // NOT_YET_IMPLEMENTED("PROCS: kthread_cancel");
KASSERT(thr != curthr);
- // ask about the use of check_curthr_cancelled() in syscall_handler()
- dbg(DBG_THR, "Cancelling thread with proc name=%s, id=%d, status=%d\n",
- thr->kt_proc->p_name, thr->kt_proc->p_pid, (int) retval);
thr->kt_retval = (void *)retval;
sched_cancel(thr);
}
@@ -212,8 +201,5 @@ void kthread_cancel(kthread_t *thr, void *retval)
*/
void kthread_exit(void *retval)
{
- // NOT_YET_IMPLEMENTED("PROCS: kthread_exit");
- dbg(DBG_THR, "Exiting thread with proc name=%s, id=%d, status=%d\n",
- curthr->kt_proc->p_name, curthr->kt_proc->p_pid, (int) retval);
proc_thread_exiting(retval);
}
diff --git a/kernel/proc/proc.c b/kernel/proc/proc.c
index 199d015..3bba06b 100644
--- a/kernel/proc/proc.c
+++ b/kernel/proc/proc.c
@@ -174,7 +174,6 @@ proc_t *proc_lookup(pid_t pid)
*/
proc_t *proc_create(const char *name)
{
- // NOT_YET_IMPLEMENTED("PROCS: proc_create");
int proc_pid = _proc_getid();
if (proc_pid == -1)
{
@@ -279,9 +278,6 @@ proc_t *proc_create(const char *name)
*/
void proc_cleanup(long status)
{
- // NOT_YET_IMPLEMENTED("PROCS: proc_cleanup");
- dbg(DBG_PROC, "proc_cleanup called on proc with pid=%d with exit status=%d\n", curproc->p_pid, status);
-
curproc->p_state = PROC_DEAD;
// update state and status
@@ -339,8 +335,6 @@ void proc_cleanup(long status)
*/
void proc_thread_exiting(void *retval)
{
- // NOT_YET_IMPLEMENTED("PROCS: proc_thread_exiting");
-
proc_cleanup((long)retval);
curthr->kt_state = KT_EXITED;
@@ -357,7 +351,6 @@ void proc_thread_exiting(void *retval)
*/
void proc_kill(proc_t *proc, long status)
{
- // NOT_YET_IMPLEMENTED("PROCS: proc_kill");
KASSERT(proc != curproc && "proc_kill called on curproc");
list_iterate(&proc->p_threads, thr, kthread_t, kt_plink)
{
@@ -376,7 +369,6 @@ void proc_kill(proc_t *proc, long status)
*/
void proc_kill_all()
{
- // NOT_YET_IMPLEMENTED("PROCS: proc_kill_all");
list_iterate(&proc_list, p, proc_t, p_list_link)
{
if (
@@ -467,8 +459,6 @@ void proc_destroy(proc_t *proc)
*/
pid_t do_waitpid(pid_t pid, int *status, int options)
{
- // NOT_YET_IMPLEMENTED("PROCS: do_waitpid");
-
if (pid == 0 || options != 0 || pid < -1)
{
return -ENOTSUP;
@@ -545,10 +535,6 @@ pid_t do_waitpid(pid_t pid, int *status, int options)
*/
void do_exit(long status)
{
- // NOT_YET_IMPLEMENTED("PROCS: do_exit");
-
- dbg(DBG_PROC, "proc exiting with pid=%d and status=%ld\n", curproc->p_pid, status);
-
kthread_exit((void *)status);
}
diff --git a/kernel/proc/sched.c b/kernel/proc/sched.c
index b422ef1..98af80d 100644
--- a/kernel/proc/sched.c
+++ b/kernel/proc/sched.c
@@ -162,8 +162,6 @@ void sched_init(void)
*/
long sched_cancellable_sleep_on(ktqueue_t *queue)
{
- // NOT_YET_IMPLEMENTED("PROCS: sched_cancellable_sleep_on");
-
KASSERT(queue != NULL);
if (curthr->kt_cancelled)
@@ -190,8 +188,6 @@ long sched_cancellable_sleep_on(ktqueue_t *queue)
*/
void sched_cancel(kthread_t *thr)
{
- // NOT_YET_IMPLEMENTED("PROCS: sched_cancel");
-
thr->kt_cancelled = 1;
if (thr->kt_state == KT_SLEEP_CANCELLABLE)
@@ -234,9 +230,6 @@ void sched_cancel(kthread_t *thr)
*/
void sched_switch(ktqueue_t *queue)
{
- // NOT_YET_IMPLEMENTED("PROCS: sched_switch");
-
- // KASSERT(intr_getipl == IPL_HIGH);
intr_disable();
int oldIPL = intr_setipl(IPL_LOW); // allow interrupts to wake up the idling core
@@ -274,16 +267,6 @@ void sched_yield()
*/
void sched_make_runnable(kthread_t *thr)
{
- // NOT_YET_IMPLEMENTED("PROCS: sched_make_runnable");
-
- dbg(DBG_SCHED, "Making thread with proc pid %d runnable\n in thread\n", thr->kt_proc->p_pid);
- if (curthr)
- {
- dbg(DBG_SCHED, "I did this ^^ with thread %d\n", curthr->kt_proc->p_pid);
- } else {
- dbg(DBG_SCHED, "I did this ^^ with a null thread!\n");
- }
-
KASSERT(thr != curthr);
KASSERT(thr->kt_state != KT_RUNNABLE);
@@ -309,8 +292,6 @@ void sched_make_runnable(kthread_t *thr)
*/
void sched_sleep_on(ktqueue_t *q)
{
- // NOT_YET_IMPLEMENTED("PROCS: sched_sleep_on");
-
int oldIPL = intr_setipl(IPL_HIGH);
curthr->kt_state = KT_SLEEP;
sched_switch(q);
@@ -330,8 +311,6 @@ void sched_sleep_on(ktqueue_t *q)
*/
void sched_wakeup_on(ktqueue_t *q, kthread_t **ktp)
{
- // NOT_YET_IMPLEMENTED("PROCS: sched_wakeup_on");
-
if (sched_queue_empty(q) || q == NULL)
{
if (ktp)
@@ -357,8 +336,6 @@ void sched_wakeup_on(ktqueue_t *q, kthread_t **ktp)
*/
void sched_broadcast_on(ktqueue_t *q)
{
- // NOT_YET_IMPLEMENTED("PROCS: sched_broadcast_on");
-
while (!sched_queue_empty(q))
{
sched_make_runnable(ktqueue_dequeue(q));