Print this page
update to acpica-unix2-20140114
update to acpica-unix2-20130927
acpica-unix2-20130823
PANKOVs restructure

Split Close
Expand all
Collapse all
          --- old/usr/src/uts/intel/io/acpica/debugger/dbxface.c
          +++ new/usr/src/common/acpica/components/debugger/dbxface.c
   1    1  /*******************************************************************************
   2    2   *
   3    3   * Module Name: dbxface - AML Debugger external interfaces
   4    4   *
   5    5   ******************************************************************************/
   6    6  
   7    7  /*
   8      - * Copyright (C) 2000 - 2011, Intel Corp.
        8 + * Copyright (C) 2000 - 2014, Intel Corp.
   9    9   * All rights reserved.
  10   10   *
  11   11   * Redistribution and use in source and binary forms, with or without
  12   12   * modification, are permitted provided that the following conditions
  13   13   * are met:
  14   14   * 1. Redistributions of source code must retain the above copyright
  15   15   *    notice, this list of conditions, and the following disclaimer,
  16   16   *    without modification.
  17   17   * 2. Redistributions in binary form must reproduce at minimum a disclaimer
  18   18   *    substantially similar to the "NO WARRANTY" disclaimer below
↓ open down ↓ 205 lines elided ↑ open up ↑
 224  224       * namely, opcodes that have arguments
 225  225       */
 226  226      if (Op->Common.AmlOpcode == AML_INT_NAMEDFIELD_OP)
 227  227      {
 228  228          return (AE_OK);
 229  229      }
 230  230  
 231  231      switch (OpcodeClass)
 232  232      {
 233  233      case AML_CLASS_UNKNOWN:
 234      -    case AML_CLASS_ARGUMENT:    /* constants, literals, etc.  do nothing */
      234 +    case AML_CLASS_ARGUMENT:    /* constants, literals, etc. do nothing */
      235 +
 235  236          return (AE_OK);
 236  237  
 237  238      default:
      239 +
 238  240          /* All other opcodes -- continue */
 239  241          break;
 240  242      }
 241  243  
 242  244      /*
 243  245       * Under certain debug conditions, display this opcode and its operands
 244  246       */
 245  247      if ((AcpiGbl_DbOutputToFile)            ||
 246  248          (AcpiGbl_CmSingleStep)              ||
 247  249          (AcpiDbgLevel & ACPI_LV_PARSE))
