summaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
authorJoel Sing <jsing@cvs.openbsd.org>2008-08-14 17:41:21 +0000
committerJoel Sing <jsing@cvs.openbsd.org>2008-08-14 17:41:21 +0000
commit1ee4cca33bd4e81f2b8a2315392ab58fbce6e48c (patch)
treedf74ccc596f2f26d7f589290e80aca2ab789a2a8 /sys
parent3ae163dbd6453b43a968daba4c367b8cb1e70100 (diff)
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@
Diffstat (limited to 'sys')
-rw-r--r--sys/dev/acpi/dsdt.c7
1 files 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 <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 */