Print this page
PANKOVs restructure
Split |
Close |
Expand all |
Collapse all |
--- old/usr/src/uts/i86pc/io/acpi/drmach_acpi/drmach_acpi.h
+++ new/usr/src/uts/i86pc/io/acpi/drmach_acpi/drmach_acpi.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
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 * Copyright 2008 Sun Microsystems, Inc. All rights reserved.
23 23 * Use is subject to license terms.
24 24 */
25 25 /*
↓ open down ↓ |
25 lines elided |
↑ open up ↑ |
26 26 * Copyright (c) 2010, Intel Corporation.
27 27 * All rights reserved.
28 28 */
29 29
30 30 #ifndef _SYS_DRMACH_ACPI_H
31 31 #define _SYS_DRMACH_ACPI_H
32 32 #include <sys/types.h>
33 33 #include <sys/cmn_err.h>
34 34 #include <sys/param.h>
35 35 #include <sys/sunddi.h>
36 -#include <sys/acpi/acpi.h>
36 +#include <acpica/include/acpi.h>
37 37 #include <sys/acpica.h>
38 38 #include <sys/acpidev.h>
39 39 #include <sys/drmach.h>
40 40
41 41 #ifdef __cplusplus
42 42 extern "C" {
43 43 #endif
44 44
45 45 #ifdef _KERNEL
46 46
47 47 /* Use ACPI handle as DRMACH handle on x86 systems. */
48 48 #define DRMACH_HANDLE ACPI_HANDLE
49 49
50 50 /* Macros to deal with object type. */
51 51 #define DRMACH_OBJ(id) ((drmach_common_t *)id)
52 52
53 53 #define DRMACH_NULL_ID(id) ((id) == 0)
54 54
55 55 #define DRMACH_IS_BOARD_ID(id) \
56 56 ((id != 0) && (DRMACH_OBJ(id)->isa == (void *)drmach_board_new))
57 57
58 58 #define DRMACH_IS_CPU_ID(id) \
59 59 ((id != 0) && (DRMACH_OBJ(id)->isa == (void *)drmach_cpu_new))
60 60
61 61 #define DRMACH_IS_MEM_ID(id) \
62 62 ((id != 0) && (DRMACH_OBJ(id)->isa == (void *)drmach_mem_new))
63 63
64 64 #define DRMACH_IS_IO_ID(id) \
65 65 ((id != 0) && (DRMACH_OBJ(id)->isa == (void *)drmach_io_new))
66 66
67 67 #define DRMACH_IS_DEVICE_ID(id) \
68 68 ((id != 0) && \
69 69 (DRMACH_OBJ(id)->isa == (void *)drmach_cpu_new || \
70 70 DRMACH_OBJ(id)->isa == (void *)drmach_mem_new || \
71 71 DRMACH_OBJ(id)->isa == (void *)drmach_io_new))
72 72
73 73 #define DRMACH_IS_ID(id) \
74 74 ((id != 0) && \
75 75 (DRMACH_OBJ(id)->isa == (void *)drmach_board_new || \
76 76 DRMACH_OBJ(id)->isa == (void *)drmach_cpu_new || \
77 77 DRMACH_OBJ(id)->isa == (void *)drmach_mem_new || \
78 78 DRMACH_OBJ(id)->isa == (void *)drmach_io_new))
79 79
80 80 #define DRMACH_INTERNAL_ERROR() \
81 81 drerr_new(1, EX86_INTERNAL, drmach_ie_fmt, __LINE__)
82 82
83 83 #ifdef DEBUG
84 84 extern int drmach_debug;
85 85
86 86 #define DRMACH_PR if (drmach_debug) printf
87 87 #else
88 88 #define DRMACH_PR _NOTE(CONSTANTCONDITION) if (0) printf
89 89 #endif /* DEBUG */
90 90
91 91 typedef struct {
92 92 struct drmach_node *node;
93 93 void *data;
94 94 void *func;
95 95 } drmach_node_walk_args_t;
96 96
97 97 typedef struct drmach_node {
98 98 void *here;
99 99
100 100 DRMACH_HANDLE (*get_dnode)(struct drmach_node *node);
101 101 dev_info_t *(*getdip)(struct drmach_node *node);
102 102 int (*getproplen)(struct drmach_node *node, char *name,
103 103 int *len);
104 104 int (*getprop)(struct drmach_node *node, char *name,
105 105 void *buf, int len);
106 106 int (*walk)(struct drmach_node *node, void *data,
107 107 int (*cb)(drmach_node_walk_args_t *args));
108 108 } drmach_node_t;
109 109
110 110 typedef struct {
111 111 int min_index;
112 112 int max_index;
113 113 int arr_sz;
114 114 drmachid_t *arr;
115 115 } drmach_array_t;
116 116
117 117 typedef struct {
118 118 void *isa;
119 119
120 120 void (*dispose)(drmachid_t);
121 121 sbd_error_t *(*release)(drmachid_t);
122 122 sbd_error_t *(*status)(drmachid_t, drmach_status_t *);
123 123
124 124 char name[MAXNAMELEN];
125 125 } drmach_common_t;
126 126
127 127 typedef struct {
128 128 drmach_common_t cm;
129 129 uint_t bnum;
130 130 int assigned;
131 131 int powered;
132 132 int connected;
133 133 int cond;
134 134 drmach_node_t *tree;
135 135 drmach_array_t *devices;
136 136 int boot_board; /* if board exists on bootup */
137 137 } drmach_board_t;
138 138
139 139 typedef struct {
140 140 drmach_common_t cm;
141 141 drmach_board_t *bp;
142 142 int unum;
143 143 uint_t portid;
144 144 int busy;
145 145 int powered;
146 146 const char *type;
147 147 drmach_node_t *node;
148 148 } drmach_device_t;
149 149
150 150 typedef struct drmach_cpu {
151 151 drmach_device_t dev;
152 152 processorid_t cpuid;
153 153 uint32_t apicid;
154 154 } drmach_cpu_t;
155 155
156 156 typedef struct drmach_mem {
157 157 drmach_device_t dev;
158 158 uint64_t mem_alignment;
159 159 uint64_t slice_base;
160 160 uint64_t slice_top;
161 161 uint64_t slice_size;
162 162 uint64_t base_pa; /* lowest installed memory base */
163 163 uint64_t nbytes; /* size of installed memory */
164 164 struct memlist *memlist;
165 165 } drmach_mem_t;
166 166
167 167 typedef struct drmach_io {
168 168 drmach_device_t dev;
169 169 } drmach_io_t;
170 170
171 171 typedef struct drmach_domain_info {
172 172 uint64_t floating;
173 173 int allow_dr;
174 174 } drmach_domain_info_t;
175 175
176 176 typedef struct {
177 177 drmach_board_t *obj;
178 178 int ndevs;
179 179 void *a;
180 180 sbd_error_t *(*found)(void *a, const char *, int, drmachid_t);
181 181 sbd_error_t *err;
182 182 } drmach_board_cb_data_t;
183 183
184 184 extern drmach_domain_info_t drmach_domain;
185 185
186 186 extern drmach_board_t *drmach_board_new(uint_t, int);
187 187 extern sbd_error_t *drmach_device_new(drmach_node_t *,
188 188 drmach_board_t *, int, drmachid_t *);
189 189 extern sbd_error_t *drmach_cpu_new(drmach_device_t *, drmachid_t *);
190 190 extern sbd_error_t *drmach_mem_new(drmach_device_t *, drmachid_t *);
191 191 extern sbd_error_t *drmach_io_new(drmach_device_t *, drmachid_t *);
192 192
193 193 #endif /* _KERNEL */
194 194
195 195 #ifdef __cplusplus
196 196 }
197 197 #endif
198 198
199 199 #endif /* _SYS_DRMACH_ACPI_H */
↓ open down ↓ |
153 lines elided |
↑ open up ↑ |
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX