If the AML SizeOf() method is called with an object reference it should
authorjsing <jsing@openbsd.org>
Thu, 14 Aug 2008 17:41:20 +0000 (17:41 +0000)
committerjsing <jsing@openbsd.org>
Thu, 14 Aug 2008 17:41:20 +0000 (17:41 +0000)
return the size of the referenced object. This fixes a panic on the ASUS
eeePC 1000H when attaching the acpiasus(4) driver.

Issue reported and fix tested by robert@

ok marco@

sys/dev/acpi/dsdt.c

index ba0b786..8536885 100644 (file)
@@ -1,4 +1,4 @@
-/* $OpenBSD: dsdt.c,v 1.130 2008/06/14 21:40:16 jordan Exp $ */
+/* $OpenBSD: dsdt.c,v 1.131 2008/08/14 17:41:20 jsing Exp $ */
 /*
  * Copyright (c) 2005 Jordan Hargrave <jordan@openbsd.org>
  *
@@ -3920,7 +3920,10 @@ aml_xparse(struct aml_scope *scope, int ret_type, const char *stype)
                break;
        case AMLOP_SIZEOF:
                /* Sizeof: S => i */
-               ival = opargs[0]->length;
+               if (opargs[0]->type == AML_OBJTYPE_OBJREF)
+                       ival = opargs[0]->v_objref.ref->length;
+               else
+                       ival = opargs[0]->length;
                break;
        case AMLOP_OBJECTTYPE:
                /* ObjectType: S => i */