diff options
author | Robert Morris <rtm@nephron.lcs.mit.edu> | 2010-08-11 14:34:45 -0400 |
---|---|---|
committer | Robert Morris <rtm@nephron.lcs.mit.edu> | 2010-08-11 14:34:45 -0400 |
commit | 789b508d538e6faf635e49f268a4f1f9e9b65f05 (patch) | |
tree | 9515f6123cf72da77c7ebf0b4ac532c700dff30b /sysproc.c | |
parent | 83d2db91f75460e1275d67847adec0fca5a9800b (diff) | |
download | xv6-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.c | 16 |
1 files changed, 15 insertions, 1 deletions
@@ -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; +} |