Have abort_sysc() take a uintptr_t instead of a struct sysc pointer The struct sysc pointer is not dereferenced. By making it a uintptr_t, it is more clear that the value is used as a number, not a pointer. abort_sysc() uses it for a pointer equality check. Signed-off-by: Barret Rhoden <brho@cs.berkeley.edu>
diff --git a/kern/include/kthread.h b/kern/include/kthread.h index 8581d5b..c33e385 100644 --- a/kern/include/kthread.h +++ b/kern/include/kthread.h
@@ -175,7 +175,7 @@ void cv_signal_irqsave(struct cond_var *cv, int8_t *irq_state); void cv_broadcast_irqsave(struct cond_var *cv, int8_t *irq_state); -bool abort_sysc(struct proc *p, struct syscall *sysc); +bool abort_sysc(struct proc *p, uintptr_t sysc); void abort_all_sysc(struct proc *p); int abort_all_sysc_fd(struct proc *p, int fd); void __reg_abortable_cv(struct cv_lookup_elm *cle, struct cond_var *cv);
diff --git a/kern/src/kthread.c b/kern/src/kthread.c index 4a9111b..394a9ba 100644 --- a/kern/src/kthread.c +++ b/kern/src/kthread.c
@@ -901,7 +901,7 @@ * - if you sleep, you're on the list * - if you are on the list or abort_in_progress is set, CV is signallable, and * all the memory for CLE is safe */ -bool abort_sysc(struct proc *p, struct syscall *sysc) +bool abort_sysc(struct proc *p, uintptr_t sysc) { ERRSTACK(1); struct cv_lookup_elm *cle; @@ -909,7 +909,7 @@ spin_lock_irqsave(&p->abort_list_lock); TAILQ_FOREACH(cle, &p->abortable_sleepers, link) { - if (cle->sysc == sysc) { + if ((uintptr_t)cle->sysc == sysc) { /* Note: we could have multiple aborters, so we need to use a * numeric refcnt instead of a flag. */ atomic_inc(&cle->abort_in_progress);
diff --git a/kern/src/syscall.c b/kern/src/syscall.c index 677408a..b75dc66 100644 --- a/kern/src/syscall.c +++ b/kern/src/syscall.c
@@ -1676,7 +1676,7 @@ static int sys_abort_sysc(struct proc *p, struct syscall *sysc) { - return abort_sysc(p, sysc); + return abort_sysc(p, (uintptr_t)sysc); } static int sys_abort_sysc_fd(struct proc *p, int fd)