NetBSD Problem Report #740

From gnats  Thu Jan 19 15:40:27 1995
Received: from pain.lcs.mit.edu (pain.lcs.mit.edu [128.52.46.239]) by sun-lamp.cs.berkeley.edu (8.6.9/8.6.9) with ESMTP id PAA02709 for <gnats-bugs@sun-lamp.cs.berkeley.edu>; Thu, 19 Jan 1995 15:40:25 -0800
Message-Id: <199501192315.AAA10976@arresum.inka.de>
Date: Fri, 20 Jan 1995 00:15:23 +0100
From: root@arresum.inka.de
Reply-To: bernd@arresum.inka.de (Bernd Ernesti)
To: gnats-bugs@NetBSD.ORG
Subject: fix the savebug of the amiga clock
X-Send-Pr-Version: 3.2

>Number:         740
>Category:       port-amiga
>Synopsis:       fix the savebug of the amiga clock
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    gnats-admin (GNATS administrator)
>State:          closed
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Thu Jan 19 15:50:02 +0000 1995
>Closed-Date:    Thu Feb 23 20:44:23 +0000 1995
>Last-Modified:  
>Originator:     Superuser
>Release:        NetBSD-current 01-15-95
>Organization:
"	"
>Environment:

System: NetBSD arresum.inka.de 1.0A NetBSD 1.0A (VEEGO) #17: Wed Jan 18 13:02:31 GMT+0100 1995 root@arresum.inka.de:/src/sys/arch/amiga/compile/VEEGO amiga


>Description:
There was some typing mistakes in the clock.c source and therefore this code was
disabled by some #ifdef 0
>How-To-Repeat:
see above
>Fix:

*** clock.c-orig	Wed Dec 28 12:21:15 1994
--- clock.c	Fri Jan  6 13:42:52 1995
***************
*** 703,709 ****
  a3gettod()
  {
  	struct rtclock3000 *rt;
! 	int i, year, month, day, hour, min, sec;
  	u_long tmp;

  	rt = clockaddr;
--- 703,709 ----
  a3gettod()
  {
  	struct rtclock3000 *rt;
! 	int i, year, month, day, wday, hour, min, sec;
  	u_long tmp;

  	rt = clockaddr;
***************
*** 715,720 ****
--- 715,721 ----
  	sec   = rt->second1 * 10 + rt->second2;
  	min   = rt->minute1 * 10 + rt->minute2;
  	hour  = rt->hour1   * 10 + rt->hour2;
+ 	wday  = rt->weekday;
  	day   = rt->day1    * 10 + rt->day2;
  	month = rt->month1  * 10 + rt->month2;
  	year  = rt->year1   * 10 + rt->year2   + 1900;
***************
*** 724,729 ****
--- 725,732 ----

  	if (range_test(hour, 0, 23))
  		return(0);
+ 	if (range_test(wday, 0, 6))
+ 		return(0);
  	if (range_test(day, 1, 31))
  		return(0);
  	if (range_test(month, 1, 12))
***************
*** 756,761 ****
--- 759,765 ----
  	u_char sec1, sec2;
  	u_char min1, min2;
  	u_char hour1, hour2;
+ /*	u_char wday; */
  	u_char day1, day2;
  	u_char mon1, mon2;
  	u_char year1, year2;
***************
*** 766,774 ****
  	 * there seem to be problems with the bitfield addressing
  	 * currently used..
  	 */
! return(0);
! #if not_yet
! 	if (rt)
  		return 0;

  	/* prepare values to be written to clock */
--- 770,777 ----
  	 * there seem to be problems with the bitfield addressing
  	 * currently used..
  	 */
! 
! 	if (! rt)
  		return 0;

  	/* prepare values to be written to clock */
***************
*** 809,831 ****
  	day1 = day / 10;
  	day2 = day % 10;

! 	rt->control1 = CONTROL1_HOLD_CLOCK;
  	rt->second1 = sec1;
  	rt->second2 = sec2;
  	rt->minute1 = min1;
  	rt->minute2 = min2;
  	rt->hour1   = hour1;
  	rt->hour2   = hour2;
  	rt->day1    = day1;
  	rt->day2    = day2;
  	rt->month1  = mon1;
  	rt->month2  = mon2;
  	rt->year1   = year1;
  	rt->year2   = year2;
! 	rt->control2 = CONTROL1_FREE_CLOCK;

  	return 1;
- #endif
  }

  long
--- 812,834 ----
  	day1 = day / 10;
  	day2 = day % 10;

! 	rt->control1 = A3CONTROL1_HOLD_CLOCK;
  	rt->second1 = sec1;
  	rt->second2 = sec2;
  	rt->minute1 = min1;
  	rt->minute2 = min2;
  	rt->hour1   = hour1;
  	rt->hour2   = hour2;
+ /*	rt->weekday = wday; */
  	rt->day1    = day1;
  	rt->day2    = day2;
  	rt->month1  = mon1;
  	rt->month2  = mon2;
  	rt->year1   = year1;
  	rt->year2   = year2;
! 	rt->control1 = A3CONTROL1_FREE_CLOCK;

  	return 1;
  }

  long
***************
*** 917,924 ****
  	 *
  	 * XXX Check out the above where we (hour1 & 3)
  	 */
! return(0);
! #if not_yet
  	if (! rt)
  		return 0;

--- 920,926 ----
  	 *
  	 * XXX Check out the above where we (hour1 & 3)
  	 */
! 
  	if (! rt)
  		return 0;

***************
*** 963,969 ****
  	/* 
  	 * XXXX spin wait as with reading???
  	 */
! 	rt->control1 = A2CONTROL1_HOLD_CLOCK;
  	rt->second1 = sec1;
  	rt->second2 = sec2;
  	rt->minute1 = min1;
--- 965,971 ----
  	/* 
  	 * XXXX spin wait as with reading???
  	 */
! 	rt->control1 |= A2CONTROL1_HOLD;
  	rt->second1 = sec1;
  	rt->second2 = sec2;
  	rt->minute1 = min1;
***************
*** 976,983 ****
  	rt->month2  = mon2;
  	rt->year1   = year1;
  	rt->year2   = year2;
! 	rt->control2 = CONTROL1_FREE_CLOCK;

    return 1;
- #endif
  }
--- 978,984 ----
  	rt->month2  = mon2;
  	rt->year1   = year1;
  	rt->year2   = year2;
! 	rt->control2 &= ~A2CONTROL1_HOLD;

    return 1;
  }
>Release-Note:
>Audit-Trail:
State-Changed-From-To: open->closed 
State-Changed-By: chopps 
State-Changed-When: Thu Feb 23 12:44:23 PST 1995 
State-Changed-Why:  
Applied patch; fixed. 
>Unformatted:

NetBSD Home
NetBSD PR Database Search

(Contact us) $NetBSD: query-full-pr,v 1.51 2026/08/10 02:28:17 riastradh Exp $
$NetBSD: gnats_config.sh,v 1.10 2026/05/13 22:00:09 riastradh Exp $
Copyright © 1994-2026 The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.