Subject: port-macppc/10949: RTC_OFFSET not used on macppc
To: None <gnats-bugs@gnats.netbsd.org>
From: None <matthieu.herrb@wanadoo.fr>
List: netbsd-bugs
Date: 09/04/2000 15:05:17
>Number:         10949
>Category:       port-macppc
>Synopsis:       options RTC_OFFSET not used on macppc
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    port-macppc-maintainer
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Mon Sep 04 15:06:00 PDT 2000
>Closed-Date:
>Last-Modified:
>Originator:     Matthieu Herrb
>Release:        NetBSD-current source 2000/09/05
>Organization:
	Finz Herrb Inc
>Environment:
System: NetBSD southside 1.5E NetBSD 1.5E (SOUTHSIDE) #4: Tue Sep 5 01:45:08 CEST 2000 matthieu@southside:/local/cvs/src/sys/arch/macppc/compile/SOUTHSIDE macppc


>Description:
	Since MacOS keeps the localtime in the harware battery backed
clock, when dual booting a machine between MacOS and NetBSD, the clock
is wrong under one of the OS, unless you leave in the GMT timezone. 

	on the macppc port 'options RTC_OFFSET="xxx" has no effect. 
	
>How-To-Repeat:
	build a  kernel with 'options RTC_OFFSET="-120"' (in my case)
	and observe that it doesn't change anything
>Fix:
Index: sys/arch/macppc/macppc/clock.c
===================================================================
RCS file: /pub/NetBSD-CVS/syssrc/sys/arch/macppc/macppc/clock.c,v
retrieving revision 1.13
diff -u -r1.13 clock.c
--- clock.c	2000/08/20 07:48:45	1.13
+++ clock.c	2000/09/04 21:49:46
@@ -84,7 +84,7 @@
 		return;
 	}
 	clockinitted = 1;
-	time.tv_sec = rtc_time - DIFF19041970;
+	time.tv_sec = rtc_time - DIFF19041970 + rtc_offset * 60;
 
 	deltat = time.tv_sec - base;
 	if (deltat < 0)

>Release-Note:
>Audit-Trail:
>Unformatted: