Re: aml: Fix integer types to be unsigned

2012-04-01 Thread Otto Moerbeek
On Sun, Apr 01, 2012 at 01:54:10PM +0300, Paul Irofti wrote: > [--snip-some-of-the-gyping-from-my-initial-diff--] > > case AML_OBJTYPE_STRING: > > - if (ival == -1) > > + if (ival == (uint64_t)-1) > > This is what I tried first as well. But this cast fails on my x61s where

Re: aml: Fix integer types to be unsigned

2012-04-01 Thread Mark Kettenis
> Date: Sun, 1 Apr 2012 13:54:10 +0300 > From: Paul Irofti > > [--snip-some-of-the-gyping-from-my-initial-diff--] Not really gyped. Already had some of it in my tree from when I looked at the arithnmetic diff. It was just that your casting mistakes made me realize what the right way to go was

Re: aml: Fix integer types to be unsigned

2012-04-01 Thread Paul Irofti
[--snip-some-of-the-gyping-from-my-initial-diff--] > case AML_OBJTYPE_STRING: > - if (ival == -1) > + if (ival == (uint64_t)-1) This is what I tried first as well. But this cast fails on my x61s where ival is set to a 32-bit -1. > ival = strlen(

Re: aml: Fix integer types to be unsigned

2012-04-01 Thread Mark Kettenis
> From: Jordan Hargrave > Date: Sun, 1 Apr 2012 08:13:13 + > > you will need to fix AMLOP_ONES as well. It does a (char)opcode typecast, > which would be 0xff not 0x... if using uint64. No, that one is fine, at least on machines where char is signed. For AMLOP_ONES, opcode will be 0xff.

Re: aml: Fix integer types to be unsigned

2012-04-01 Thread Paul Irofti
On Sun, Apr 01, 2012 at 08:13:13AM +, Jordan Hargrave wrote: >you will need to fix AMLOP_ONES as well. It does a (char)opcode typecast, >which would be 0xff not 0x... if using uint64. > >amlop_match, amlop_wait, amlop_acquire, amlop_condref all will need to >return AML_ONE

Re: aml: Fix integer types to be unsigned

2012-04-01 Thread Jordan Hargrave
gt; To: o...@drijf.net > CC: tech@openbsd.org; kette...@openbsd.org; chas...@skynet.be; jor...@openbsd.org > Subject: Re: aml: Fix integer types to be unsigned > > On Sat, Mar 31, 2012 at 05:33:33PM +0200, Otto Moerbeek wrote: > > On Sat, Mar 31, 2012 at 01:47:18AM +0300, Paul Irofti

Re: aml: Fix integer types to be unsigned

2012-04-01 Thread Paul Irofti
On Sat, Mar 31, 2012 at 05:33:33PM +0200, Otto Moerbeek wrote: > On Sat, Mar 31, 2012 at 01:47:18AM +0300, Paul Irofti wrote: > > > After the report from a few weeks ago I went ahead and fixed most (if > > not all) of the signed integer usages in the AML parser. > > > > Please have a look at this

Re: aml: Fix integer types to be unsigned

2012-04-01 Thread Paul Irofti
On Sat, Mar 31, 2012 at 12:18:27PM +0200, Mark Kettenis wrote: > > Date: Sat, 31 Mar 2012 01:47:18 +0300 > > From: Paul Irofti > > > > After the report from a few weeks ago I went ahead and fixed most (if > > not all) of the signed integer usages in the AML parser. > > > > Please have a look at

Re: aml: Fix integer types to be unsigned

2012-03-31 Thread Jordan Hargrave
Strings are always called with -1 (to pull the size-field from strlen itself) for creation. So technically that could be any large constant as well. > To: o...@drijf.net > CC: tech@openbsd.org; kette...@openbsd.org; chas...@skynet.be; jor...@openbsd.org > Subject: Re: aml: Fix integer

Re: aml: Fix integer types to be unsigned

2012-03-31 Thread Theo de Raadt
> > +_aml_setvalue(struct aml_value *lhs, int type, u_int64_t ival, const void > > *bval) > > { > > memset(&lhs->_, 0x0, sizeof(lhs->_)); > > > > @@ -923,7 +920,7 @@ _aml_setvalue(struct aml_value *lhs, int > > memcpy(lhs->v_buffer, bval, ival); > > break; >

Re: aml: Fix integer types to be unsigned

2012-03-31 Thread Otto Moerbeek
On Sat, Mar 31, 2012 at 01:47:18AM +0300, Paul Irofti wrote: > After the report from a few weeks ago I went ahead and fixed most (if > not all) of the signed integer usages in the AML parser. > > Please have a look at this diff, test it thoroughly and comment/okay it. Some comments inline. > +_

Re: aml: Fix integer types to be unsigned

2012-03-31 Thread Mark Kettenis
> Date: Sat, 31 Mar 2012 01:47:18 +0300 > From: Paul Irofti > > After the report from a few weeks ago I went ahead and fixed most (if > not all) of the signed integer usages in the AML parser. > > Please have a look at this diff, test it thoroughly and comment/okay it. So you ran into the same

aml: Fix integer types to be unsigned

2012-03-30 Thread Paul Irofti
After the report from a few weeks ago I went ahead and fixed most (if not all) of the signed integer usages in the AML parser. Please have a look at this diff, test it thoroughly and comment/okay it. Index: dev/acpi/amltypes.h === RC