alpha.h revision 1.23 1 1.23 ad /* $NetBSD: alpha.h,v 1.23 2007/11/28 17:40:03 ad Exp $ */
2 1.1 ross
3 1.1 ross /*
4 1.1 ross * Copyright (c) 1982, 1990, 1993
5 1.1 ross * The Regents of the University of California. All rights reserved.
6 1.19 agc *
7 1.19 agc * This code is derived from software contributed to Berkeley by
8 1.19 agc * the Systems Programming Group of the University of Utah Computer
9 1.19 agc * Science Department.
10 1.19 agc *
11 1.19 agc * Redistribution and use in source and binary forms, with or without
12 1.19 agc * modification, are permitted provided that the following conditions
13 1.19 agc * are met:
14 1.19 agc * 1. Redistributions of source code must retain the above copyright
15 1.19 agc * notice, this list of conditions and the following disclaimer.
16 1.19 agc * 2. Redistributions in binary form must reproduce the above copyright
17 1.19 agc * notice, this list of conditions and the following disclaimer in the
18 1.19 agc * documentation and/or other materials provided with the distribution.
19 1.19 agc * 3. Neither the name of the University nor the names of its contributors
20 1.19 agc * may be used to endorse or promote products derived from this software
21 1.19 agc * without specific prior written permission.
22 1.19 agc *
23 1.19 agc * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
24 1.19 agc * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
25 1.19 agc * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
26 1.19 agc * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
27 1.19 agc * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
28 1.19 agc * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
29 1.19 agc * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
30 1.19 agc * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
31 1.19 agc * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
32 1.19 agc * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
33 1.19 agc * SUCH DAMAGE.
34 1.19 agc *
35 1.19 agc * from: Utah $Hdr: cpu.h 1.16 91/03/25$
36 1.19 agc *
37 1.19 agc * @(#)cpu.h 8.4 (Berkeley) 1/5/94
38 1.19 agc */
39 1.19 agc /*
40 1.19 agc * Copyright (c) 1988 University of Utah.
41 1.1 ross *
42 1.1 ross * This code is derived from software contributed to Berkeley by
43 1.1 ross * the Systems Programming Group of the University of Utah Computer
44 1.1 ross * Science Department.
45 1.1 ross *
46 1.1 ross * Redistribution and use in source and binary forms, with or without
47 1.1 ross * modification, are permitted provided that the following conditions
48 1.1 ross * are met:
49 1.1 ross * 1. Redistributions of source code must retain the above copyright
50 1.1 ross * notice, this list of conditions and the following disclaimer.
51 1.1 ross * 2. Redistributions in binary form must reproduce the above copyright
52 1.1 ross * notice, this list of conditions and the following disclaimer in the
53 1.1 ross * documentation and/or other materials provided with the distribution.
54 1.1 ross * 3. All advertising materials mentioning features or use of this software
55 1.1 ross * must display the following acknowledgement:
56 1.1 ross * This product includes software developed by the University of
57 1.1 ross * California, Berkeley and its contributors.
58 1.1 ross * 4. Neither the name of the University nor the names of its contributors
59 1.1 ross * may be used to endorse or promote products derived from this software
60 1.1 ross * without specific prior written permission.
61 1.1 ross *
62 1.1 ross * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
63 1.1 ross * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
64 1.1 ross * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
65 1.1 ross * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
66 1.1 ross * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
67 1.1 ross * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
68 1.1 ross * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
69 1.1 ross * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
70 1.1 ross * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
71 1.1 ross * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
72 1.1 ross * SUCH DAMAGE.
73 1.1 ross *
74 1.1 ross * from: Utah $Hdr: cpu.h 1.16 91/03/25$
75 1.1 ross *
76 1.1 ross * @(#)cpu.h 8.4 (Berkeley) 1/5/94
77 1.1 ross */
78 1.1 ross
79 1.1 ross #ifndef _ALPHA_H_
80 1.1 ross #define _ALPHA_H_
81 1.15 ross
82 1.15 ross typedef union alpha_s_float {
83 1.15 ross u_int32_t i;
84 1.15 ross u_int32_t frac: 23,
85 1.15 ross exp: 8,
86 1.15 ross sign: 1;
87 1.15 ross } s_float;
88 1.15 ross
89 1.15 ross typedef union alpha_t_float {
90 1.15 ross u_int64_t i;
91 1.15 ross u_int64_t frac: 52,
92 1.15 ross exp: 11,
93 1.15 ross sign: 1;
94 1.15 ross } t_float;
95 1.15 ross
96 1.1 ross #ifdef _KERNEL
97 1.3 thorpej
98 1.3 thorpej #include <machine/bus.h>
99 1.16 ross #include <machine/stdarg.h>
100 1.1 ross
101 1.1 ross struct pcb;
102 1.18 thorpej struct lwp;
103 1.1 ross struct reg;
104 1.1 ross struct rpb;
105 1.1 ross struct trapframe;
106 1.9 thorpej
107 1.15 ross extern u_long cpu_implver; /* from IMPLVER instruction */
108 1.15 ross extern u_long cpu_amask; /* from AMASK instruction */
109 1.9 thorpej extern int bootdev_debug;
110 1.15 ross extern int alpha_fp_sync_complete;
111 1.15 ross extern int alpha_unaligned_print, alpha_unaligned_fix, alpha_unaligned_sigbus;
112 1.1 ross
113 1.10 thorpej void XentArith(u_int64_t, u_int64_t, u_int64_t); /* MAGIC */
114 1.10 thorpej void XentIF(u_int64_t, u_int64_t, u_int64_t); /* MAGIC */
115 1.10 thorpej void XentInt(u_int64_t, u_int64_t, u_int64_t); /* MAGIC */
116 1.10 thorpej void XentMM(u_int64_t, u_int64_t, u_int64_t); /* MAGIC */
117 1.10 thorpej void XentRestart(void); /* MAGIC */
118 1.10 thorpej void XentSys(u_int64_t, u_int64_t, u_int64_t); /* MAGIC */
119 1.10 thorpej void XentUna(u_int64_t, u_int64_t, u_int64_t); /* MAGIC */
120 1.10 thorpej void alpha_init(u_long, u_long, u_long, u_long, u_long);
121 1.10 thorpej int alpha_pa_access(u_long);
122 1.10 thorpej void ast(struct trapframe *);
123 1.10 thorpej int badaddr(void *, size_t);
124 1.10 thorpej int badaddr_read(void *, size_t, void *);
125 1.10 thorpej u_int64_t console_restart(struct trapframe *);
126 1.10 thorpej void do_sir(void);
127 1.10 thorpej void dumpconf(void);
128 1.10 thorpej void exception_return(void); /* MAGIC */
129 1.18 thorpej void frametoreg(const struct trapframe *, struct reg *);
130 1.10 thorpej long fswintrberr(void); /* MAGIC */
131 1.10 thorpej void init_bootstrap_console(void);
132 1.10 thorpej void init_prom_interface(struct rpb *);
133 1.10 thorpej void interrupt(unsigned long, unsigned long, unsigned long,
134 1.10 thorpej struct trapframe *);
135 1.10 thorpej void machine_check(unsigned long, struct trapframe *, unsigned long,
136 1.10 thorpej unsigned long);
137 1.10 thorpej u_int64_t hwrpb_checksum(void);
138 1.10 thorpej void hwrpb_restart_setup(void);
139 1.10 thorpej void regdump(struct trapframe *);
140 1.18 thorpej void regtoframe(const struct reg *, struct trapframe *);
141 1.10 thorpej void savectx(struct pcb *);
142 1.21 yamt void lwp_trampoline(void); /* MAGIC */
143 1.10 thorpej void trap(unsigned long, unsigned long, unsigned long, unsigned long,
144 1.10 thorpej struct trapframe *);
145 1.10 thorpej void trap_init(void);
146 1.10 thorpej void enable_nsio_ide(bus_space_tag_t);
147 1.10 thorpej char * dot_conv(unsigned long);
148 1.11 thorpej
149 1.13 thorpej void fpusave_cpu(struct cpu_info *, int);
150 1.18 thorpej void fpusave_proc(struct lwp *, int);
151 1.1 ross
152 1.23 ad void alpha_patch(bool);
153 1.23 ad
154 1.1 ross /* Multiprocessor glue; cpu.c */
155 1.16 ross
156 1.2 thorpej struct cpu_info;
157 1.10 thorpej int cpu_iccb_send(long, const char *);
158 1.10 thorpej void cpu_iccb_receive(void);
159 1.10 thorpej void cpu_hatch(struct cpu_info *);
160 1.13 thorpej void cpu_halt(void) __attribute__((__noreturn__));
161 1.10 thorpej void cpu_spinup_trampoline(void); /* MAGIC */
162 1.10 thorpej void cpu_pause(unsigned long);
163 1.10 thorpej void cpu_resume(unsigned long);
164 1.13 thorpej #if defined(DDB)
165 1.13 thorpej void cpu_debug_dump(void);
166 1.13 thorpej #endif
167 1.15 ross
168 1.15 ross /* IEEE and VAX FP completion */
169 1.15 ross
170 1.15 ross void alpha_sts(int, s_float *); /* MAGIC */
171 1.15 ross void alpha_stt(int, t_float *); /* MAGIC */
172 1.15 ross void alpha_lds(int, s_float *); /* MAGIC */
173 1.15 ross void alpha_ldt(int, t_float *); /* MAGIC */
174 1.15 ross
175 1.15 ross uint64_t alpha_read_fpcr(void); /* MAGIC */
176 1.15 ross void alpha_write_fpcr(u_int64_t); /* MAGIC */
177 1.15 ross
178 1.18 thorpej u_int64_t alpha_read_fp_c(struct lwp *);
179 1.18 thorpej void alpha_write_fp_c(struct lwp *, u_int64_t);
180 1.15 ross
181 1.18 thorpej void alpha_enable_fp(struct lwp *, int);
182 1.18 thorpej int alpha_fp_complete(u_long, u_long, struct lwp *, u_int64_t *);
183 1.16 ross
184 1.16 ross /* Security sensitive rate limiting printf */
185 1.16 ross
186 1.16 ross void rlprintf(struct timeval *t, const char *fmt, ...);
187 1.1 ross
188 1.1 ross #endif /* _KERNEL */
189 1.1 ross #endif /* _ALPHA_H_ */
190