From owner-acpi-jp@jp.FreeBSD.org Wed Sep 17 07:43:07 2003
Received: (from daemon@localhost)
	by castle.jp.FreeBSD.org (8.11.6p2+3.4W/8.11.3) id h8GMh7W45351;
	Wed, 17 Sep 2003 07:43:07 +0900 (JST)
	(envelope-from owner-acpi-jp@jp.FreeBSD.org)
Received: from hermes.hd.intel.com (fmr09.intel.com [192.52.57.35])
	by castle.jp.FreeBSD.org (8.11.6p2+3.4W/8.11.3) with ESMTP/inet id h8GMh5w45308
	for <acpi-jp@jp.FreeBSD.org>; Wed, 17 Sep 2003 07:43:06 +0900 (JST)
	(envelope-from robert.moore@intel.com)
Received: from petasus.hd.intel.com (petasus.hd.intel.com [10.127.45.3])
	by hermes.hd.intel.com (8.11.6p2/8.11.6/d: outer.mc,v 1.83 2003/09/05 14:45:27 rfjohns1 Exp $) with ESMTP id h8GMeaN22962
	for <acpi-jp@jp.FreeBSD.org>; Tue, 16 Sep 2003 22:40:37 GMT
Received: from orsmsxvs040.jf.intel.com (orsmsxvs040.jf.intel.com [192.168.65.206])
	by petasus.hd.intel.com (8.11.6p2/8.11.6/d: inner.mc,v 1.35 2003/05/22 21:18:01 rfjohns1 Exp $) with SMTP id h8GMbc210281
	for <acpi-jp@jp.FreeBSD.org>; Tue, 16 Sep 2003 22:37:39 GMT
Received: from orsmsx332.amr.corp.intel.com ([192.168.65.60])
 by orsmsxvs040.jf.intel.com (NAVGW 2.5.2.11) with SMTP id M2003091615425517273
 ; Tue, 16 Sep 2003 15:42:55 -0700
Received: from orsmsx405.amr.corp.intel.com ([192.168.65.46]) by orsmsx332.amr.corp.intel.com with Microsoft SMTPSVC(5.0.2195.5329);
	 Tue, 16 Sep 2003 15:42:56 -0700
Content-Class: urn:content-classes:message
MIME-Version: 1.0
Content-Type: text/plain;
	charset="us-ascii"
Content-Transfer-Encoding: quoted-printable
X-MimeOLE: Produced By Microsoft Exchange V6.0.6375.0
Message-ID: <D3A3AA459175A44CB5326F26DA7A189C1C3D6B@orsmsx405.jf.intel.com>
X-MS-Has-Attach: 
X-MS-TNEF-Correlator: 
Thread-Topic: Bugs in osunixxf.c and aslutils.c
Thread-Index: AcNcoD5lM5InVS2tQmidgwDdevVskgf4SamAAAiMdJA=
From: "Moore, Robert" <robert.moore@intel.com>
To: "Moore, Robert" <robert.moore@intel.com>, "Nate Lawson" <nate@root.org>,
   <iwasaki@freebsd.org>, <takawata@freebsd.org>,
   "Grover, Andrew" <andrew.grover@intel.com>
Cc: <acpi-jp@jp.FreeBSD.org>
X-OriginalArrivalTime: 16 Sep 2003 22:42:56.0057 (UTC) FILETIME=[DF12CA90:01C37CA3]
Reply-To: acpi-jp@jp.FreeBSD.org
Precedence: list
Date: Tue, 16 Sep 2003 15:42:55 -0700
X-Sequence: acpi-jp 2669
Subject: [acpi-jp 2669] RE: Bugs in osunixxf.c and aslutils.c
Sender: owner-acpi-jp@jp.FreeBSD.org
X-Originator: robert.moore@intel.com
X-Distribute: distribute version 2.1 (Alpha) patchlevel 24e+030902


Even better:

sleep (seconds + (milliseconds / 1000));
usleep ((milliseconds % 1000) * 1000);

-----Original Message-----
From: Moore, Robert=20
Sent: Tuesday, September 16, 2003 11:38 AM
To: 'Nate Lawson'; iwasaki@freebsd.org; takawata@freebsd.org; Grover,
Andrew
Subject: RE: Bugs in osunixxf.c and aslutils.c


Since:

The usleep() function may fail if:=20
[EINVAL]
The time interval specified 1,000,000 or more microseconds.

Might this be better:

if (seconds)
     sleep (seconds);

if (milliseconds)
    usleep (milliseconds * 1000);

Bob


-----Original Message-----
From: Nate Lawson [mailto:nate@root.org]=20
Sent: Wednesday, August 06, 2003 9:56 PM
To: iwasaki@freebsd.org; takawata@freebsd.org; Grover, Andrew
Subject: Bugs in osunixxf.c and aslutils.c

I was looking at Iwasaki-san's acpicatools port and he has a few patches
that I think should be integrated by Intel.  The first is a logic error
--
the sleep delay will be WAY too long.  The second appears to be an
off-by-one error in the length of the AslCompilername array.
Iwasaki-san,
can you tell us more about that bug?

Thanks,
Nate

--- acpica-unix-20030523/osunixxf.c.orig        Sat May 24 09:11:02 2003
+++ acpica-unix-20030523/osunixxf.c     Thu Jun 12 17:03:26 2003
@@ -815,7 +815,7 @@
     UINT32                  milliseconds)
 {

-    sleep ((seconds * 1000) + milliseconds);
+    usleep (((seconds * 1000) + milliseconds) * 1000);
     return;
 }


--- acpica-unix-20030523/compiler/aslutils.c.orig       Thu Jun 12
15:48:25 2003
+++ acpica-unix-20030523/compiler/aslutils.c    Thu Jun 12 15:48:34 2003
@@ -126,7 +126,7 @@

 #ifdef _USE_BERKELEY_YACC
 extern const char * const       AslCompilername[];
-static const char * const       *yytname =3D &AslCompilername[255];
+static const char * const       *yytname =3D &AslCompilername[254];
 #else
 extern const char * const       yytname[];
 #endif

