pcrtc.c (170289) | pcrtc.c (171553) |
---|---|
1/*- 2 * Copyright (c) 1990 The Regents of the University of California. 3 * All rights reserved. 4 * 5 * This code is derived from software contributed to Berkeley by 6 * William Jolitz and Don Ahn. 7 * 8 * Redistribution and use in source and binary forms, with or without --- 19 unchanged lines hidden (view full) --- 28 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 29 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 30 * SUCH DAMAGE. 31 * 32 * from: @(#)clock.c 7.2 (Berkeley) 5/12/91 33 */ 34 35#include <sys/cdefs.h> | 1/*- 2 * Copyright (c) 1990 The Regents of the University of California. 3 * All rights reserved. 4 * 5 * This code is derived from software contributed to Berkeley by 6 * William Jolitz and Don Ahn. 7 * 8 * Redistribution and use in source and binary forms, with or without --- 19 unchanged lines hidden (view full) --- 28 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 29 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 30 * SUCH DAMAGE. 31 * 32 * from: @(#)clock.c 7.2 (Berkeley) 5/12/91 33 */ 34 35#include <sys/cdefs.h> |
36__FBSDID("$FreeBSD: head/sys/pc98/cbus/pcrtc.c 170289 2007-06-04 18:25:08Z dwmalone $"); | 36__FBSDID("$FreeBSD: head/sys/pc98/cbus/pcrtc.c 171553 2007-07-23 09:42:32Z dwmalone $"); |
37 38/* 39 * Routines to handle clock hardware. 40 */ 41 42/* 43 * inittodr, settodr and support routines written 44 * by Christoph Robitschko <chmr@edvz.tu-graz.ac.at> --- 588 unchanged lines hidden (view full) --- 633 ct.hour = bcd2bin(rtc_inb() & 0xff); /* hour */ 634 ct.day = bcd2bin(rtc_inb() & 0xff); /* date */ 635 i = rtc_inb(); 636 ct.dow = i & 0x0f; /* dow */ 637 ct.mon = (i >> 4) & 0x0f; /* month */ 638 ct.year = bcd2bin(rtc_inb() & 0xff) + 1900; /* year */ 639 if (ct.year < 1995) 640 ct.year += 100; | 37 38/* 39 * Routines to handle clock hardware. 40 */ 41 42/* 43 * inittodr, settodr and support routines written 44 * by Christoph Robitschko <chmr@edvz.tu-graz.ac.at> --- 588 unchanged lines hidden (view full) --- 633 ct.hour = bcd2bin(rtc_inb() & 0xff); /* hour */ 634 ct.day = bcd2bin(rtc_inb() & 0xff); /* date */ 635 i = rtc_inb(); 636 ct.dow = i & 0x0f; /* dow */ 637 ct.mon = (i >> 4) & 0x0f; /* month */ 638 ct.year = bcd2bin(rtc_inb() & 0xff) + 1900; /* year */ 639 if (ct.year < 1995) 640 ct.year += 100; |
641 clock_ct_to_ts(&ct, &ts); | 641 /* Should we set dow = -1 because some clocks don't set it correctly? */ 642 if (clock_ct_to_ts(&ct, &ts)) { 643 printf("Invalid time in clock: check and reset the date!\n"); 644 return; 645 } |
642 ts.tv_sec += utc_offset(); 643 tc_setclock(&ts); 644} 645 646/* 647 * Write system time back to RTC 648 */ 649void --- 173 unchanged lines hidden --- | 646 ts.tv_sec += utc_offset(); 647 tc_setclock(&ts); 648} 649 650/* 651 * Write system time back to RTC 652 */ 653void --- 173 unchanged lines hidden --- |