Print this page
acpica-unix2-20130823
PANKOVs restructure

Split Close
Expand all
Collapse all
          --- old/usr/src/uts/intel/io/acpica/resources/rsinfo.c
          +++ new/usr/src/common/acpica/components/resources/rsinfo.c
   1    1  /*******************************************************************************
   2    2   *
   3    3   * Module Name: rsinfo - Dispatch and Info tables
   4    4   *
   5    5   ******************************************************************************/
   6    6  
   7    7  /*
   8      - * Copyright (C) 2000 - 2011, Intel Corp.
        8 + * Copyright (C) 2000 - 2013, 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 ↓ 56 lines elided ↑ open up ↑
  75   75      AcpiRsSetVendor,                /* 0x06, ACPI_RESOURCE_TYPE_VENDOR */
  76   76      AcpiRsConvertEndTag,            /* 0x07, ACPI_RESOURCE_TYPE_END_TAG */
  77   77      AcpiRsConvertMemory24,          /* 0x08, ACPI_RESOURCE_TYPE_MEMORY24 */
  78   78      AcpiRsConvertMemory32,          /* 0x09, ACPI_RESOURCE_TYPE_MEMORY32 */
  79   79      AcpiRsConvertFixedMemory32,     /* 0x0A, ACPI_RESOURCE_TYPE_FIXED_MEMORY32 */
  80   80      AcpiRsConvertAddress16,         /* 0x0B, ACPI_RESOURCE_TYPE_ADDRESS16 */
  81   81      AcpiRsConvertAddress32,         /* 0x0C, ACPI_RESOURCE_TYPE_ADDRESS32 */
  82   82      AcpiRsConvertAddress64,         /* 0x0D, ACPI_RESOURCE_TYPE_ADDRESS64 */
  83   83      AcpiRsConvertExtAddress64,      /* 0x0E, ACPI_RESOURCE_TYPE_EXTENDED_ADDRESS64 */
  84   84      AcpiRsConvertExtIrq,            /* 0x0F, ACPI_RESOURCE_TYPE_EXTENDED_IRQ */
  85      -    AcpiRsConvertGenericReg         /* 0x10, ACPI_RESOURCE_TYPE_GENERIC_REGISTER */
       85 +    AcpiRsConvertGenericReg,        /* 0x10, ACPI_RESOURCE_TYPE_GENERIC_REGISTER */
       86 +    AcpiRsConvertGpio,              /* 0x11, ACPI_RESOURCE_TYPE_GPIO */
       87 +    AcpiRsConvertFixedDma,          /* 0x12, ACPI_RESOURCE_TYPE_FIXED_DMA */
       88 +    NULL,                           /* 0x13, ACPI_RESOURCE_TYPE_SERIAL_BUS - Use subtype table below */
  86   89  };
  87   90  
  88   91  /* Dispatch tables for AML-to-resource (Get Resource) conversion functions */
  89   92  
  90   93  ACPI_RSCONVERT_INFO         *AcpiGbl_GetResourceDispatch[] =
  91   94  {
  92   95      /* Small descriptors */
  93   96  
  94   97      NULL,                           /* 0x00, Reserved */
  95   98      NULL,                           /* 0x01, Reserved */
  96   99      NULL,                           /* 0x02, Reserved */
  97  100      NULL,                           /* 0x03, Reserved */
  98  101      AcpiRsGetIrq,                   /* 0x04, ACPI_RESOURCE_NAME_IRQ */
  99  102      AcpiRsConvertDma,               /* 0x05, ACPI_RESOURCE_NAME_DMA */
 100  103      AcpiRsGetStartDpf,              /* 0x06, ACPI_RESOURCE_NAME_START_DEPENDENT */
 101  104      AcpiRsConvertEndDpf,            /* 0x07, ACPI_RESOURCE_NAME_END_DEPENDENT */
 102  105      AcpiRsConvertIo,                /* 0x08, ACPI_RESOURCE_NAME_IO */
 103  106      AcpiRsConvertFixedIo,           /* 0x09, ACPI_RESOURCE_NAME_FIXED_IO */
 104      -    NULL,                           /* 0x0A, Reserved */
      107 +    AcpiRsConvertFixedDma,          /* 0x0A, ACPI_RESOURCE_NAME_FIXED_DMA */
 105  108      NULL,                           /* 0x0B, Reserved */
 106  109      NULL,                           /* 0x0C, Reserved */
 107  110      NULL,                           /* 0x0D, Reserved */
 108  111      AcpiRsGetVendorSmall,           /* 0x0E, ACPI_RESOURCE_NAME_VENDOR_SMALL */
 109  112      AcpiRsConvertEndTag,            /* 0x0F, ACPI_RESOURCE_NAME_END_TAG */
 110  113  
 111  114      /* Large descriptors */
 112  115  
 113  116      NULL,                           /* 0x00, Reserved */
 114  117      AcpiRsConvertMemory24,          /* 0x01, ACPI_RESOURCE_NAME_MEMORY24 */
 115  118      AcpiRsConvertGenericReg,        /* 0x02, ACPI_RESOURCE_NAME_GENERIC_REGISTER */
 116  119      NULL,                           /* 0x03, Reserved */
 117  120      AcpiRsGetVendorLarge,           /* 0x04, ACPI_RESOURCE_NAME_VENDOR_LARGE */
 118  121      AcpiRsConvertMemory32,          /* 0x05, ACPI_RESOURCE_NAME_MEMORY32 */
 119  122      AcpiRsConvertFixedMemory32,     /* 0x06, ACPI_RESOURCE_NAME_FIXED_MEMORY32 */
 120  123      AcpiRsConvertAddress32,         /* 0x07, ACPI_RESOURCE_NAME_ADDRESS32 */
 121  124      AcpiRsConvertAddress16,         /* 0x08, ACPI_RESOURCE_NAME_ADDRESS16 */
 122  125      AcpiRsConvertExtIrq,            /* 0x09, ACPI_RESOURCE_NAME_EXTENDED_IRQ */
 123  126      AcpiRsConvertAddress64,         /* 0x0A, ACPI_RESOURCE_NAME_ADDRESS64 */
 124      -    AcpiRsConvertExtAddress64       /* 0x0B, ACPI_RESOURCE_NAME_EXTENDED_ADDRESS64 */
      127 +    AcpiRsConvertExtAddress64,      /* 0x0B, ACPI_RESOURCE_NAME_EXTENDED_ADDRESS64 */
      128 +    AcpiRsConvertGpio,              /* 0x0C, ACPI_RESOURCE_NAME_GPIO */
      129 +    NULL,                           /* 0x0D, Reserved */
      130 +    NULL,                           /* 0x0E, ACPI_RESOURCE_NAME_SERIAL_BUS - Use subtype table below */
 125  131  };
 126  132  
      133 +/* Subtype table for SerialBus -- I2C, SPI, and UART */
 127  134  
      135 +ACPI_RSCONVERT_INFO         *AcpiGbl_ConvertResourceSerialBusDispatch[] =
      136 +{
      137 +    NULL,
      138 +    AcpiRsConvertI2cSerialBus,
      139 +    AcpiRsConvertSpiSerialBus,
      140 +    AcpiRsConvertUartSerialBus,
      141 +};
      142 +
      143 +
 128  144  #if defined(ACPI_DEBUG_OUTPUT) || defined(ACPI_DEBUGGER)
 129  145  
 130  146  /* Dispatch table for resource dump functions */
 131  147  
 132  148  ACPI_RSDUMP_INFO            *AcpiGbl_DumpResourceDispatch[] =
 133  149  {
 134  150      AcpiRsDumpIrq,                  /* ACPI_RESOURCE_TYPE_IRQ */
 135  151      AcpiRsDumpDma,                  /* ACPI_RESOURCE_TYPE_DMA */
 136  152      AcpiRsDumpStartDpf,             /* ACPI_RESOURCE_TYPE_START_DEPENDENT */
 137  153      AcpiRsDumpEndDpf,               /* ACPI_RESOURCE_TYPE_END_DEPENDENT */
↓ open down ↓ 3 lines elided ↑ open up ↑
 141  157      AcpiRsDumpEndTag,               /* ACPI_RESOURCE_TYPE_END_TAG */
 142  158      AcpiRsDumpMemory24,             /* ACPI_RESOURCE_TYPE_MEMORY24 */
 143  159      AcpiRsDumpMemory32,             /* ACPI_RESOURCE_TYPE_MEMORY32 */
 144  160      AcpiRsDumpFixedMemory32,        /* ACPI_RESOURCE_TYPE_FIXED_MEMORY32 */
 145  161      AcpiRsDumpAddress16,            /* ACPI_RESOURCE_TYPE_ADDRESS16 */
 146  162      AcpiRsDumpAddress32,            /* ACPI_RESOURCE_TYPE_ADDRESS32 */
 147  163      AcpiRsDumpAddress64,            /* ACPI_RESOURCE_TYPE_ADDRESS64 */
 148  164      AcpiRsDumpExtAddress64,         /* ACPI_RESOURCE_TYPE_EXTENDED_ADDRESS64 */
 149  165      AcpiRsDumpExtIrq,               /* ACPI_RESOURCE_TYPE_EXTENDED_IRQ */
 150  166      AcpiRsDumpGenericReg,           /* ACPI_RESOURCE_TYPE_GENERIC_REGISTER */
      167 +    AcpiRsDumpGpio,                 /* ACPI_RESOURCE_TYPE_GPIO */
      168 +    AcpiRsDumpFixedDma,             /* ACPI_RESOURCE_TYPE_FIXED_DMA */
      169 +    NULL,                           /* ACPI_RESOURCE_TYPE_SERIAL_BUS */
 151  170  };
      171 +
      172 +ACPI_RSDUMP_INFO            *AcpiGbl_DumpSerialBusDispatch[] =
      173 +{
      174 +    NULL,
      175 +    AcpiRsDumpI2cSerialBus,         /* AML_RESOURCE_I2C_BUS_TYPE */
      176 +    AcpiRsDumpSpiSerialBus,         /* AML_RESOURCE_SPI_BUS_TYPE */
      177 +    AcpiRsDumpUartSerialBus,        /* AML_RESOURCE_UART_BUS_TYPE */
      178 +};
 152  179  #endif
 153  180  
 154  181  
 155  182  /*
 156  183   * Base sizes for external AML resource descriptors, indexed by internal type.
 157  184   * Includes size of the descriptor header (1 byte for small descriptors,
 158  185   * 3 bytes for large descriptors)
 159  186   */
 160  187  const UINT8                 AcpiGbl_AmlResourceSizes[] =
 161  188  {
↓ open down ↓ 6 lines elided ↑ open up ↑
 168  195      sizeof (AML_RESOURCE_VENDOR_SMALL),     /* ACPI_RESOURCE_TYPE_VENDOR */
 169  196      sizeof (AML_RESOURCE_END_TAG),          /* ACPI_RESOURCE_TYPE_END_TAG */
 170  197      sizeof (AML_RESOURCE_MEMORY24),         /* ACPI_RESOURCE_TYPE_MEMORY24 */
 171  198      sizeof (AML_RESOURCE_MEMORY32),         /* ACPI_RESOURCE_TYPE_MEMORY32 */
 172  199      sizeof (AML_RESOURCE_FIXED_MEMORY32),   /* ACPI_RESOURCE_TYPE_FIXED_MEMORY32 */
 173  200      sizeof (AML_RESOURCE_ADDRESS16),        /* ACPI_RESOURCE_TYPE_ADDRESS16 */
 174  201      sizeof (AML_RESOURCE_ADDRESS32),        /* ACPI_RESOURCE_TYPE_ADDRESS32 */
 175  202      sizeof (AML_RESOURCE_ADDRESS64),        /* ACPI_RESOURCE_TYPE_ADDRESS64 */
 176  203      sizeof (AML_RESOURCE_EXTENDED_ADDRESS64),/*ACPI_RESOURCE_TYPE_EXTENDED_ADDRESS64 */
 177  204      sizeof (AML_RESOURCE_EXTENDED_IRQ),     /* ACPI_RESOURCE_TYPE_EXTENDED_IRQ */
 178      -    sizeof (AML_RESOURCE_GENERIC_REGISTER)  /* ACPI_RESOURCE_TYPE_GENERIC_REGISTER */
      205 +    sizeof (AML_RESOURCE_GENERIC_REGISTER), /* ACPI_RESOURCE_TYPE_GENERIC_REGISTER */
      206 +    sizeof (AML_RESOURCE_GPIO),             /* ACPI_RESOURCE_TYPE_GPIO */
      207 +    sizeof (AML_RESOURCE_FIXED_DMA),        /* ACPI_RESOURCE_TYPE_FIXED_DMA */
      208 +    sizeof (AML_RESOURCE_COMMON_SERIALBUS), /* ACPI_RESOURCE_TYPE_SERIAL_BUS */
 179  209  };
 180  210  
 181  211  
 182  212  const UINT8                 AcpiGbl_ResourceStructSizes[] =
 183  213  {
 184  214      /* Small descriptors */
 185  215  
 186  216      0,
 187  217      0,
 188  218      0,
 189  219      0,
 190  220      ACPI_RS_SIZE (ACPI_RESOURCE_IRQ),
 191  221      ACPI_RS_SIZE (ACPI_RESOURCE_DMA),
 192  222      ACPI_RS_SIZE (ACPI_RESOURCE_START_DEPENDENT),
 193  223      ACPI_RS_SIZE_MIN,
 194  224      ACPI_RS_SIZE (ACPI_RESOURCE_IO),
 195  225      ACPI_RS_SIZE (ACPI_RESOURCE_FIXED_IO),
      226 +    ACPI_RS_SIZE (ACPI_RESOURCE_FIXED_DMA),
 196  227      0,
 197  228      0,
 198  229      0,
 199      -    0,
 200  230      ACPI_RS_SIZE (ACPI_RESOURCE_VENDOR),
 201  231      ACPI_RS_SIZE_MIN,
 202  232  
 203  233      /* Large descriptors */
 204  234  
 205  235      0,
 206  236      ACPI_RS_SIZE (ACPI_RESOURCE_MEMORY24),
 207  237      ACPI_RS_SIZE (ACPI_RESOURCE_GENERIC_REGISTER),
 208  238      0,
 209  239      ACPI_RS_SIZE (ACPI_RESOURCE_VENDOR),
 210  240      ACPI_RS_SIZE (ACPI_RESOURCE_MEMORY32),
 211  241      ACPI_RS_SIZE (ACPI_RESOURCE_FIXED_MEMORY32),
 212  242      ACPI_RS_SIZE (ACPI_RESOURCE_ADDRESS32),
 213  243      ACPI_RS_SIZE (ACPI_RESOURCE_ADDRESS16),
 214  244      ACPI_RS_SIZE (ACPI_RESOURCE_EXTENDED_IRQ),
 215  245      ACPI_RS_SIZE (ACPI_RESOURCE_ADDRESS64),
 216      -    ACPI_RS_SIZE (ACPI_RESOURCE_EXTENDED_ADDRESS64)
      246 +    ACPI_RS_SIZE (ACPI_RESOURCE_EXTENDED_ADDRESS64),
      247 +    ACPI_RS_SIZE (ACPI_RESOURCE_GPIO),
      248 +    ACPI_RS_SIZE (ACPI_RESOURCE_COMMON_SERIALBUS)
 217  249  };
 218  250  
      251 +const UINT8                 AcpiGbl_AmlResourceSerialBusSizes[] =
      252 +{
      253 +    0,
      254 +    sizeof (AML_RESOURCE_I2C_SERIALBUS),
      255 +    sizeof (AML_RESOURCE_SPI_SERIALBUS),
      256 +    sizeof (AML_RESOURCE_UART_SERIALBUS),
      257 +};
      258 +
      259 +const UINT8                 AcpiGbl_ResourceStructSerialBusSizes[] =
      260 +{
      261 +    0,
      262 +    ACPI_RS_SIZE (ACPI_RESOURCE_I2C_SERIALBUS),
      263 +    ACPI_RS_SIZE (ACPI_RESOURCE_SPI_SERIALBUS),
      264 +    ACPI_RS_SIZE (ACPI_RESOURCE_UART_SERIALBUS),
      265 +};
    
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX