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

Split Close
Expand all
Collapse all
          --- old/usr/src/uts/intel/io/acpica/resources/rsutils.c
          +++ new/usr/src/common/acpica/components/resources/rsutils.c
   1    1  /*******************************************************************************
   2    2   *
   3    3   * Module Name: rsutils - Utilities for the resource manager
   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 ↓ 147 lines elided ↑ open up ↑
 166  166  
 167  167      for (i = 0; i < ItemCount; i++)
 168  168      {
 169  169          switch (MoveType)
 170  170          {
 171  171          /*
 172  172           * For the 8-bit case, we can perform the move all at once
 173  173           * since there are no alignment or endian issues
 174  174           */
 175  175          case ACPI_RSC_MOVE8:
      176 +        case ACPI_RSC_MOVE_GPIO_RES:
      177 +        case ACPI_RSC_MOVE_SERIAL_VEN:
      178 +        case ACPI_RSC_MOVE_SERIAL_RES:
      179 +
 176  180              ACPI_MEMCPY (Destination, Source, ItemCount);
 177  181              return;
 178  182  
 179  183          /*
 180  184           * 16-, 32-, and 64-bit cases must use the move macros that perform
 181      -         * endian conversion and/or accomodate hardware that cannot perform
      185 +         * endian conversion and/or accommodate hardware that cannot perform
 182  186           * misaligned memory transfers
 183  187           */
 184  188          case ACPI_RSC_MOVE16:
      189 +        case ACPI_RSC_MOVE_GPIO_PIN:
      190 +
 185  191              ACPI_MOVE_16_TO_16 (&ACPI_CAST_PTR (UINT16, Destination)[i],
 186  192                                  &ACPI_CAST_PTR (UINT16, Source)[i]);
 187  193              break;
 188  194  
 189  195          case ACPI_RSC_MOVE32:
      196 +
 190  197              ACPI_MOVE_32_TO_32 (&ACPI_CAST_PTR (UINT32, Destination)[i],
 191  198                                  &ACPI_CAST_PTR (UINT32, Source)[i]);
 192  199              break;
 193  200  
 194  201          case ACPI_RSC_MOVE64:
      202 +
 195  203              ACPI_MOVE_64_TO_64 (&ACPI_CAST_PTR (UINT64, Destination)[i],
 196  204                                  &ACPI_CAST_PTR (UINT64, Source)[i]);
 197  205              break;
 198  206  
 199  207          default:
      208 +
 200  209              return;
 201  210          }
 202  211      }
 203  212  }
 204  213  
 205  214  
 206  215  /*******************************************************************************
 207  216   *
 208  217   * FUNCTION:    AcpiRsSetResourceLength
 209  218   *
↓ open down ↓ 436 lines elided ↑ open up ↑
 646  655  
 647  656      /* On exit, we must delete the object returned by evaluateObject */
 648  657  
 649  658      AcpiUtRemoveReference (ObjDesc);
 650  659      return_ACPI_STATUS (Status);
 651  660  }
 652  661  
 653  662  
 654  663  /*******************************************************************************
 655  664   *
      665 + * FUNCTION:    AcpiRsGetAeiMethodData
      666 + *
      667 + * PARAMETERS:  Node            - Device node
      668 + *              RetBuffer       - Pointer to a buffer structure for the
      669 + *                                results
      670 + *
      671 + * RETURN:      Status
      672 + *
      673 + * DESCRIPTION: This function is called to get the _AEI value of an object
      674 + *              contained in an object specified by the handle passed in
      675 + *
      676 + *              If the function fails an appropriate status will be returned
      677 + *              and the contents of the callers buffer is undefined.
      678 + *
      679 + ******************************************************************************/
      680 +
      681 +ACPI_STATUS
      682 +AcpiRsGetAeiMethodData (
      683 +    ACPI_NAMESPACE_NODE     *Node,
      684 +    ACPI_BUFFER             *RetBuffer)
      685 +{
      686 +    ACPI_OPERAND_OBJECT     *ObjDesc;
      687 +    ACPI_STATUS             Status;
      688 +
      689 +
      690 +    ACPI_FUNCTION_TRACE (RsGetAeiMethodData);
      691 +
      692 +
      693 +    /* Parameters guaranteed valid by caller */
      694 +
      695 +    /* Execute the method, no parameters */
      696 +
      697 +    Status = AcpiUtEvaluateObject (Node, METHOD_NAME__AEI,
      698 +                ACPI_BTYPE_BUFFER, &ObjDesc);
      699 +    if (ACPI_FAILURE (Status))
      700 +    {
      701 +        return_ACPI_STATUS (Status);
      702 +    }
      703 +
      704 +    /*
      705 +     * Make the call to create a resource linked list from the
      706 +     * byte stream buffer that comes back from the _CRS method
      707 +     * execution.
      708 +     */
      709 +    Status = AcpiRsCreateResourceList (ObjDesc, RetBuffer);
      710 +
      711 +    /* On exit, we must delete the object returned by evaluateObject */
      712 +
      713 +    AcpiUtRemoveReference (ObjDesc);
      714 +    return_ACPI_STATUS (Status);
      715 +}
      716 +
      717 +
      718 +/*******************************************************************************
      719 + *
 656  720   * FUNCTION:    AcpiRsGetMethodData
 657  721   *
 658  722   * PARAMETERS:  Handle          - Handle to the containing object
 659  723   *              Path            - Path to method, relative to Handle
 660  724   *              RetBuffer       - Pointer to a buffer structure for the
 661  725   *                                results
 662  726   *
 663  727   * RETURN:      Status
 664  728   *
 665  729   * DESCRIPTION: This function is called to get the _CRS or _PRS value of an
↓ open down ↓ 14 lines elided ↑ open up ↑
 680  744      ACPI_STATUS             Status;
 681  745  
 682  746  
 683  747      ACPI_FUNCTION_TRACE (RsGetMethodData);
 684  748  
 685  749  
 686  750      /* Parameters guaranteed valid by caller */
 687  751  
 688  752      /* Execute the method, no parameters */
 689  753  
 690      -    Status = AcpiUtEvaluateObject (Handle, Path, ACPI_BTYPE_BUFFER, &ObjDesc);
      754 +    Status = AcpiUtEvaluateObject (ACPI_CAST_PTR (ACPI_NAMESPACE_NODE, Handle),
      755 +        Path, ACPI_BTYPE_BUFFER, &ObjDesc);
 691  756      if (ACPI_FAILURE (Status))
 692  757      {
 693  758          return_ACPI_STATUS (Status);
 694  759      }
 695  760  
 696  761      /*
 697  762       * Make the call to create a resource linked list from the
 698  763       * byte stream buffer that comes back from the method
 699  764       * execution.
 700  765       */
