summaryrefslogtreecommitdiff
path: root/sysproc.c
diff options
context:
space:
mode:
authorRobert Morris <[email protected]>2010-08-11 14:34:45 -0400
committerRobert Morris <[email protected]>2010-08-11 14:34:45 -0400
commit789b508d538e6faf635e49f268a4f1f9e9b65f05 (patch)
tree9515f6123cf72da77c7ebf0b4ac532c700dff30b /sysproc.c
parent83d2db91f75460e1275d67847adec0fca5a9800b (diff)
downloadxv6-labs-789b508d538e6faf635e49f268a4f1f9e9b65f05.tar.gz
xv6-labs-789b508d538e6faf635e49f268a4f1f9e9b65f05.tar.bz2
xv6-labs-789b508d538e6faf635e49f268a4f1f9e9b65f05.zip
uptime() sys call for benchmarking
increase PHYSTOP
Diffstat (limited to 'sysproc.c')
-rw-r--r--sysproc.c16
1 files changed, 15 insertions, 1 deletions
diff --git a/sysproc.c b/sysproc.c
index 11770ff..efaa372 100644
--- a/sysproc.c
+++ b/sysproc.c
@@ -57,7 +57,8 @@ sys_sbrk(void)
int
sys_sleep(void)
{
- int n, ticks0;
+ int n;
+ uint ticks0;
if(argint(0, &n) < 0)
return -1;
@@ -73,3 +74,16 @@ sys_sleep(void)
release(&tickslock);
return 0;
}
+
+// return how many clock tick interrupts have occurred
+// since boot.
+int
+sys_uptime(void)
+{
+ uint xticks;
+
+ acquire(&tickslock);
+ xticks = ticks;
+ release(&tickslock);
+ return xticks;
+}