aboutsummaryrefslogtreecommitdiff
path: root/kernel/features
diff options
context:
space:
mode:
authorMarvin Borner2020-08-22 01:26:54 +0200
committerMarvin Borner2020-08-22 01:26:54 +0200
commitcd6b20886ad80112c1589bdabd46e39b1876a162 (patch)
tree0b77be24e5e240d4af810020d68c2de892846b24 /kernel/features
parent45db1523a02730a172564ca8c2be55422d5d2f0b (diff)
Small fixes
Diffstat (limited to 'kernel/features')
-rw-r--r--kernel/features/event.c2
-rw-r--r--kernel/features/proc.c4
2 files changed, 6 insertions, 0 deletions
diff --git a/kernel/features/event.c b/kernel/features/event.c
index 8a2c904..9bcce6d 100644
--- a/kernel/features/event.c
+++ b/kernel/features/event.c
@@ -13,6 +13,7 @@ struct list *event_table[] = { [EVENT_KEYBOARD] = NULL, [EVENT_MOUSE] = NULL };
u32 event_map(enum event id, struct proc *proc, u32 *func)
{
assert(id < sizeof(event_table) / sizeof(*event_table));
+ assert(func);
if (event_table[id] == NULL)
event_table[id] = (struct list *)list_new();
@@ -33,6 +34,7 @@ u32 event_map(enum event id, struct proc *proc, u32 *func)
void event_unmap(enum event id, struct proc *proc, u32 *func)
{
assert(id < sizeof(event_table) / sizeof(*event_table));
+ assert(func);
struct list *list = ((struct list *)event_table[id]);
diff --git a/kernel/features/proc.c b/kernel/features/proc.c
index e4219b0..a56a0c4 100644
--- a/kernel/features/proc.c
+++ b/kernel/features/proc.c
@@ -84,6 +84,7 @@ struct proc *proc_current()
void proc_exit(struct proc *proc, int status)
{
+ assert(proc);
printf("Process %d exited with status %d\n", proc->pid, status);
proc->state = status == 0 ? PROC_ASLEEP : PROC_ERROR;
@@ -94,6 +95,9 @@ void proc_exit(struct proc *proc, int status)
break;
}
} while ((iterator = iterator->next) != NULL);
+
+ sti();
+ hlt();
}
struct proc *proc_make()