diff options
| author | Frans Kaashoek <kaashoek@mit.edu> | 2022-08-11 07:23:17 -0400 | 
|---|---|---|
| committer | Frans Kaashoek <kaashoek@mit.edu> | 2022-08-11 07:23:17 -0400 | 
| commit | 975f3b31d3fac2c271df3107263df6ae454a98be (patch) | |
| tree | 2bdd49745154445f12404aa7b2424ed5d86a5c13 /kernel/trap.c | |
| parent | 4087a6e7fc773ba4eb217dfc196dfe1eee84b25d (diff) | |
| download | xv6-labs-975f3b31d3fac2c271df3107263df6ae454a98be.tar.gz xv6-labs-975f3b31d3fac2c271df3107263df6ae454a98be.tar.bz2 xv6-labs-975f3b31d3fac2c271df3107263df6ae454a98be.zip | |
Clean up using killed()
Diffstat (limited to 'kernel/trap.c')
| -rw-r--r-- | kernel/trap.c | 4 | 
1 files changed, 2 insertions, 2 deletions
| diff --git a/kernel/trap.c b/kernel/trap.c index b879f01..f895aea 100644 --- a/kernel/trap.c +++ b/kernel/trap.c @@ -53,7 +53,7 @@ usertrap(void)    if(r_scause() == 8){      // system call -    if(__sync_add_and_fetch(&p->killed, 0)) +    if(killed(p))        exit(-1);      // sepc points to the ecall instruction, @@ -73,7 +73,7 @@ usertrap(void)      __sync_bool_compare_and_swap(&p->killed, 0, 1);    } -  if(__sync_add_and_fetch(&p->killed, 0)) +  if(killed(p))      exit(-1);    // give up the CPU if this is a timer interrupt. | 
