kern
diff src/rtc.c @ 37:2c401f69128e
finished with the klibc/time.c stuff
author | John Tsiombikas <nuclear@member.fsf.org> |
---|---|
date | Fri, 10 Jun 2011 19:54:47 +0300 |
parents | e70b1ab9613e |
children | 710739e33da8 |
line diff
1.1 --- a/src/rtc.c Fri Jun 10 05:33:38 2011 +0300 1.2 +++ b/src/rtc.c Fri Jun 10 19:54:47 2011 +0300 1.3 @@ -1,6 +1,7 @@ 1.4 #include <stdio.h> 1.5 #include <time.h> 1.6 #include <asmops.h> 1.7 +#include "rtc.h" 1.8 1.9 /* CMOS I/O ports */ 1.10 #define PORT_CTL 0x70 1.11 @@ -33,18 +34,18 @@ 1.12 static void read_rtc(struct tm *tm); 1.13 static int read_reg(int reg); 1.14 1.15 -static unsigned long start_time; 1.16 - 1.17 1.18 void init_rtc(void) 1.19 { 1.20 struct tm tm; 1.21 1.22 read_rtc(&tm); 1.23 + start_time = mktime(&tm); 1.24 + 1.25 printf("System real-time clock: %s", asctime(&tm)); 1.26 - printf("time_t: %ld\n", mktime(&tm)); 1.27 } 1.28 1.29 + 1.30 static void read_rtc(struct tm *tm) 1.31 { 1.32 int statb, pm;