Print this page
PSARC 2009/104 Hot-Plug Support for ACPI-based Systems
6846955 Device tree creation and acpi virtual nexus driver for acpi based x86 systems
6849408 device match rule in ppm.conf is not flexible

Split Close
Expand all
Collapse all
          --- old/usr/src/uts/common/io/ppm/ppm_subr.c
          +++ new/usr/src/uts/common/io/ppm/ppm_subr.c
↓ open down ↓ 11 lines elided ↑ open up ↑
  12   12   *
  13   13   * When distributing Covered Code, include this CDDL HEADER in each
  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      - * Copyright 2007 Sun Microsystems, Inc.  All rights reserved.
       22 + * Copyright 2009 Sun Microsystems, Inc.  All rights reserved.
  23   23   * Use is subject to license terms.
  24   24   */
  25   25  
  26      -#pragma ident   "%Z%%M% %I%     %E% SMI"
  27      -
  28   26  /*
  29   27   * ppm driver subroutines
  30   28   */
  31   29  
  32   30  #include <sys/open.h>
  33   31  #include <sys/file.h>
  34   32  #include <sys/conf.h>
  35   33  #include <sys/epm.h>
  36   34  #include <sys/sunldi.h>
  37   35  #include <sys/ppmvar.h>
↓ open down ↓ 354 lines elided ↑ open up ↑
 392  390  
 393  391  /*
 394  392   * scan conf devices within each domain for a matching device name
 395  393   */
 396  394  ppm_domain_t *
 397  395  ppm_lookup_dev(dev_info_t *dip)
 398  396  {
 399  397          char path[MAXNAMELEN];
 400  398          ppm_domain_t *domp;
 401  399          ppm_db_t *dbp;
      400 +#ifdef  __x86
      401 +        char *devtype = NULL;
      402 +#endif  /* __x86 */
 402  403  
 403  404          PPM_GET_PATHNAME(dip, path);
 404  405          for (domp = ppm_domain_p; domp; domp = domp->next) {
 405  406                  if (PPM_DOMAIN_UP(domp)) {
 406  407                          for (dbp = domp->conflist; dbp; dbp = dbp->next) {
 407  408                                  /*
 408  409                                   * allow claiming root without knowing
 409  410                                   * its full name
 410  411                                   */
 411  412                                  if (dip == ddi_root_node() &&
 412  413                                      strcmp(dbp->name, "/") == 0)
 413  414                                          return (domp);
      415 +
      416 +#ifdef  __x86
      417 +                                /*
      418 +                                 * Special rule to catch all CPU devices on x86.
      419 +                                 */
      420 +                                if (domp->model == PPMD_CPU &&
      421 +                                    strcmp(dbp->name, "/") == 0 &&
      422 +                                    ddi_prop_lookup_string(DDI_DEV_T_ANY, dip,
      423 +                                    DDI_PROP_DONTPASS, "device_type",
      424 +                                    &devtype) == DDI_SUCCESS) {
      425 +                                        if (strcmp(devtype, "cpu") == 0) {
      426 +                                                ddi_prop_free(devtype);
      427 +                                                return (domp);
      428 +                                        } else {
      429 +                                                ddi_prop_free(devtype);
      430 +                                        }
      431 +                                }
      432 +#endif  /* __x86 */
      433 +
 414  434                                  if (ppm_match_devs(path, dbp) == 0)
 415  435                                          return (domp);
 416  436                          }
 417  437                  }
 418  438          }
 419  439  
 420  440          return (NULL);
 421  441  }
 422  442  
 423  443  
↓ open down ↓ 984 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX