> Date: Sun, 1 Apr 2012 13:54:10 +0300
> From: Paul Irofti <[email protected]>
> 
> [--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 ;).

> >     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.

Well, the real bug is that ival gets set to "32-bit -1" (by which you
mean 0xffffffff I presume).  That should never happen.  May very well
be a bug that you introduced in your diff because:

> Index: dev/acpi/dsdt.c
> ===================================================================
> RCS file: /cvs/src/sys/dev/acpi/dsdt.c,v
> retrieving revision 1.193
> diff -u -p -r1.193 dsdt.c
> --- dev/acpi/dsdt.c   15 Mar 2012 18:36:53 -0000      1.193
> +++ dev/acpi/dsdt.c   30 Mar 2012 22:45:15 -0000
> @@ -1451,11 +1448,11 @@ static char osstring[] = "Macrosift Wind
>  struct aml_defval {
>       const char              *name;
>       int                     type;
> -     int64_t                 ival;
> +     u_int64_t               ival;
>       const void              *bval;
>       struct aml_value        **gval;
>  } aml_defobj[] = {
> -     { "_OS_", AML_OBJTYPE_STRING, -1, osstring },
> +     { "_OS_", AML_OBJTYPE_STRING, (unsigned)-1, osstring },
>       { "_REV", AML_OBJTYPE_INTEGER, 2, NULL },
>       { "_GL", AML_OBJTYPE_MUTEX, 1, NULL, &aml_global_lock },
>       { "_OSI", AML_OBJTYPE_METHOD, 1, aml_callosi },

...the (unsigned) cast you added there will give you one!

Reply via email to