This patch fixes CondRef store to empty target seen on Dell E4310 and
some HP systems.  Please test and send dmesg output.

Index: dsdt.c
===================================================================
RCS file: /cvs/src/sys/dev/acpi/dsdt.c,v
retrieving revision 1.185
diff -u -p -b -r1.185 dsdt.c
--- dsdt.c      22 Apr 2011 18:22:01 -0000      1.185
+++ dsdt.c      2 Jun 2011 04:15:27 -0000
@@ -244,7 +244,7 @@ struct aml_opcode aml_table[] = {
        { AMLOP_INDEX,          "Index",        "tir",  },
        { AMLOP_DEREFOF,        "DerefOf",      "t",    },
        { AMLOP_REFOF,          "RefOf",        "S",    },
-       { AMLOP_CONDREFOF,      "CondRef",      "SS",   },
+       { AMLOP_CONDREFOF,      "CondRef",      "Sr",   },
 
        { AMLOP_LOADTABLE,      "LoadTable",    "tttttt" },
        { AMLOP_STALL,          "Stall",        "i",    },
@@ -3536,11 +3536,14 @@ aml_parse(struct aml_scope *scope, int r
                /* CondRef: rr => I */
                ival = 0;
                if (opargs[0]->node != NULL) {
+                       printf("condref: %s %p\n", 
aml_nodename(opargs[0]->node), opargs[1]);
+                       
                        /* Create Object Reference */
-                       opargs[2] = aml_allocvalue(AML_OBJTYPE_OBJREF, opcode,
+                       rv = aml_allocvalue(AML_OBJTYPE_OBJREF, opcode,
                                opargs[0]);
                        aml_addref(opargs[0], "CondRef");
-                       aml_store(scope, opargs[1], 0, opargs[2]);
+                       aml_store(scope, opargs[1], 0, rv);
+                       aml_delref(&rv, 0);
 
                        /* Mark that we found it */
                        ival = -1;

Reply via email to