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