Print this page
8626 make pcplusmp and apix warning-free
Reviewed by: Robert Mustacchi <rm@joyent.com>
Reviewed by: Jerry Jelinek <jerry.jelinek@joyent.com>


   5  * Common Development and Distribution License (the "License").
   6  * You may not use this file except in compliance with the License.
   7  *
   8  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
   9  * or http://www.opensolaris.org/os/licensing.
  10  * See the License for the specific language governing permissions
  11  * and limitations under the License.
  12  *
  13  * When distributing Covered Code, include this CDDL HEADER in each
  14  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
  15  * If applicable, add the following below this CDDL HEADER, with the
  16  * fields enclosed by brackets "[]" replaced with your own identifying
  17  * information: Portions Copyright [yyyy] [name of copyright owner]
  18  *
  19  * CDDL HEADER END
  20  */
  21 /*
  22  * Copyright (c) 2007, 2010, Oracle and/or its affiliates. All rights reserved.
  23  * Copyright 2016 Nexenta Systems, Inc.
  24  * Copyright (c) 2017 by Delphix. All rights reserved.

  25  */
  26 /*
  27  * Copyright (c) 2010, Intel Corporation.
  28  * All rights reserved.
  29  */
  30 
  31 /*
  32  * PSMI 1.1 extensions are supported only in 2.6 and later versions.
  33  * PSMI 1.2 extensions are supported only in 2.7 and later versions.
  34  * PSMI 1.3 and 1.4 extensions are supported in Solaris 10.
  35  * PSMI 1.5 extensions are supported in Solaris Nevada.
  36  * PSMI 1.6 extensions are supported in Solaris Nevada.
  37  * PSMI 1.7 extensions are supported in Solaris Nevada.
  38  */
  39 #define PSMI_1_7
  40 
  41 #include <sys/processor.h>
  42 #include <sys/time.h>
  43 #include <sys/psm.h>
  44 #include <sys/smp_impldefs.h>


 313  * Auto-configuration routines
 314  */
 315 
 316 /*
 317  * Look at MPSpec 1.4 (Intel Order # 242016-005) for details of what we do here
 318  * May work with 1.1 - but not guaranteed.
 319  * According to the MP Spec, the MP floating pointer structure
 320  * will be searched in the order described below:
 321  * 1. In the first kilobyte of Extended BIOS Data Area (EBDA)
 322  * 2. Within the last kilobyte of system base memory
 323  * 3. In the BIOS ROM address space between 0F0000h and 0FFFFh
 324  * Once we find the right signature with proper checksum, we call
 325  * either handle_defconf or parse_mpct to get all info necessary for
 326  * subsequent operations.
 327  */
 328 int
 329 apic_probe_common(char *modname)
 330 {
 331         uint32_t mpct_addr, ebda_start = 0, base_mem_end;
 332         caddr_t biosdatap;
 333         caddr_t mpct = 0;
 334         caddr_t fptr;
 335         int     i, mpct_size, mapsize, retval = PSM_FAILURE;
 336         ushort_t        ebda_seg, base_mem_size;
 337         struct  apic_mpfps_hdr  *fpsp;
 338         struct  apic_mp_cnf_hdr *hdrp;
 339         int bypass_cpu_and_ioapics_in_mptables;
 340         int acpi_user_options;
 341 
 342         if (apic_forceload < 0)
 343                 return (retval);
 344 
 345         /*
 346          * Remember who we are
 347          */
 348         psm_name = modname;
 349 
 350         /* Allow override for MADT-only mode */
 351         acpi_user_options = ddi_prop_get_int(DDI_DEV_T_ANY, ddi_root_node(), 0,
 352             "acpi-user-options", 0);
 353         apic_use_acpi_madt_only = ((acpi_user_options & ACPI_OUSER_MADT) != 0);
 354 
 355         /* Allow apic_use_acpi to override MADT-only mode */




   5  * Common Development and Distribution License (the "License").
   6  * You may not use this file except in compliance with the License.
   7  *
   8  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
   9  * or http://www.opensolaris.org/os/licensing.
  10  * See the License for the specific language governing permissions
  11  * and limitations under the License.
  12  *
  13  * When distributing Covered Code, include this CDDL HEADER in each
  14  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
  15  * If applicable, add the following below this CDDL HEADER, with the
  16  * fields enclosed by brackets "[]" replaced with your own identifying
  17  * information: Portions Copyright [yyyy] [name of copyright owner]
  18  *
  19  * CDDL HEADER END
  20  */
  21 /*
  22  * Copyright (c) 2007, 2010, Oracle and/or its affiliates. All rights reserved.
  23  * Copyright 2016 Nexenta Systems, Inc.
  24  * Copyright (c) 2017 by Delphix. All rights reserved.
  25  * Copyright 2017 Joyent, Inc.
  26  */
  27 /*
  28  * Copyright (c) 2010, Intel Corporation.
  29  * All rights reserved.
  30  */
  31 
  32 /*
  33  * PSMI 1.1 extensions are supported only in 2.6 and later versions.
  34  * PSMI 1.2 extensions are supported only in 2.7 and later versions.
  35  * PSMI 1.3 and 1.4 extensions are supported in Solaris 10.
  36  * PSMI 1.5 extensions are supported in Solaris Nevada.
  37  * PSMI 1.6 extensions are supported in Solaris Nevada.
  38  * PSMI 1.7 extensions are supported in Solaris Nevada.
  39  */
  40 #define PSMI_1_7
  41 
  42 #include <sys/processor.h>
  43 #include <sys/time.h>
  44 #include <sys/psm.h>
  45 #include <sys/smp_impldefs.h>


 314  * Auto-configuration routines
 315  */
 316 
 317 /*
 318  * Look at MPSpec 1.4 (Intel Order # 242016-005) for details of what we do here
 319  * May work with 1.1 - but not guaranteed.
 320  * According to the MP Spec, the MP floating pointer structure
 321  * will be searched in the order described below:
 322  * 1. In the first kilobyte of Extended BIOS Data Area (EBDA)
 323  * 2. Within the last kilobyte of system base memory
 324  * 3. In the BIOS ROM address space between 0F0000h and 0FFFFh
 325  * Once we find the right signature with proper checksum, we call
 326  * either handle_defconf or parse_mpct to get all info necessary for
 327  * subsequent operations.
 328  */
 329 int
 330 apic_probe_common(char *modname)
 331 {
 332         uint32_t mpct_addr, ebda_start = 0, base_mem_end;
 333         caddr_t biosdatap;
 334         caddr_t mpct = NULL;
 335         caddr_t fptr;
 336         int     i, mpct_size = 0, mapsize, retval = PSM_FAILURE;
 337         ushort_t        ebda_seg, base_mem_size;
 338         struct  apic_mpfps_hdr  *fpsp;
 339         struct  apic_mp_cnf_hdr *hdrp;
 340         int bypass_cpu_and_ioapics_in_mptables;
 341         int acpi_user_options;
 342 
 343         if (apic_forceload < 0)
 344                 return (retval);
 345 
 346         /*
 347          * Remember who we are
 348          */
 349         psm_name = modname;
 350 
 351         /* Allow override for MADT-only mode */
 352         acpi_user_options = ddi_prop_get_int(DDI_DEV_T_ANY, ddi_root_node(), 0,
 353             "acpi-user-options", 0);
 354         apic_use_acpi_madt_only = ((acpi_user_options & ACPI_OUSER_MADT) != 0);
 355 
 356         /* Allow apic_use_acpi to override MADT-only mode */