Print this page
acpica-unix2-20130823
PANKOVs restructure

Split Close
Expand all
Collapse all
          --- old/usr/src/uts/i86pc/io/pciex/npe_misc.c
          +++ new/usr/src/uts/i86pc/io/pciex/npe_misc.c
↓ open down ↓ 13 lines elided ↑ open up ↑
  14   14   * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
  15   15   * If applicable, add the following below this CDDL HEADER, with the
  16   16   * fields enclosed by brackets "[]" replaced with your own identifying
  17   17   * information: Portions Copyright [yyyy] [name of copyright owner]
  18   18   *
  19   19   * CDDL HEADER END
  20   20   */
  21   21  
  22   22  /*
  23   23   * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
       24 + * Copyright 2013 PALO, Richard. All rights reserved.
  24   25   */
  25   26  
  26   27  /*
  27   28   *      Library file that has miscellaneous support for npe(7d)
  28   29   */
  29   30  
  30   31  #include <sys/conf.h>
  31   32  #include <sys/pci.h>
  32   33  #include <sys/sunndi.h>
  33      -#include <sys/acpi/acpi.h>
  34      -#include <sys/acpi/acpi_pci.h>
       34 +#include <acpica/include/acpi.h>
  35   35  #include <sys/acpica.h>
  36   36  #include <sys/pci_cap.h>
  37   37  #include <sys/pcie_impl.h>
  38   38  #include <sys/x86_archext.h>
  39   39  #include <io/pciex/pcie_nvidia.h>
  40   40  #include <io/pciex/pcie_nb5000.h>
  41   41  #include <sys/pci_cfgacc_x86.h>
  42   42  #include <sys/cpuvar.h>
  43   43  
  44   44  /*
↓ open down ↓ 18 lines elided ↑ open up ↑
  63   63  extern uint32_t npe_aer_uce_mask;
  64   64  
  65   65  /*
  66   66   * Query the MCFG table using ACPI.  If MCFG is found, setup the
  67   67   * 'ecfg' property accordingly.  Otherwise, set the values
  68   68   * to the default values.
  69   69   */
  70   70  void
  71   71  npe_query_acpi_mcfg(dev_info_t *dip)
  72   72  {
  73      -        MCFG_TABLE *mcfgp;
  74      -        CFG_BASE_ADDR_ALLOC *cfg_baap;
       73 +        ACPI_TABLE_HEADER *mcfgp;
       74 +        ACPI_MCFG_ALLOCATION *cfg_baap;
  75   75          char *cfg_baa_endp;
  76   76          int64_t ecfginfo[4];
  77   77          int ecfg_found = 0;
  78   78  
  79   79          /* Query the MCFG table using ACPI */
  80      -        if (AcpiGetTable(ACPI_SIG_MCFG, 1,
  81      -            (ACPI_TABLE_HEADER **)&mcfgp) == AE_OK) {
       80 +        if (AcpiGetTable(ACPI_SIG_MCFG, 1, &mcfgp) == AE_OK) {
  82   81  
  83      -                cfg_baap = (CFG_BASE_ADDR_ALLOC *)mcfgp->CfgBaseAddrAllocList;
  84      -                cfg_baa_endp = ((char *)mcfgp) + mcfgp->Length;
       82 +            cfg_baap = (ACPI_MCFG_ALLOCATION *)((ACPI_TABLE_MCFG *)mcfgp + 1);
       83 +            cfg_baa_endp = ((char *)mcfgp) + mcfgp->Length;
  85   84  
  86   85                  while ((char *)cfg_baap < cfg_baa_endp) {
  87      -                        if (cfg_baap->base_addr != (uint64_t)0 &&
  88      -                            cfg_baap->segment == 0) {
       86 +                        if (cfg_baap->Address != (uint64_t)0 &&
       87 +                            cfg_baap->PciSegment == 0) {
  89   88                                  /*
  90   89                                   * Set up the 'ecfg' property to hold
  91   90                                   * base_addr, segment, and first/last bus.
  92   91                                   * We only do the first entry that maps
  93   92                                   * segment 0; nonzero segments are not yet
  94   93                                   * known, or handled.  If they appear,
  95   94                                   * we'll need to figure out which bus node
  96   95                                   * should have which entry by examining the
  97   96                                   * ACPI _SEG method on each bus node.
  98   97                                   */
  99      -                                ecfginfo[0] = cfg_baap->base_addr;
 100      -                                ecfginfo[1] = cfg_baap->segment;
 101      -                                ecfginfo[2] = cfg_baap->start_bno;
 102      -                                ecfginfo[3] = cfg_baap->end_bno;
       98 +                                ecfginfo[0] = cfg_baap->Address;
       99 +                                ecfginfo[1] = cfg_baap->PciSegment;
      100 +                                ecfginfo[2] = cfg_baap->StartBusNumber;
      101 +                                ecfginfo[3] = cfg_baap->EndBusNumber;
 103  102                                  (void) ndi_prop_update_int64_array(
 104  103                                      DDI_DEV_T_NONE, dip, "ecfg",
 105  104                                      ecfginfo, 4);
 106  105                                  ecfg_found = 1;
 107  106                                  break;
 108  107                          }
 109  108                          cfg_baap++;
 110  109                  }
 111  110          }
 112  111          if (ecfg_found)
↓ open down ↓ 294 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX