Annotation of funnyos/kern/kern_time.c, Revision 1.4
1.1 init 1: /*
1.4 ! nbrk 2: * $Id: kern_time.c,v 1.3 2007/11/24 20:55:53 nbrk Exp $
1.1 init 3: */
4: #include <sys/types.h>
5: #include <sys/kern_time.h>
1.2 nbrk 6: #include <sys/kern_sched.h>
7:
1.1 init 8: #include <libkern/printf.h>
9:
10: /*
11: * Kernel time-related stuff.
12: */
13:
14: struct rtcops sysrtcops = {NULL, NULL, NULL}; /* system will use this to control rtc hardware */
15: struct timedata systimedata;
16:
17:
18: void
19: sysclock_init(void)
20: {
21: /*
22: * Start system clock.
23: */
24: /* panic if driver haven't configured rtcops for us */
25: if (sysrtcops.ro_sethz == NULL)
26: panic("sysclock_init: clock init failed; can't find rtc driver entry points (sysrtcops is null)\n");
27:
28: /* configure hardware */
29: sysrtcops.ro_sethz(HZ);
30:
31: }
32:
33:
34: void
35: sysclock(void)
36: {
37: /*
38: * Process one system tick.
39: * RTC interrupt handler will call us; remember that we are in interrupt mode here.
40: */
41:
42: /* update time data */
43: systimedata.td_seconds = sysrtcops.ro_getsec();
44:
1.4 ! nbrk 45: #ifndef ARCH_SAM7S64
1.3 nbrk 46: /* kick scheduler */
1.2 nbrk 47: sched_tick();
1.3 nbrk 48: #else
1.4 ! nbrk 49: printf("sysclock! seconds=%d\n", systimedata.td_seconds);
1.3 nbrk 50: #endif /* not ARCH_SAM7S64 */
51:
1.1 init 52: }
53:
CVSweb