aboutsummaryrefslogtreecommitdiffstats
path: root/extras/mini-os/kernel.c
diff options
context:
space:
mode:
authorkfraser@localhost.localdomain <kfraser@localhost.localdomain>2006-11-15 09:33:01 +0000
committerkfraser@localhost.localdomain <kfraser@localhost.localdomain>2006-11-15 09:33:01 +0000
commit4aad88265bede002cb3e8a01bc6a8581c3424f6e (patch)
tree509157021cc7617217339f9d2a293dec3796d4cc /extras/mini-os/kernel.c
parenta4be7b6267be611349c5282363e00ae2847fc0ab (diff)
downloadxen-4aad88265bede002cb3e8a01bc6a8581c3424f6e.tar.gz
xen-4aad88265bede002cb3e8a01bc6a8581c3424f6e.tar.bz2
xen-4aad88265bede002cb3e8a01bc6a8581c3424f6e.zip
[MINIOS] Add timer support.
Based on an original patch by Robert Kaiser. Signed-off-by: Grzegorz Milos <gm281@cam.ac.uk>
Diffstat (limited to 'extras/mini-os/kernel.c')
-rw-r--r--extras/mini-os/kernel.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/extras/mini-os/kernel.c b/extras/mini-os/kernel.c
index 17ccbad914..72fc65ae1e 100644
--- a/extras/mini-os/kernel.c
+++ b/extras/mini-os/kernel.c
@@ -6,6 +6,7 @@
*
* Copyright (c) 2002-2003, K A Fraser & R Neugebauer
* Copyright (c) 2005, Grzegorz Milos, Intel Research Cambridge
+ * Copyright (c) 2006, Robert Kaiser, FH Wiesbaden
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to
@@ -66,11 +67,24 @@ void xenbus_tester(void *p)
/* test_xenbus(); */
}
+void periodic_thread(void *p)
+{
+ struct timeval tv;
+ printk("Periodic thread started.\n");
+ for(;;)
+ {
+ gettimeofday(&tv);
+ printk("T(s=%ld us=%ld)\n", tv.tv_sec, tv.tv_usec);
+ sleep(1000);
+ }
+}
+
/* This should be overridden by the application we are linked against. */
__attribute__((weak)) int app_main(start_info_t *si)
{
printk("Dummy main: start_info=%p\n", si);
create_thread("xenbus_tester", xenbus_tester, si);
+ create_thread("periodic_thread", periodic_thread, si);
return 0;
}