From d9bc92d85ec026b77248c54e8c8d7a0ffaac3ffa Mon Sep 17 00:00:00 2001 From: jsing Date: Thu, 14 Aug 2008 17:41:20 +0000 Subject: [PATCH] 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@ --- sys/dev/acpi/dsdt.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) 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 */ -- 2.20.1