1/* $NetBSD: pal.s,v 1.14 1999/12/02 22:08:04 thorpej Exp $ */
2
3/*
4 * Copyright (c) 1994, 1995 Carnegie-Mellon University.
5 * All rights reserved.
6 *
7 * Author: Chris G. Demetriou
8 *
9 * Permission to use, copy, modify and distribute this software and
10 * its documentation is hereby granted, provided that both the copyright
11 * notice and this permission notice appear in all copies of the
12 * software, derivative works or modified versions, and any portions
13 * thereof, and that both notices appear in supporting documentation.
14 *
15 * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS"
16 * CONDITION.  CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND
17 * FOR ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE.
18 *
19 * Carnegie Mellon requests users of this software to return to
20 *
21 *  Software Distribution Coordinator  or  Software.Distribution@CS.CMU.EDU
22 *  School of Computer Science
23 *  Carnegie Mellon University
24 *  Pittsburgh PA 15213-3890
25 *
26 * any improvements or extensions that they make and grant Carnegie the
27 * rights to redistribute these changes.
28 */
29
30/*
31 * The various OSF PALcode routines.
32 *
33 * The following code is originally derived from pages: (I) 6-5 - (I) 6-7
34 * and (III) 2-1 - (III) 2-25 of "Alpha Architecture Reference Manual" by
35 * Richard L. Sites.
36 *
37 * Updates taken from pages: (II-B) 2-1 - (II-B) 2-33 of "Alpha AXP
38 * Architecture Reference Manual, Second Edition" by Richard L. Sites
39 * and Richard T. Witek.
40 */
41
42__KERNEL_RCSID(1, "$NetBSD: pal.s,v 1.14 1999/12/02 22:08:04 thorpej Exp $");
43
44inc2:	.stabs	__FILE__,132,0,0,inc2; .loc	1 __LINE__
45/*
46 * alpha_amask: read architecture features (XXX INSTRUCTION, NOT PALcode OP)
47 *
48 * Arguments:
49 *	a0	bitmask of features to test
50 *
51 * Returns:
52 *	v0	bitmask - bit is _cleared_ if feature is supported
53 */
54	.text
55LEAF(alpha_amask,1)
56	amask	a0, v0
57	RET
58	END(alpha_amask)
59
60/*
61 * alpha_implver: read implementation version (XXX INSTRUCTION, NOT PALcode OP)
62 *
63 * Returns:
64 *	v0	implementation version - see <machine/alpha_cpu.h>
65 */
66	.text
67LEAF(alpha_implver,0)
68#if 0
69	implver	0x1, v0
70#else
71	.long	0x47e03d80	/* XXX gas(1) does the Wrong Thing */
72#endif
73	RET
74	END(alpha_implver)
75
76/*
77 * alpha_pal_cflush: Cache flush [PRIVILEGED]
78 *
79 * Flush the entire physical page specified by the PFN specified in
80 * a0 from any data caches associated with the current processor.
81 *
82 * Arguments:
83 *	a0	page frame number of page to flush
84 */
85	.text
86LEAF(alpha_pal_cflush,1)
87	call_pal PAL_cflush
88	RET
89	END(alpha_pal_cflush)
90
91/*
92 * alpha_pal_halt: Halt the processor. [PRIVILEGED]
93 */
94	.text
95LEAF_NOPROFILE(alpha_pal_halt,0)
96	call_pal PAL_halt
97	br	zero,alpha_pal_halt	/* Just in case */
98	RET
99	END(alpha_pal_halt)
100
101/*
102 * alpha_pal_rdps: Read processor status. [PRIVILEGED]
103 *
104 * Return:
105 *	v0	current PS value
106 */
107	.text
108LEAF(alpha_pal_rdps,0)
109	call_pal PAL_OSF1_rdps
110	RET
111	END(alpha_pal_rdps)
112
113/*
114 * alpha_pal_swpipl: Swap Interrupt priority level. [PRIVILEGED]
115 * _alpha_pal_swpipl: Same, from profiling code. [PRIVILEGED]
116 *
117 * Arguments:
118 *	a0	new IPL
119 *
120 * Return:
121 *	v0	old IPL
122 */
123	.text
124LEAF(alpha_pal_swpipl,1)
125	call_pal PAL_OSF1_swpipl
126	RET
127	END(alpha_pal_swpipl)
128
129LEAF_NOPROFILE(_alpha_pal_swpipl,1)
130	call_pal PAL_OSF1_swpipl
131	RET
132	END(_alpha_pal_swpipl)
133
134/*
135 * alpha_pal_wrent: Write system entry address. [PRIVILEGED]
136 *
137 * Arguments:
138 *	a0	new vector
139 *	a1	vector selector
140 */
141	.text
142LEAF_NOPROFILE(alpha_pal_wrent,2)
143	call_pal PAL_OSF1_wrent
144	RET
145	END(alpha_pal_wrent)
146
147/*
148 * alpha_pal_wrvptptr: Write virtual page table pointer. [PRIVILEGED]
149 *
150 * Arguments:
151 *	a0	new virtual page table pointer
152 */
153	.text
154LEAF_NOPROFILE(alpha_pal_wrvptptr,1)
155	call_pal PAL_OSF1_wrvptptr
156	RET
157	END(alpha_pal_wrvptptr)
158