↓ open down ↓ 153 lines elided ↑ open up ↑
 401  403   *
 402  404   ******************************************************************************/
 403  405  
 404  406  ACPI_STATUS
 405  407  AcpiDbInitialize (
 406  408      void)
 407  409  {
 408  410      ACPI_STATUS             Status;
 409  411  
 410  412  
      413 +    ACPI_FUNCTION_TRACE (DbInitialize);
      414 +
      415 +
 411  416      /* Init globals */
 412  417  
 413  418      AcpiGbl_DbBuffer            = NULL;
 414  419      AcpiGbl_DbFilename          = NULL;
 415  420      AcpiGbl_DbOutputToFile      = FALSE;
 416  421  
 417  422      AcpiGbl_DbDebugLevel        = ACPI_LV_VERBOSITY2;
 418  423      AcpiGbl_DbConsoleDebugLevel = ACPI_NORMAL_DEFAULT | ACPI_LV_TABLES;
 419  424      AcpiGbl_DbOutputFlags       = ACPI_DB_CONSOLE_OUTPUT;
 420  425  
 421  426      AcpiGbl_DbOpt_tables        = FALSE;
 422  427      AcpiGbl_DbOpt_disasm        = FALSE;
 423  428      AcpiGbl_DbOpt_stats         = FALSE;
 424  429      AcpiGbl_DbOpt_verbose       = TRUE;
 425  430      AcpiGbl_DbOpt_ini_methods   = TRUE;
 426  431  
 427  432      AcpiGbl_DbBuffer = AcpiOsAllocate (ACPI_DEBUG_BUFFER_SIZE);
 428  433      if (!AcpiGbl_DbBuffer)
 429  434      {
 430      -        return (AE_NO_MEMORY);
      435 +        return_ACPI_STATUS (AE_NO_MEMORY);
 431  436      }
 432  437      ACPI_MEMSET (AcpiGbl_DbBuffer, 0, ACPI_DEBUG_BUFFER_SIZE);
 433  438  
 434  439      /* Initial scope is the root */
 435  440  
 436      -    AcpiGbl_DbScopeBuf [0] = '\\';
      441 +    AcpiGbl_DbScopeBuf [0] = AML_ROOT_PREFIX;
 437  442      AcpiGbl_DbScopeBuf [1] =  0;
 438  443      AcpiGbl_DbScopeNode = AcpiGbl_RootNode;
 439  444  
 440  445      /*
 441  446       * If configured for multi-thread support, the debug executor runs in
 442  447       * a separate thread so that the front end can be in another address
 443  448       * space, environment, or even another machine.
 444  449       */
 445  450      if (AcpiGbl_DebuggerConfiguration & DEBUGGER_MULTI_THREADED)
 446  451      {
 447  452          /* These were created with one unit, grab it */
 448  453  
 449  454          Status = AcpiUtAcquireMutex (ACPI_MTX_DEBUG_CMD_COMPLETE);
 450  455          if (ACPI_FAILURE (Status))
 451  456          {
 452  457              AcpiOsPrintf ("Could not get debugger mutex\n");
 453      -            return (Status);
      458 +            return_ACPI_STATUS (Status);
 454  459          }
 455  460  
 456  461          Status = AcpiUtAcquireMutex (ACPI_MTX_DEBUG_CMD_READY);
 457  462          if (ACPI_FAILURE (Status))
 458  463          {
 459  464              AcpiOsPrintf ("Could not get debugger mutex\n");
 460      -            return (Status);
      465 +            return_ACPI_STATUS (Status);
 461  466          }
 462  467  
 463  468          /* Create the debug execution thread to execute commands */
 464  469  
 465  470          Status = AcpiOsExecute (OSL_DEBUGGER_THREAD, AcpiDbExecuteThread, NULL);
 466  471          if (ACPI_FAILURE (Status))
 467  472          {
 468      -            AcpiOsPrintf ("Could not start debugger thread\n");
 469      -            return (Status);
      473 +            ACPI_EXCEPTION ((AE_INFO, Status, "Could not start debugger thread"));
      474 +            return_ACPI_STATUS (Status);
 470  475          }
 471  476      }
 472  477  
 473  478      if (!AcpiGbl_DbOpt_verbose)
 474  479      {
 475  480          AcpiGbl_DbOpt_disasm = TRUE;
 476  481          AcpiGbl_DbOpt_stats = FALSE;
 477  482      }
 478  483  
 479      -    return (AE_OK);
      484 +    return_ACPI_STATUS (AE_OK);
 480  485  }
 481  486  
 482  487  
 483  488  /*******************************************************************************
 484  489   *
 485  490   * FUNCTION:    AcpiDbTerminate
 486  491   *
 487  492   * PARAMETERS:  None
 488  493   *
 489  494   * RETURN:      None
↓ open down ↓ 3 lines elided ↑ open up ↑
 493  498   ******************************************************************************/
 494  499  
 495  500  void
 496  501  AcpiDbTerminate (
 497  502      void)
 498  503  {
 499  504  
 500  505      if (AcpiGbl_DbBuffer)
 501  506      {
 502  507          AcpiOsFree (AcpiGbl_DbBuffer);
      508 +        AcpiGbl_DbBuffer = NULL;
 503  509      }
      510 +
      511 +    /* Ensure that debug output is now disabled */
      512 +
      513 +    AcpiGbl_DbOutputFlags = ACPI_DB_DISABLE_OUTPUT;
 504  514  }
 505  515  
 506  516  
 507  517  #ifdef ACPI_OBSOLETE_FUNCTIONS
 508  518  /*******************************************************************************
 509  519   *
 510  520   * FUNCTION:    AcpiDbMethodEnd
 511  521   *
 512  522   * PARAMETERS:  WalkState       - Current walk
 513  523   *
↓ open down ↓ 23 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX