diff options
| author | Jung-uk Kim <jkim@FreeBSD.org> | 2015-11-25 21:04:42 +0000 | 
|---|---|---|
| committer | Jung-uk Kim <jkim@FreeBSD.org> | 2015-11-25 21:04:42 +0000 | 
| commit | b9098066cd6284319bca922f13e59517f774a103 (patch) | |
| tree | f01fd6c9053cb01ed84c00cb42ee789adafceaf5 /source/components/debugger/dbxface.c | |
| parent | 1e24cf365bc9c8df179b145c90d52852724e54ee (diff) | |
Notes
Diffstat (limited to 'source/components/debugger/dbxface.c')
| -rw-r--r-- | source/components/debugger/dbxface.c | 91 | 
1 files changed, 90 insertions, 1 deletions
| diff --git a/source/components/debugger/dbxface.c b/source/components/debugger/dbxface.c index 9e7c31d6c0c8..cc636dece49a 100644 --- a/source/components/debugger/dbxface.c +++ b/source/components/debugger/dbxface.c @@ -152,6 +152,40 @@ AcpiDbStartCommand (  /*******************************************************************************   * + * FUNCTION:    AcpiDbSignalBreakPoint + * + * PARAMETERS:  WalkState       - Current walk + * + * RETURN:      Status + * + * DESCRIPTION: Called for AML_BREAK_POINT_OP + * + ******************************************************************************/ + +void +AcpiDbSignalBreakPoint ( +    ACPI_WALK_STATE         *WalkState) +{ + +#ifndef ACPI_APPLICATION +    if (AcpiGbl_DbThreadId != AcpiOsGetThreadId ()) +    { +        return; +    } +#endif + +    /* +     * Set the single-step flag. This will cause the debugger (if present) +     * to break to the console within the AML debugger at the start of the +     * next AML instruction. +     */ +    AcpiGbl_CmSingleStep = TRUE; +    AcpiOsPrintf ("**break** Executed AML BreakPoint opcode\n"); +} + + +/******************************************************************************* + *   * FUNCTION:    AcpiDbSingleStep   *   * PARAMETERS:  WalkState       - Current walk @@ -181,6 +215,13 @@ AcpiDbSingleStep (      ACPI_FUNCTION_ENTRY (); +#ifndef ACPI_APPLICATION +    if (AcpiGbl_DbThreadId != AcpiOsGetThreadId ()) +    { +        return (AE_OK); +    } +#endif +      /* Check the abort flag */      if (AcpiGbl_AbortMethod) @@ -439,6 +480,10 @@ AcpiInitializeDebugger (      AcpiGbl_DbScopeBuf [1] =  0;      AcpiGbl_DbScopeNode = AcpiGbl_RootNode; +    /* Initialize user commands loop */ + +    AcpiGbl_DbTerminateLoop = FALSE; +      /*       * If configured for multi-thread support, the debug executor runs in       * a separate thread so that the front end can be in another address @@ -466,15 +511,21 @@ AcpiInitializeDebugger (          /* Create the debug execution thread to execute commands */ -        Status = AcpiOsExecute (OSL_DEBUGGER_THREAD, +        AcpiGbl_DbThreadsTerminated = FALSE; +        Status = AcpiOsExecute (OSL_DEBUGGER_MAIN_THREAD,              AcpiDbExecuteThread, NULL);          if (ACPI_FAILURE (Status))          {              ACPI_EXCEPTION ((AE_INFO, Status,                  "Could not start debugger thread")); +            AcpiGbl_DbThreadsTerminated = TRUE;              return_ACPI_STATUS (Status);          }      } +    else +    { +        AcpiGbl_DbThreadId = AcpiOsGetThreadId (); +    }      return_ACPI_STATUS (AE_OK);  } @@ -499,6 +550,22 @@ AcpiTerminateDebugger (      void)  { +    /* Terminate the AML Debugger */ + +    AcpiGbl_DbTerminateLoop = TRUE; + +    if (AcpiGbl_DebuggerConfiguration & DEBUGGER_MULTI_THREADED) +    { +        AcpiOsReleaseMutex (AcpiGbl_DbCommandReady); + +        /* Wait the AML Debugger threads */ + +        while (!AcpiGbl_DbThreadsTerminated) +        { +            AcpiOsSleep (100); +        } +    } +      if (AcpiGbl_DbBuffer)      {          AcpiOsFree (AcpiGbl_DbBuffer); @@ -511,3 +578,25 @@ AcpiTerminateDebugger (  }  ACPI_EXPORT_SYMBOL (AcpiTerminateDebugger) + + +/******************************************************************************* + * + * FUNCTION:    AcpiSetDebuggerThreadId + * + * PARAMETERS:  ThreadId        - Debugger thread ID + * + * RETURN:      None + * + * DESCRIPTION: Set debugger thread ID + * + ******************************************************************************/ + +void +AcpiSetDebuggerThreadId ( +    ACPI_THREAD_ID          ThreadId) +{ +    AcpiGbl_DbThreadId = ThreadId; +} + +ACPI_EXPORT_SYMBOL (AcpiSetDebuggerThreadId) | 
