My analysis was finished.  Please try this patch.

--- exfield.c-  Thu Jul  4 21:54:24 2002
+++ exfield.c   Thu Jul  4 21:55:02 2002
@@ -200,7 +200,7 @@
     /* Handle both ACPI 1.0 and ACPI 2.0 Integer widths */
 
     IntegerSize = sizeof (ACPI_INTEGER);
-    if (WalkState->MethodNode->Flags & ANOBJ_DATA_WIDTH_32)
+    if (WalkState->MethodNode != NULL && WalkState->MethodNode->Flags & 
+ANOBJ_DATA_WIDTH_32)
     {
         /*
          * We are running a method that exists in a 32-bit ACPI table.



BTW, this bug already fixed in 20020517 version.

> > > acpi0: <ASUS   CUSL2   > on motherboard
> > > 
> > > 
> > > Fatal trap 12: page fault while in kernel mode
> > > fault virtual address   = 0x16
> > > fault code              = supervisor read, page not present
> > > instruction pointer     = 0x8:0xc04f9aca
> > > stack pointer           = 0x10:0xc054ea14
> > > frame pointer           = 0x10:0xc054ea34
> > > code segment            = base 0x0, limit 0xfffff, type 0x1b
> > >                         = DPL 0, pres 1, def32 1, gran 1
> > > processor eflags        = interrupt enabled, resume, IOPL = 0
> > > current process         = 0 (swapper)
> > > kernel: type 12 trap, code=0
> > > Stopped at      AcpiExReadDataFromField+0x5a:   movzbl  0x16(%eax),%eax
> > > db> trace
> > > AcpiExReadDataFromField(c0f00400,c25da200,c054ea50,c25e50c0,0) at 
>AcpiExReadDataFromField+0x5a
> 
> # if my understanding on i386 asm is correct,
> I think this is at (exfield.c):
> 203:    if (WalkState->MethodNode->Flags & ANOBJ_DATA_WIDTH_32)
> where WalkState->MethodNode is NULL, this caused page fault.
> 
> I'm waiting for further debug info. but I'll try to find where
> WalkState->MethodNode suppose to be set...

WalkState->MethodNode was initialized to NULL in AcpiDsInitAmlWalk()
which called by AcpiDsExecuteArguments().  AcpiExReadDataFromField()
assumes that WalkState->MethodNode always has a correct pointer.
That's the problem, I think.

ACPI_STATUS
AcpiDsExecuteArguments (
    ACPI_NAMESPACE_NODE     *Node,
    ACPI_NAMESPACE_NODE     *ScopeNode,
    UINT32                  AmlLength,
    UINT8                   *AmlStart)

    ...

    Status = AcpiDsInitAmlWalk (WalkState, Op, NULL, AmlStart,
                    AmlLength, NULL, NULL, 3);
    ...

AcpiDsInitAmlWalk (
    ACPI_WALK_STATE         *WalkState,
    ACPI_PARSE_OBJECT       *Op,
    ACPI_NAMESPACE_NODE     *MethodNode,
    UINT8                   *AmlStart,
    UINT32                  AmlLength,
    ACPI_OPERAND_OBJECT     **Params,
    ACPI_OPERAND_OBJECT     **ReturnObjDesc,
    UINT32                  PassNumber)

Thanks

To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-current" in the body of the message

Reply via email to