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 2007 Sun Microsystems, Inc. All rights reserved.
24 * Use is subject to license terms.
25 */
26
27 #pragma ident "%Z%%M% %I% %E% SMI"
28
29 #include <sys/types.h>
30 #include <sys/systm.h>
31 #include <sys/mutex.h>
32 #include <sys/time.h>
33 #include <sys/clock.h>
34 #include <sys/archsystm.h>
35 #include <sys/modctl.h>
36 #include <sys/autoconf.h>
37 #include <sys/cmn_err.h>
38 #include <sys/atomic.h>
39 #include <sys/hypervisor.h>
40
41 /*
42 * tod driver module for i86xpv
43 */
44
45 static timestruc_t
46 todxen_get(tod_ops_t *top)
47 {
48 todinfo_t tod;
136 op.u.settime.nsecs = ts.tv_nsec;
137 op.u.settime.system_time = xpv_getsystime();
138 (void) HYPERVISOR_platform_op(&op);
139 }
140 }
141
142 static tod_ops_t todxen_ops = {
143 TOD_OPS_VERSION,
144 todxen_get,
145 todxen_set,
146 NULL
147 };
148
149 static struct modlmisc modlmisc = {
150 &mod_miscops,
151 "TOD module for i86xpv"
152 };
153
154 static struct modlinkage modl = {
155 MODREV_1,
156 &modlmisc
157 };
158
159 int
160 _init(void)
161 {
162 /*
163 * In future we might need to do something more sophisticated
164 * for versioning, i.e. dealing with older hardware TOD modules
165 * underneath us, but for now, anything else but "same" is a
166 * fatal error.
167 */
168 if (tod_ops->tod_version != todxen_ops.tod_version)
169 panic("TOD module version mismatch");
170
171 /*
172 * Stitch the ops vector linkage together, with this module
173 * sitting on the "front" of the ops list.
174 */
175 todxen_ops.tod_next = tod_ops;
176 tod_ops = &todxen_ops;
|
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 2007 Sun Microsystems, Inc. All rights reserved.
24 * Use is subject to license terms.
25 */
26
27 #include <sys/types.h>
28 #include <sys/systm.h>
29 #include <sys/mutex.h>
30 #include <sys/time.h>
31 #include <sys/clock.h>
32 #include <sys/archsystm.h>
33 #include <sys/modctl.h>
34 #include <sys/autoconf.h>
35 #include <sys/cmn_err.h>
36 #include <sys/atomic.h>
37 #include <sys/hypervisor.h>
38
39 /*
40 * tod driver module for i86xpv
41 */
42
43 static timestruc_t
44 todxen_get(tod_ops_t *top)
45 {
46 todinfo_t tod;
134 op.u.settime.nsecs = ts.tv_nsec;
135 op.u.settime.system_time = xpv_getsystime();
136 (void) HYPERVISOR_platform_op(&op);
137 }
138 }
139
140 static tod_ops_t todxen_ops = {
141 TOD_OPS_VERSION,
142 todxen_get,
143 todxen_set,
144 NULL
145 };
146
147 static struct modlmisc modlmisc = {
148 &mod_miscops,
149 "TOD module for i86xpv"
150 };
151
152 static struct modlinkage modl = {
153 MODREV_1,
154 { &modlmisc, NULL }
155 };
156
157 int
158 _init(void)
159 {
160 /*
161 * In future we might need to do something more sophisticated
162 * for versioning, i.e. dealing with older hardware TOD modules
163 * underneath us, but for now, anything else but "same" is a
164 * fatal error.
165 */
166 if (tod_ops->tod_version != todxen_ops.tod_version)
167 panic("TOD module version mismatch");
168
169 /*
170 * Stitch the ops vector linkage together, with this module
171 * sitting on the "front" of the ops list.
172 */
173 todxen_ops.tod_next = tod_ops;
174 tod_ops = &todxen_ops;
|