From: jsing Date: Thu, 14 Aug 2008 17:41:20 +0000 (+0000) Subject: If the AML SizeOf() method is called with an object reference it should X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=d9bc92d85ec026b77248c54e8c8d7a0ffaac3ffa;p=openbsd If the AML SizeOf() method is called with an object reference it should 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@ --- diff --git a/sys/dev/acpi/dsdt.c b/sys/dev/acpi/dsdt.c index ba0b786be84..8536885ffad 100644 --- a/sys/dev/acpi/dsdt.c +++ b/sys/dev/acpi/dsdt.c @@ -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 * @@ -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 */