From owner-acpi-jp@jp.FreeBSD.org Wed Sep 17 07:49:06 2003
Received: (from daemon@localhost)
	by castle.jp.FreeBSD.org (8.11.6p2+3.4W/8.11.3) id h8GMn6052385;
	Wed, 17 Sep 2003 07:49:06 +0900 (JST)
	(envelope-from owner-acpi-jp@jp.FreeBSD.org)
Received: from rootlabs.com (root.org [67.118.192.226])
	by castle.jp.FreeBSD.org (8.11.6p2+3.4W/8.11.3) with SMTP/inet id h8GMmxw52365
	for <acpi-jp@jp.FreeBSD.org>; Wed, 17 Sep 2003 07:49:05 +0900 (JST)
	(envelope-from nate@rootlabs.com)
Received: (qmail 10190 invoked by uid 1000); 16 Sep 2003 22:48:55 -0000
From: Nate Lawson <nate@root.org>
To: "Moore, Robert" <robert.moore@intel.com>
cc: iwasaki@freebsd.org, takawata@freebsd.org,
   "Grover, Andrew" <andrew.grover@intel.com>, acpi-jp@jp.FreeBSD.org
In-Reply-To: <D3A3AA459175A44CB5326F26DA7A189C1C3D6B@orsmsx405.jf.intel.com>
Message-ID: <20030916154600.F10174@root.org>
References: <D3A3AA459175A44CB5326F26DA7A189C1C3D6B@orsmsx405.jf.intel.com>
MIME-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII
Reply-To: acpi-jp@jp.FreeBSD.org
Precedence: list
Date: Tue, 16 Sep 2003 15:48:55 -0700
X-Sequence: acpi-jp 2670
Subject: [acpi-jp 2670] RE: Bugs in osunixxf.c and aslutils.c
Sender: owner-acpi-jp@jp.FreeBSD.org
X-Originator: nate@root.org
X-Distribute: distribute version 2.1 (Alpha) patchlevel 24e+030902

My only problem with the below is that it relies on sleep(0) being
correct on the OS.  This should be a reasonable assumption.

What about the off-by-one error in ytname?

-Nate

On Tue, 16 Sep 2003, Moore, Robert wrote:
> Even better:
>
> sleep (seconds + (milliseconds / 1000));
> usleep ((milliseconds % 1000) * 1000);
>
> -----Original Message-----
> From: Moore, Robert
> 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:
> [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]
> 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 = &AslCompilername[255];
> +static const char * const       *yytname = &AslCompilername[254];
>  #else
>  extern const char * const       yytname[];
>  #endif
>