↓ open down ↓ 42 lines elided ↑ open up ↑
 743  808  
 744  809      /* Allocate and initialize the evaluation information block */
 745  810  
 746  811      Info = ACPI_ALLOCATE_ZEROED (sizeof (ACPI_EVALUATE_INFO));
 747  812      if (!Info)
 748  813      {
 749  814          return_ACPI_STATUS (AE_NO_MEMORY);
 750  815      }
 751  816  
 752  817      Info->PrefixNode = Node;
 753      -    Info->Pathname = METHOD_NAME__SRS;
      818 +    Info->RelativePathname = METHOD_NAME__SRS;
 754  819      Info->Parameters = Args;
 755  820      Info->Flags = ACPI_IGNORE_RETURN_VALUE;
 756  821  
 757  822      /*
 758  823       * The InBuffer parameter will point to a linked list of
 759  824       * resource parameters. It needs to be formatted into a
 760  825       * byte stream to be sent in as an input parameter to _SRS
 761  826       *
 762  827       * Convert the linked list into a byte stream
 763  828       */
 764  829      Buffer.Length = ACPI_ALLOCATE_LOCAL_BUFFER;
 765      -    Status = AcpiRsCreateAmlResources (InBuffer->Pointer, &Buffer);
      830 +    Status = AcpiRsCreateAmlResources (InBuffer, &Buffer);
 766  831      if (ACPI_FAILURE (Status))
 767  832      {
 768  833          goto Cleanup;
 769  834      }
 770  835  
 771  836      /* Create and initialize the method parameter object */
 772  837  
 773  838      Args[0] = AcpiUtCreateInternalObject (ACPI_TYPE_BUFFER);
 774  839      if (!Args[0])
 775  840      {
↓ open down ↓ 16 lines elided ↑ open up ↑
 792  857      Status = AcpiNsEvaluate (Info);
 793  858  
 794  859      /* Clean up and return the status from AcpiNsEvaluate */
 795  860  
 796  861      AcpiUtRemoveReference (Args[0]);
 797  862  
 798  863  Cleanup:
 799  864      ACPI_FREE (Info);
 800  865      return_ACPI_STATUS (Status);
 801  866  }
 802      -
    
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX