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 /*
23 * Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
24 */
25
26 /*
27 * PSMI 1.1 extensions are supported only in 2.6 and later versions.
28 * PSMI 1.2 extensions are supported only in 2.7 and later versions.
29 * PSMI 1.3 and 1.4 extensions are supported in Solaris 10.
30 * PSMI 1.5 extensions are supported in Solaris Nevada.
31 * PSMI 1.6 extensions are supported in Solaris Nevada.
32 * PSMI 1.7 extensions are supported in Solaris Nevada.
33 */
34 #define PSMI_1_7
35
36 #include <sys/processor.h>
37 #include <sys/time.h>
38 #include <sys/psm.h>
39 #include <sys/smp_impldefs.h>
40 #include <sys/cram.h>
41 #include <sys/acpi/acpi.h>
42 #include <sys/acpica.h>
43 #include <sys/psm_common.h>
44 #include <sys/apic.h>
1334 /* If no APIC direct method, we will try using ACPI */
1335 if (apic_enable_acpi) {
1336 if (acpi_poweroff() == 1)
1337 return;
1338 } else
1339 return;
1340
1341 break;
1342 }
1343 /*
1344 * Wait a limited time here for power to go off.
1345 * If the power does not go off, then there was a
1346 * problem and we should continue to the halt which
1347 * prints a message for the user to press a key to
1348 * reboot.
1349 */
1350 drv_usecwait(7000000); /* wait seven seconds */
1351
1352 }
1353
1354 ddi_periodic_t apic_periodic_id;
1355
1356 /*
1357 * The following functions are in the platform specific file so that they
1358 * can be different functions depending on whether we are running on
1359 * bare metal or a hypervisor.
1360 */
1361
1362 /*
1363 * map an apic for memory-mapped access
1364 */
1365 uint32_t *
1366 mapin_apic(uint32_t addr, size_t len, int flags)
1367 {
1368 return ((void *)psm_map_phys(addr, len, flags));
1369 }
1370
1371 uint32_t *
1372 mapin_ioapic(uint32_t addr, size_t len, int flags)
1373 {
1374 return (mapin_apic(addr, len, flags));
|
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 /*
23 * Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
24 */
25 /*
26 * Copyright (c) 2013, Joyent, Inc. All rights reserved.
27 */
28
29 /*
30 * PSMI 1.1 extensions are supported only in 2.6 and later versions.
31 * PSMI 1.2 extensions are supported only in 2.7 and later versions.
32 * PSMI 1.3 and 1.4 extensions are supported in Solaris 10.
33 * PSMI 1.5 extensions are supported in Solaris Nevada.
34 * PSMI 1.6 extensions are supported in Solaris Nevada.
35 * PSMI 1.7 extensions are supported in Solaris Nevada.
36 */
37 #define PSMI_1_7
38
39 #include <sys/processor.h>
40 #include <sys/time.h>
41 #include <sys/psm.h>
42 #include <sys/smp_impldefs.h>
43 #include <sys/cram.h>
44 #include <sys/acpi/acpi.h>
45 #include <sys/acpica.h>
46 #include <sys/psm_common.h>
47 #include <sys/apic.h>
1337 /* If no APIC direct method, we will try using ACPI */
1338 if (apic_enable_acpi) {
1339 if (acpi_poweroff() == 1)
1340 return;
1341 } else
1342 return;
1343
1344 break;
1345 }
1346 /*
1347 * Wait a limited time here for power to go off.
1348 * If the power does not go off, then there was a
1349 * problem and we should continue to the halt which
1350 * prints a message for the user to press a key to
1351 * reboot.
1352 */
1353 drv_usecwait(7000000); /* wait seven seconds */
1354
1355 }
1356
1357 cyclic_id_t apic_cyclic_id;
1358
1359 /*
1360 * The following functions are in the platform specific file so that they
1361 * can be different functions depending on whether we are running on
1362 * bare metal or a hypervisor.
1363 */
1364
1365 /*
1366 * map an apic for memory-mapped access
1367 */
1368 uint32_t *
1369 mapin_apic(uint32_t addr, size_t len, int flags)
1370 {
1371 return ((void *)psm_map_phys(addr, len, flags));
1372 }
1373
1374 uint32_t *
1375 mapin_ioapic(uint32_t addr, size_t len, int flags)
1376 {
1377 return (mapin_apic(addr, len, flags));
|