collapse the only x86 platform into x86 itself
[unleashed.git] / arch / x86 / kernel / include / sys / acpinex.h
blob4aa6f19636a7fdb188cd4affa07c5305621fe273
1 /*
2 * CDDL HEADER START
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.
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.
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]
19 * CDDL HEADER END
22 * Copyright (c) 2009-2010, Intel Corporation.
23 * All rights reserved.
26 #ifndef _ACPI_NEXUS_H
27 #define _ACPI_NEXUS_H
28 #include <sys/types.h>
29 #include <sys/dditypes.h> /* needed for definition of dev_info_t */
30 #include <sys/mutex.h>
32 #ifdef __cplusplus
33 extern "C" {
34 #endif
36 #ifdef _KERNEL
38 #define ACPINEX_INSTANCE_MAX (1 << 10)
39 #define ACPINEX_INSTANCE_MASK (ACPINEX_INSTANCE_MAX - 1)
40 #define ACPINEX_INSTANCE_SHIFT 8
41 #define ACPINEX_MINOR_TYPE_MASK ((1 << ACPINEX_INSTANCE_SHIFT) - 1)
42 #define ACPINEX_DEVCTL_MINOR ((1 << ACPINEX_INSTANCE_SHIFT) - 1)
44 #define ACPINEX_MAKE_DEVCTL_MINOR(instance) \
45 (((instance) << ACPINEX_INSTANCE_SHIFT) | ACPINEX_DEVCTL_MINOR)
46 #define ACPINEX_IS_DEVCTL(minor) \
47 (((minor) & ACPINEX_MINOR_TYPE_MASK) == ACPINEX_DEVCTL_MINOR)
49 #define ACPINEX_GET_INSTANCE(minor) ((minor) >> ACPINEX_INSTANCE_SHIFT)
51 extern int acpinex_debug;
52 #define ACPINEX_DEBUG(lvl, ...) \
53 if (acpinex_debug) cmn_err((lvl), __VA_ARGS__)
55 /* Softstate structure for acpinex instance. */
56 typedef struct {
57 dev_info_t *ans_dip;
58 ACPI_HANDLE ans_hdl;
59 int ans_fm_cap;
60 ddi_iblock_cookie_t ans_fm_ibc;
61 kmutex_t ans_lock;
62 char ans_path[MAXPATHLEN];
63 } acpinex_softstate_t;
65 extern void acpinex_event_init(void);
66 extern void acpinex_event_fini(void);
67 extern int acpinex_event_scan(acpinex_softstate_t *, boolean_t);
69 #endif /* _KERNEL */
71 #ifdef __cplusplus
73 #endif
75 #endif /* _ACPI_NEXUS_H */