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