xref: /onnv-gate/usr/src/uts/i86pc/ml/kdi_subr.s (revision 3446:5903aece022d)
1*3446Smrj/*
2*3446Smrj * CDDL HEADER START
3*3446Smrj *
4*3446Smrj * The contents of this file are subject to the terms of the
5*3446Smrj * Common Development and Distribution License (the "License").
6*3446Smrj * You may not use this file except in compliance with the License.
7*3446Smrj *
8*3446Smrj * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9*3446Smrj * or http://www.opensolaris.org/os/licensing.
10*3446Smrj * See the License for the specific language governing permissions
11*3446Smrj * and limitations under the License.
12*3446Smrj *
13*3446Smrj * When distributing Covered Code, include this CDDL HEADER in each
14*3446Smrj * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15*3446Smrj * If applicable, add the following below this CDDL HEADER, with the
16*3446Smrj * fields enclosed by brackets "[]" replaced with your own identifying
17*3446Smrj * information: Portions Copyright [yyyy] [name of copyright owner]
18*3446Smrj *
19*3446Smrj * CDDL HEADER END
20*3446Smrj */
21*3446Smrj
22*3446Smrj/*
23*3446Smrj * Copyright 2007 Sun Microsystems, Inc.  All rights reserved.
24*3446Smrj * Use is subject to license terms.
25*3446Smrj */
26*3446Smrj
27*3446Smrj#pragma	ident	"%Z%%M%	%I%	%E% SMI"
28*3446Smrj
29*3446Smrj#include <sys/asm_linkage.h>
30*3446Smrj#include <sys/asm_misc.h>
31*3446Smrj#include <sys/regset.h>
32*3446Smrj#include <sys/privregs.h>
33*3446Smrj#include <sys/psw.h>
34*3446Smrj
35*3446Smrj#if defined(__lint)
36*3446Smrj#include <sys/types.h>
37*3446Smrj#include <sys/segments.h>
38*3446Smrj#endif
39*3446Smrj
40*3446Smrj#if defined(__lint)
41*3446Smrj
42*3446Smrjulong_t
43*3446Smrjkdi_getdr0(void)
44*3446Smrj{
45*3446Smrj	return (0);
46*3446Smrj}
47*3446Smrj
48*3446Smrjulong_t
49*3446Smrjkdi_getdr1(void)
50*3446Smrj{
51*3446Smrj	return (0);
52*3446Smrj}
53*3446Smrj
54*3446Smrjulong_t
55*3446Smrjkdi_getdr2(void)
56*3446Smrj{
57*3446Smrj	return (0);
58*3446Smrj}
59*3446Smrj
60*3446Smrjulong_t
61*3446Smrjkdi_getdr3(void)
62*3446Smrj{
63*3446Smrj	return (0);
64*3446Smrj}
65*3446Smrj
66*3446Smrjulong_t
67*3446Smrjkdi_getdr6(void)
68*3446Smrj{
69*3446Smrj	return (0);
70*3446Smrj}
71*3446Smrj
72*3446Smrjulong_t
73*3446Smrjkdi_getdr7(void)
74*3446Smrj{
75*3446Smrj	return (0);
76*3446Smrj}
77*3446Smrj
78*3446Smrj/*ARGSUSED*/
79*3446Smrjvoid
80*3446Smrjkdi_setdr0(ulong_t value)
81*3446Smrj{}
82*3446Smrj
83*3446Smrj/*ARGSUSED*/
84*3446Smrjvoid
85*3446Smrjkdi_setdr1(ulong_t value)
86*3446Smrj{}
87*3446Smrj
88*3446Smrj/*ARGSUSED*/
89*3446Smrjvoid
90*3446Smrjkdi_setdr2(ulong_t value)
91*3446Smrj{}
92*3446Smrj
93*3446Smrj/*ARGSUSED*/
94*3446Smrjvoid
95*3446Smrjkdi_setdr3(ulong_t value)
96*3446Smrj{}
97*3446Smrj
98*3446Smrj/*ARGSUSED*/
99*3446Smrjvoid
100*3446Smrjkdi_setdr4(ulong_t value)
101*3446Smrj{}
102*3446Smrj
103*3446Smrj/*ARGSUSED*/
104*3446Smrjvoid
105*3446Smrjkdi_setdr6(ulong_t value)
106*3446Smrj{}
107*3446Smrj
108*3446Smrj/*ARGSUSED*/
109*3446Smrjvoid
110*3446Smrjkdi_setdr7(ulong_t value)
111*3446Smrj{}
112*3446Smrj
113*3446Smrj#else
114*3446Smrj
115*3446Smrj#if defined(__amd64)
116*3446Smrj
117*3446Smrj#define	GETDREG(name, r)	\
118*3446Smrj	ENTRY_NP(name);		\
119*3446Smrj	movq	r, %rax;	\
120*3446Smrj	ret;			\
121*3446Smrj	SET_SIZE(name)
122*3446Smrj
123*3446Smrj#define	SETDREG(name, r)	\
124*3446Smrj	ENTRY_NP(name);		\
125*3446Smrj	movq	%rdi, r;	\
126*3446Smrj	ret;			\
127*3446Smrj	SET_SIZE(name)
128*3446Smrj
129*3446Smrj#elif defined(__i386)
130*3446Smrj
131*3446Smrj#define	GETDREG(name, r)	\
132*3446Smrj	ENTRY_NP(name);		\
133*3446Smrj	movl	r, %eax;	\
134*3446Smrj	ret;			\
135*3446Smrj	SET_SIZE(name)
136*3446Smrj
137*3446Smrj#define	SETDREG(name, r)	\
138*3446Smrj	ENTRY_NP(name);		\
139*3446Smrj	movl	4(%esp), %eax;	\
140*3446Smrj	movl	%eax, r;	\
141*3446Smrj	ret;			\
142*3446Smrj	SET_SIZE(name)
143*3446Smrj
144*3446Smrj#endif
145*3446Smrj
146*3446Smrj	GETDREG(kdi_getdr0, %dr0)
147*3446Smrj	GETDREG(kdi_getdr1, %dr1)
148*3446Smrj	GETDREG(kdi_getdr2, %dr2)
149*3446Smrj	GETDREG(kdi_getdr3, %dr3)
150*3446Smrj	GETDREG(kdi_getdr6, %dr6)
151*3446Smrj	GETDREG(kdi_getdr7, %dr7)
152*3446Smrj
153*3446Smrj	SETDREG(kdi_setdr0, %dr0)
154*3446Smrj	SETDREG(kdi_setdr1, %dr1)
155*3446Smrj	SETDREG(kdi_setdr2, %dr2)
156*3446Smrj	SETDREG(kdi_setdr3, %dr3)
157*3446Smrj	SETDREG(kdi_setdr6, %dr6)
158*3446Smrj	SETDREG(kdi_setdr7, %dr7)
159*3446Smrj
160*3446Smrj#endif	/* __lint */
161