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

Split Close
Expand all
Collapse all
          --- old/usr/src/uts/intel/io/acpica/executer/exregion.c
          +++ new/usr/src/common/acpica/components/executer/exregion.c
   1      -
   2    1  /******************************************************************************
   3    2   *
   4    3   * Module Name: exregion - ACPI default OpRegion (address space) handlers
   5    4   *
   6    5   *****************************************************************************/
   7    6  
   8    7  /*
   9      - * Copyright (C) 2000 - 2011, Intel Corp.
        8 + * Copyright (C) 2000 - 2014, Intel Corp.
  10    9   * All rights reserved.
  11   10   *
  12   11   * Redistribution and use in source and binary forms, with or without
  13   12   * modification, are permitted provided that the following conditions
  14   13   * are met:
  15   14   * 1. Redistributions of source code must retain the above copyright
  16   15   *    notice, this list of conditions, and the following disclaimer,
  17   16   *    without modification.
  18   17   * 2. Redistributions in binary form must reproduce at minimum a disclaimer
  19   18   *    substantially similar to the "NO WARRANTY" disclaimer below
↓ open down ↓ 73 lines elided ↑ open up ↑
  93   92  
  94   93  
  95   94      ACPI_FUNCTION_TRACE (ExSystemMemorySpaceHandler);
  96   95  
  97   96  
  98   97      /* Validate and translate the bit width */
  99   98  
 100   99      switch (BitWidth)
 101  100      {
 102  101      case 8:
      102 +
 103  103          Length = 1;
 104  104          break;
 105  105  
 106  106      case 16:
      107 +
 107  108          Length = 2;
 108  109          break;
 109  110  
 110  111      case 32:
      112 +
 111  113          Length = 4;
 112  114          break;
 113  115  
 114  116      case 64:
      117 +
 115  118          Length = 8;
 116  119          break;
 117  120  
 118  121      default:
      122 +
 119  123          ACPI_ERROR ((AE_INFO, "Invalid SystemMemory width %u",
 120  124              BitWidth));
 121  125          return_ACPI_STATUS (AE_AML_OPERAND_VALUE);
 122  126      }
 123  127  
 124  128  #ifdef ACPI_MISALIGNMENT_NOT_SUPPORTED
 125  129      /*
 126  130       * Hardware does not support non-aligned data transfers, we must verify
 127  131       * the request.
 128  132       */
↓ open down ↓ 84 lines elided ↑ open up ↑
 213  217          ((UINT64) Address - (UINT64) MemInfo->MappedPhysicalAddress);
 214  218  
 215  219      ACPI_DEBUG_PRINT ((ACPI_DB_INFO,
 216  220          "System-Memory (width %u) R/W %u Address=%8.8X%8.8X\n",
 217  221          BitWidth, Function, ACPI_FORMAT_NATIVE_UINT (Address)));
 218  222  
 219  223      /*
 220  224       * Perform the memory read or write
 221  225       *
 222  226       * Note: For machines that do not support non-aligned transfers, the target
 223      -     * address was checked for alignment above.  We do not attempt to break the
      227 +     * address was checked for alignment above. We do not attempt to break the
 224  228       * transfer up into smaller (byte-size) chunks because the AML specifically
 225  229       * asked for a transfer width that the hardware may require.
 226  230       */
 227  231      switch (Function)
 228  232      {
 229  233      case ACPI_READ:
 230  234  
 231  235          *Value = 0;
 232  236          switch (BitWidth)
 233  237          {
 234  238          case 8:
      239 +
 235  240              *Value = (UINT64) ACPI_GET8 (LogicalAddrPtr);
 236  241              break;
 237  242  
 238  243          case 16:
      244 +
 239  245              *Value = (UINT64) ACPI_GET16 (LogicalAddrPtr);
 240  246              break;
 241  247  
 242  248          case 32:
      249 +
 243  250              *Value = (UINT64) ACPI_GET32 (LogicalAddrPtr);
 244  251              break;
 245  252  
 246  253          case 64:
      254 +
 247  255              *Value = (UINT64) ACPI_GET64 (LogicalAddrPtr);
 248  256              break;
 249  257  
 250  258          default:
      259 +
 251  260              /* BitWidth was already validated */
      261 +
 252  262              break;
 253  263          }
 254  264          break;
 255  265  
 256  266      case ACPI_WRITE:
 257  267  
 258  268          switch (BitWidth)
 259  269          {
 260  270          case 8:
 261      -            ACPI_SET8 (LogicalAddrPtr) = (UINT8) *Value;
      271 +
      272 +            ACPI_SET8 (LogicalAddrPtr, *Value);
 262  273              break;
 263  274  
 264  275          case 16:
 265      -            ACPI_SET16 (LogicalAddrPtr) = (UINT16) *Value;
      276 +
      277 +            ACPI_SET16 (LogicalAddrPtr, *Value);
 266  278              break;
 267  279  
 268  280          case 32:
 269      -            ACPI_SET32 ( LogicalAddrPtr) = (UINT32) *Value;
      281 +
      282 +            ACPI_SET32 (LogicalAddrPtr, *Value);
 270  283              break;
 271  284  
 272  285          case 64:
 273      -            ACPI_SET64 (LogicalAddrPtr) = (UINT64) *Value;
      286 +
      287 +            ACPI_SET64 (LogicalAddrPtr, *Value);
 274  288              break;
 275  289  
 276  290          default:
      291 +
 277  292              /* BitWidth was already validated */
      293 +
 278  294              break;
 279  295          }
 280  296          break;
 281  297  
 282  298      default:
      299 +
 283  300          Status = AE_BAD_PARAMETER;
 284  301          break;
 285  302      }
 286  303  
 287  304      return_ACPI_STATUS (Status);
 288  305  }
 289  306  
 290  307  
 291  308  /*******************************************************************************
 292  309   *
↓ open down ↓ 44 lines elided ↑ open up ↑
 337  354          *Value = Value32;
 338  355          break;
 339  356  
 340  357      case ACPI_WRITE:
 341  358  
 342  359          Status = AcpiHwWritePort ((ACPI_IO_ADDRESS) Address,
 343  360                      (UINT32) *Value, BitWidth);
 344  361          break;
 345  362  
 346  363      default:
      364 +
 347  365          Status = AE_BAD_PARAMETER;
 348  366          break;
 349  367      }
 350  368  
 351  369      return_ACPI_STATUS (Status);
 352  370  }
 353  371  
 354  372  
 355  373  /*******************************************************************************
 356  374   *
↓ open down ↓ 197 lines elided ↑ open up ↑
 554  572              ACPI_DIV_8 (BitWidth));
 555  573          break;
 556  574  
 557  575      default:
 558  576  
 559  577          return_ACPI_STATUS (AE_BAD_PARAMETER);
 560  578      }
 561  579  
 562  580      return_ACPI_STATUS (AE_OK);
 563  581  }
 564      -
 565      -
    
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX