diff options
author | Frans Kaashoek <[email protected]> | 2019-07-02 09:14:47 -0400 |
---|---|---|
committer | Frans Kaashoek <[email protected]> | 2019-07-02 09:14:47 -0400 |
commit | 67702cf706bce7adef472f0caa48d81ddfaeb33a (patch) | |
tree | fd61e4036c4f5ec0944c987a7dffc9c04422d8c6 /kernel/syscall.c | |
parent | 535ac52efadc5c5cdb0483ad55c306cfaff71d50 (diff) | |
download | xv6-labs-67702cf706bce7adef472f0caa48d81ddfaeb33a.tar.gz xv6-labs-67702cf706bce7adef472f0caa48d81ddfaeb33a.tar.bz2 xv6-labs-67702cf706bce7adef472f0caa48d81ddfaeb33a.zip |
Checkpoint switching to per-process locks, in attempt clarify xv6's
locking plan, which is a difficult to understand because ptable lock
protects many invariants. This implementation has a bug: once in a
while xv6 unlocks a proc lock that is locked by another core.
Diffstat (limited to 'kernel/syscall.c')
-rw-r--r-- | kernel/syscall.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/kernel/syscall.c b/kernel/syscall.c index ca34f2c..8e9d51c 100644 --- a/kernel/syscall.c +++ b/kernel/syscall.c @@ -2,6 +2,7 @@ #include "param.h" #include "memlayout.h" #include "riscv.h" +#include "spinlock.h" #include "proc.h" #include "syscall.h" #include "defs.h" @@ -170,7 +171,9 @@ dosyscall(void) num = p->tf->a7; if(num > 0 && num < NELEM(syscalls) && syscalls[num]) { + //printf("%d: syscall %d\n", p->pid, num); p->tf->a0 = syscalls[num](); + //printf("%d: syscall %d -> %d\n", p->pid, num, p->tf->a0); } else { printf("%d %s: unknown sys call %d\n", p->pid, p->name, num); |