From owner-svn-src-stable@FreeBSD.ORG Sat Jul 25 11:10:02 2009 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 18DCC106566B; Sat, 25 Jul 2009 11:10:02 +0000 (UTC) (envelope-from nyan@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 060CC8FC0A; Sat, 25 Jul 2009 11:10:02 +0000 (UTC) (envelope-from nyan@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n6PBA1XS039338; Sat, 25 Jul 2009 11:10:01 GMT (envelope-from nyan@svn.freebsd.org) Received: (from nyan@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n6PBA10l039335; Sat, 25 Jul 2009 11:10:01 GMT (envelope-from nyan@svn.freebsd.org) Message-Id: <200907251110.n6PBA10l039335@svn.freebsd.org> From: Takahashi Yoshihiro Date: Sat, 25 Jul 2009 11:10:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r195866 - in stable/7/sys: . boot/pc98/libpc98 contrib/pf X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 25 Jul 2009 11:10:02 -0000 Author: nyan Date: Sat Jul 25 11:10:01 2009 New Revision: 195866 URL: http://svn.freebsd.org/changeset/base/195866 Log: MFC: r190126 Reduce diffs against i386. Modified: stable/7/sys/ (props changed) stable/7/sys/boot/pc98/libpc98/time.c stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/boot/pc98/libpc98/time.c ============================================================================== --- stable/7/sys/boot/pc98/libpc98/time.c Sat Jul 25 10:22:51 2009 (r195865) +++ stable/7/sys/boot/pc98/libpc98/time.c Sat Jul 25 11:10:01 2009 (r195866) @@ -33,23 +33,21 @@ __FBSDID("$FreeBSD$"); #include "bootstrap.h" #include "libi386.h" +static int bios_seconds(void); + /* - * Return the time in seconds since the beginning of the day. - * - * If we pass midnight, don't wrap back to 0. + * Return the BIOS time-of-day value. * * XXX uses undocumented BCD support from libstand. */ - -time_t -time(time_t *t) +static int +bios_seconds(void) { - static time_t lasttime, now; int hr, minute, sec; unsigned char bios_time[6]; - + v86.ctl = 0; - v86.addr = 0x1c; /* int 0x1c, function 0 */ + v86.addr = 0x1c; /* int 0x1c, function 0 */ v86.eax = 0x0000; v86.es = VTOPSEG(bios_time); v86.ebx = VTOPOFF(bios_time); @@ -59,7 +57,20 @@ time(time_t *t) minute = bcd2bin(bios_time[4]); sec = bcd2bin(bios_time[5]); - now = hr * 3600 + minute * 60 + sec; + return (hr * 3600 + minute * 60 + sec); +} + +/* + * Return the time in seconds since the beginning of the day. + */ +time_t +time(time_t *t) +{ + static time_t lasttime; + time_t now; + + now = bios_seconds(); + if (now < lasttime) now += 24 * 3600; lasttime = now;