summaryrefslogtreecommitdiff
path: root/i386/i386at/rtc.c
diff options
context:
space:
mode:
Diffstat (limited to 'i386/i386at/rtc.c')
-rw-r--r--i386/i386at/rtc.c19
1 files changed, 8 insertions, 11 deletions
diff --git a/i386/i386at/rtc.c b/i386/i386at/rtc.c
index d771df8e..1930beb0 100644
--- a/i386/i386at/rtc.c
+++ b/i386/i386at/rtc.c
@@ -47,7 +47,6 @@ WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
#include <sys/types.h>
-#include <sys/time.h>
#include <kern/mach_clock.h>
#include <kern/printf.h>
#include <i386/machspl.h>
@@ -60,7 +59,7 @@ WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
static boolean_t first_rtcopen_ever = TRUE;
-void
+static void
rtcinit(void)
{
outb(RTC_ADDR, RTC_A);
@@ -70,7 +69,7 @@ rtcinit(void)
}
-int
+static int
rtcget(struct rtc_st *st)
{
unsigned char *regs = (unsigned char *)st;
@@ -87,7 +86,7 @@ rtcget(struct rtc_st *st)
return(0);
}
-void
+static void
rtcput(struct rtc_st *st)
{
unsigned char *regs = (unsigned char *)st;
@@ -107,11 +106,9 @@ rtcput(struct rtc_st *st)
}
-extern struct timeval time;
-
static int month[12] = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};
-int
+static int
yeartoday(int year)
{
if (year%4)
@@ -134,13 +131,13 @@ yeartoday(int year)
return 366;
}
-int
+static int
hexdectodec(char n)
{
return(((n>>4)&0x0F)*10 + (n&0x0F));
}
-char
+static char
dectohexdec(int n)
{
return((char)(((n/10)<<4)&0xF0) | ((n%10)&0x0F));
@@ -213,13 +210,13 @@ writetodc(void)
splx(ospl);
diff = 0;
- n = (time.tv_sec - diff) % (3600 * 24); /* hrs+mins+secs */
+ n = (time.seconds - diff) % (3600 * 24); /* hrs+mins+secs */
rtclk.rtc_sec = dectohexdec(n%60);
n /= 60;
rtclk.rtc_min = dectohexdec(n%60);
rtclk.rtc_hr = dectohexdec(n/60);
- n = (time.tv_sec - diff) / (3600 * 24); /* days */
+ n = (time.seconds - diff) / (3600 * 24); /* days */
rtclk.rtc_dow = (n + 4) % 7; /* 1/1/70 is Thursday */
/* Epoch shall be 1970 January 1st */