Print this page
PANKOVs restructure
Split |
Close |
Expand all |
Collapse all |
--- old/usr/src/uts/i86pc/sys/psm_common.h
+++ new/usr/src/uts/i86pc/sys/psm_common.h
1 1 /*
2 2 * CDDL HEADER START
3 3 *
4 4 * The contents of this file are subject to the terms of the
5 5 * Common Development and Distribution License (the "License").
6 6 * You may not use this file except in compliance with the License.
7 7 *
8 8 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9 9 * or http://www.opensolaris.org/os/licensing.
10 10 * See the License for the specific language governing permissions
↓ open down ↓ |
10 lines elided |
↑ open up ↑ |
11 11 * and limitations under the License.
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 /*
22 23 * Copyright 2007 Sun Microsystems, Inc. All rights reserved.
23 24 * Use is subject to license terms.
25 + * Copyright 2013 Nexenta Systems, Inc. All rights reserved.
24 26 */
25 27
26 28 #ifndef _SYS_PSM_COMMON_H
27 29 #define _SYS_PSM_COMMON_H
28 30
29 -#pragma ident "%Z%%M% %I% %E% SMI"
30 -
31 31 #include <sys/types.h>
32 32 #include <sys/param.h>
33 33 #include <sys/cmn_err.h>
34 -#include <sys/acpi/acpi.h>
34 +
35 +#include <acpica/include/acpi.h>
35 36 #include <sys/acpica.h>
36 37
37 38 #include <sys/sunddi.h>
38 39 #include <sys/ddi.h>
39 40 #include <sys/ddi_impldefs.h>
40 41 #include <sys/pci.h>
41 42 #include <sys/debug.h>
42 43
43 44 #ifdef __cplusplus
44 45 extern "C" {
45 46 #endif
46 47
47 48
48 49 /* private data used in psm_common */
49 50 typedef struct acpi_prs_private {
50 51 uchar_t prs_irqflags;
51 52 uchar_t prs_type;
52 53 } acpi_prs_private_t;
53 54
54 55
55 56 typedef struct acpi_psm_lnk {
56 57 ACPI_HANDLE lnkobj;
57 58 acpi_prs_private_t acpi_prs_prv;
58 59 uchar_t device_status;
59 60 } acpi_psm_lnk_t;
60 61
61 62 typedef void (*intr_exit_fn_t)(int prev_ipl, int irq);
62 63
63 64 /*
64 65 * status definition for device_status (as returned by _STA)
65 66 */
66 67 #define STA_PRESENT 0x1
67 68 #define STA_ENABLE 0x2
68 69
69 70
70 71 /*
71 72 * irq_cache_t: Entry for irq cache to map pci bus/dev/ipin or ACPI object
72 73 * referencing an interrupt link device the configured irq for the device.
73 74 * It is assumed that the acpi object that references the link device is
74 75 * the same for all devices that reference the same link device.
75 76 */
76 77 typedef struct irq_cache {
77 78 uchar_t bus, dev;
78 79 uchar_t ipin;
79 80 uchar_t irq;
80 81 iflag_t flags;
81 82 ACPI_HANDLE lnkobj;
82 83 } irq_cache_t;
83 84
84 85
85 86 typedef struct acpi_irqlist {
86 87 acpi_prs_private_t acpi_prs_prv;
87 88 iflag_t intr_flags;
88 89 uint32_t *irqs;
89 90 int num_irqs;
90 91 struct acpi_irqlist *next;
91 92 } acpi_irqlist_t;
92 93
93 94
94 95 #define MAX_ISA_IRQ 15
95 96
96 97 #define ELCR_PORT1 0x4D0
97 98 #define ELCR_PORT2 0x4D1
98 99
99 100 #define ELCR_LEVEL(elcrval, irq) (elcrval & (0x1 << irq))
100 101 #define ELCR_EDGE(elcrval, irq) ((elcrval & (0x1 << irq)) == 0)
101 102
102 103
103 104 #define ACPI_PSM_SUCCESS 0
104 105 #define ACPI_PSM_FAILURE -1
105 106 #define ACPI_PSM_PARTIAL -2
106 107
107 108 /* verbose flags definitions */
108 109 #define PSM_VERBOSE_IRQ_FLAG 0x00000001
109 110 #define PSM_VERBOSE_POWEROFF_FLAG 0x00000002
110 111 #define PSM_VERBOSE_POWEROFF_PAUSE_FLAG 0x00000004
111 112
112 113 extern int acpi_psm_init(char *module_name, int verbose_flags);
113 114
114 115 extern void build_reserved_irqlist(uchar_t *reserved_irqs_table);
115 116
116 117 extern int acpi_translate_pci_irq(dev_info_t *dip, int ipin, int *pci_irqp,
117 118 iflag_t *intr_flagp, acpi_psm_lnk_t *acpipsmlnkp);
118 119
119 120 extern int acpi_set_irq_resource(acpi_psm_lnk_t *acpipsmlnkp, int irq);
120 121
121 122 extern int acpi_get_current_irq_resource(acpi_psm_lnk_t *acpipsmlnkp,
122 123 int *pci_irqp, iflag_t *intr_flagp);
123 124
124 125 extern int acpi_irqlist_find_irq(acpi_irqlist_t *irqlistp, int irq,
125 126 iflag_t *intr_flagp);
126 127
127 128 extern void acpi_free_irqlist(acpi_irqlist_t *irqlistp);
128 129
129 130 extern int acpi_get_possible_irq_resources(acpi_psm_lnk_t *acpipsmlnkp,
130 131 acpi_irqlist_t **irqlistp);
131 132
132 133 extern void acpi_new_irq_cache_ent(int bus, int dev, int ipin, int pci_irq,
133 134 iflag_t *intr_flagp, acpi_psm_lnk_t *acpipsmlnkp);
134 135
135 136 extern int acpi_get_irq_cache_ent(uchar_t bus, uchar_t dev, int ipin,
136 137 int *pci_irqp, iflag_t *intr_flagp);
137 138
138 139 extern void acpi_restore_link_devices(void);
139 140
140 141 extern int acpi_poweroff(void);
141 142
142 143 extern void psm_set_elcr(int vecno, int val);
143 144 extern int psm_get_elcr(int vecno);
144 145 extern intr_exit_fn_t psm_intr_exit_fn(void);
145 146
146 147 #ifdef __cplusplus
147 148 }
148 149 #endif
149 150
150 151 #endif /* _SYS_PSM_COMMON_H */
↓ open down ↓ |
106 lines elided |
↑ open up ↑ |
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX