1 /*
2 * CDDL HEADER START
3 *
4 * The contents of this file are subject to the terms of the
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) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
23 * Copyright (c) 2011, Joyent, Inc. All rights reserved.
24 * Copyright 2011 Nexenta Systems, Inc. All rights reserved.
25 */
26 /*
27 * Copyright (c) 2009, Intel Corporation.
28 * All rights reserved.
29 */
30 /*
31 * Solaris x86 ACPI CA services
32 */
33
34 #include <sys/file.h>
35 #include <sys/errno.h>
36 #include <sys/conf.h>
37 #include <sys/modctl.h>
38 #include <sys/open.h>
39 #include <sys/stat.h>
40 #include <sys/spl.h>
41 #include <sys/ddi.h>
42 #include <sys/sunddi.h>
43 #include <sys/esunddi.h>
44 #include <sys/kstat.h>
45 #include <sys/x86_archext.h>
46
47 #include <sys/acpi/acpi.h>
48 #include <sys/acpica.h>
49 #include <sys/archsystm.h>
50
51 /*
52 *
53 */
54 static struct modlmisc modlmisc = {
55 &mod_miscops,
56 "ACPI interpreter",
57 };
58
59 static struct modlinkage modlinkage = {
60 MODREV_1, /* MODREV_1 manual */
61 (void *)&modlmisc, /* module linkage */
62 NULL, /* list terminator */
63 };
64
65 /*
66 * Local prototypes
67 */
385 * special test here; may be generalized in the
386 * future - test for a machines that are known to
387 * work only in legacy mode, and set OUSER_LEGACY if
388 * we're on one
389 */
390 if (acpica_metro_old_bios())
391 acpi_user_options |= ACPI_OUSER_LEGACY;
392
393 /*
394 * If legacy mode is specified, set initialization
395 * options to avoid entering ACPI mode and hooking SCI
396 * - basically try to act like legacy acpi_intp
397 */
398 if ((acpi_user_options & ACPI_OUSER_LEGACY) != 0)
399 acpi_init_level |= (ACPI_NO_ACPI_ENABLE | ACPI_NO_HANDLER_INIT);
400
401 /*
402 * modify default ACPI CA debug output level for non-DEBUG builds
403 * (to avoid BIOS debug chatter in /var/adm/messages)
404 */
405 if (acpica_muzzle_debug_output)
406 AcpiDbgLevel = 0;
407 }
408
409 /*
410 * Initialize the CA subsystem if it hasn't been done already
411 */
412 int
413 acpica_init()
414 {
415 extern void acpica_find_ioapics(void);
416 ACPI_STATUS status;
417
418 /*
419 * Make sure user options are processed,
420 * then fail to initialize if ACPI CA has been
421 * disabled
422 */
423 acpica_process_user_options();
424 if (!acpica_enable)
425 return (AE_ERROR);
426
|
1 /*
2 * CDDL HEADER START
3 *
4 * The contents of this file are subject to the terms of the
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) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
24 * Copyright (c) 2011, Joyent, Inc. All rights reserved.
25 * Copyright 2013 Nexenta Systems, Inc. All rights reserved.
26 */
27
28 /*
29 * Copyright (c) 2009, Intel Corporation.
30 * All rights reserved.
31 */
32
33 /*
34 * x86 ACPI CA services
35 */
36
37 #include <sys/file.h>
38 #include <sys/errno.h>
39 #include <sys/conf.h>
40 #include <sys/modctl.h>
41 #include <sys/open.h>
42 #include <sys/stat.h>
43 #include <sys/spl.h>
44 #include <sys/ddi.h>
45 #include <sys/sunddi.h>
46 #include <sys/esunddi.h>
47 #include <sys/kstat.h>
48 #include <sys/x86_archext.h>
49
50 #include <acpica/include/acpi.h>
51 #include <sys/acpica.h>
52 #include <sys/archsystm.h>
53
54 /*
55 *
56 */
57 static struct modlmisc modlmisc = {
58 &mod_miscops,
59 "ACPI interpreter",
60 };
61
62 static struct modlinkage modlinkage = {
63 MODREV_1, /* MODREV_1 manual */
64 (void *)&modlmisc, /* module linkage */
65 NULL, /* list terminator */
66 };
67
68 /*
69 * Local prototypes
70 */
388 * special test here; may be generalized in the
389 * future - test for a machines that are known to
390 * work only in legacy mode, and set OUSER_LEGACY if
391 * we're on one
392 */
393 if (acpica_metro_old_bios())
394 acpi_user_options |= ACPI_OUSER_LEGACY;
395
396 /*
397 * If legacy mode is specified, set initialization
398 * options to avoid entering ACPI mode and hooking SCI
399 * - basically try to act like legacy acpi_intp
400 */
401 if ((acpi_user_options & ACPI_OUSER_LEGACY) != 0)
402 acpi_init_level |= (ACPI_NO_ACPI_ENABLE | ACPI_NO_HANDLER_INIT);
403
404 /*
405 * modify default ACPI CA debug output level for non-DEBUG builds
406 * (to avoid BIOS debug chatter in /var/adm/messages)
407 */
408 if (acpica_muzzle_debug_output) {
409 AcpiDbgLayer = 0;
410 AcpiDbgLevel = 0;
411 }
412 }
413
414 /*
415 * Initialize the CA subsystem if it hasn't been done already
416 */
417 int
418 acpica_init()
419 {
420 extern void acpica_find_ioapics(void);
421 ACPI_STATUS status;
422
423 /*
424 * Make sure user options are processed,
425 * then fail to initialize if ACPI CA has been
426 * disabled
427 */
428 acpica_process_user_options();
429 if (!acpica_enable)
430 return (AE_ERROR);
431
|