summaryrefslogtreecommitdiff
path: root/sys/src/9/port/fault.c
diff options
context:
space:
mode:
authorcinap_lenrek <cinap_lenrek@felloff.net>2014-06-05 21:54:32 +0200
committercinap_lenrek <cinap_lenrek@felloff.net>2014-06-05 21:54:32 +0200
commit91614f582fb1504ae3be2d57c079f24b60d71613 (patch)
tree47382b0ee5f71cccc75f1e08f8ef7ff9e216765e /sys/src/9/port/fault.c
parent76db435e3cf86e0a6eb750d789bc15b64027a379 (diff)
kernel: dont use atomic increment for Proc.nlocks, maintain Lock.m for lock(), use uintptr intstead of long for pc values
change Proc.nlocks from Ref to int and just use normal increment and decrelemt as done in erik quanstros 9atom. It is not clear why we used atomic increment in the fist place as even if we get preempted by interrupt and scheduled before we write back the incremented value, it shouldnt be a problem and we'll just continue where we left off as our process is the only one that can write to it. Yoann Padioleau found that the Mach pointer Lock.m wasnt maintained consistently for lock() vs canlock() and ilock(). Fixed. Use uintptr instead of ulong for maxlockpc, maxilockpc and ilockpc debug variables.
Diffstat (limited to 'sys/src/9/port/fault.c')
-rw-r--r--sys/src/9/port/fault.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/sys/src/9/port/fault.c b/sys/src/9/port/fault.c
index 3d4530401..fa836b641 100644
--- a/sys/src/9/port/fault.c
+++ b/sys/src/9/port/fault.c
@@ -14,10 +14,10 @@ fault(uintptr addr, int read)
if(up == nil)
panic("fault: nil up");
- if(up->nlocks.ref){
+ if(up->nlocks){
Lock *l = up->lastlock;
- print("fault: nlocks %ld, proc %lud %s, addr %#p, lock %#p, lpc %#p\n",
- up->nlocks.ref, up->pid, up->text, addr, l, l ? l->pc : 0);
+ print("fault: nlocks %d, proc %lud %s, addr %#p, lock %#p, lpc %#p\n",
+ up->nlocks, up->pid, up->text, addr, l, l ? l->pc : 0);
}
pnd = up->notepending;