From 4aad88265bede002cb3e8a01bc6a8581c3424f6e Mon Sep 17 00:00:00 2001 From: "kfraser@localhost.localdomain" Date: Wed, 15 Nov 2006 09:33:01 +0000 Subject: [MINIOS] Add timer support. Based on an original patch by Robert Kaiser. Signed-off-by: Grzegorz Milos --- extras/mini-os/kernel.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'extras/mini-os/kernel.c') 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; } -- cgit v1.2.3