summaryrefslogtreecommitdiff
path: root/sysproc.c
diff options
context:
space:
mode:
authorFrans Kaashoek <[email protected]>2010-08-26 08:03:18 -0400
committerFrans Kaashoek <[email protected]>2010-08-26 08:03:18 -0400
commitd55b2fac074ac23e30c337014f40ae2156b31b60 (patch)
treebb9885972bf8929e7957f9ea512a8befaf06b11c /sysproc.c
parentd87f51c5a1c5e7a2a3ba111b1052a297f4f96fb0 (diff)
parent789b508d538e6faf635e49f268a4f1f9e9b65f05 (diff)
downloadxv6-labs-d55b2fac074ac23e30c337014f40ae2156b31b60.tar.gz
xv6-labs-d55b2fac074ac23e30c337014f40ae2156b31b60.tar.bz2
xv6-labs-d55b2fac074ac23e30c337014f40ae2156b31b60.zip
Merge commit 'origin/page' into page
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;
+}