1 /* $NetBSD: m68k.h,v 1.15 2009/12/19 13:08:26 tsutsui Exp $ */
4 * Copyright (c) 1982, 1990, 1993
5 * The Regents of the University of California. All rights reserved.
7 * This code is derived from software contributed to Berkeley by
8 * the Systems Programming Group of the University of Utah Computer
11 * Redistribution and use in source and binary forms, with or without
12 * modification, are permitted provided that the following conditions
14 * 1. Redistributions of source code must retain the above copyright
15 * notice, this list of conditions and the following disclaimer.
16 * 2. Redistributions in binary form must reproduce the above copyright
17 * notice, this list of conditions and the following disclaimer in the
18 * documentation and/or other materials provided with the distribution.
19 * 3. Neither the name of the University nor the names of its contributors
20 * may be used to endorse or promote products derived from this software
21 * without specific prior written permission.
23 * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
24 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
25 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
26 * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
27 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
28 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
29 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
30 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
31 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
32 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
35 * from: Utah $Hdr: cpu.h 1.16 91/03/25$
36 * from: @(#)cpu.h 8.4 (Berkeley) 1/5/94
39 * Copyright (c) 1988 University of Utah.
41 * This code is derived from software contributed to Berkeley by
42 * the Systems Programming Group of the University of Utah Computer
45 * Redistribution and use in source and binary forms, with or without
46 * modification, are permitted provided that the following conditions
48 * 1. Redistributions of source code must retain the above copyright
49 * notice, this list of conditions and the following disclaimer.
50 * 2. Redistributions in binary form must reproduce the above copyright
51 * notice, this list of conditions and the following disclaimer in the
52 * documentation and/or other materials provided with the distribution.
53 * 3. All advertising materials mentioning features or use of this software
54 * must display the following acknowledgement:
55 * This product includes software developed by the University of
56 * California, Berkeley and its contributors.
57 * 4. Neither the name of the University nor the names of its contributors
58 * may be used to endorse or promote products derived from this software
59 * without specific prior written permission.
61 * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
62 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
63 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
64 * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
65 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
66 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
67 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
68 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
69 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
70 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
73 * from: Utah $Hdr: cpu.h 1.16 91/03/25$
74 * from: @(#)cpu.h 8.4 (Berkeley) 1/5/94
81 * Declarations for things exported by sources in this directory,
82 * or required by sources in here and not declared elsewhere.
84 * These declarations generally do NOT belong in <machine/cpu.h>,
85 * because that defines the interface between the common code and
86 * the machine-dependent code, whereas this defines the interface
87 * between the shared m68k code and the machine-dependent code.
89 * The MMU stuff is exported separately so it can be used just
90 * where it is really needed. Same for function codes, etc.
95 * All m68k ports must provide these globals.
97 extern int cputype
; /* CPU on this host */
98 extern int ectype
; /* external cache on this host */
99 extern int fputype
; /* FPU on this host */
100 extern int mmutype
; /* MMU on this host */
103 /* values for cputype */
104 #define CPU_68010 -1 /* 68010 */
105 #define CPU_68020 0 /* 68020 */
106 #define CPU_68030 1 /* 68030 */
107 #define CPU_68040 2 /* 68040 */
108 #define CPU_68060 3 /* 68060 */
110 /* values for ectype */
111 #define EC_PHYS -1 /* external physical address cache */
112 #define EC_NONE 0 /* no external cache */
113 #define EC_VIRT 1 /* external virtual address cache */
115 /* values for fputype */
116 #define FPU_NONE 0 /* no FPU */
117 #define FPU_68881 1 /* 68881 FPU */
118 #define FPU_68882 2 /* 68882 FPU */
119 #define FPU_68040 3 /* 68040 on-chip FPU */
120 #define FPU_68060 4 /* 68060 on-chip FPU */
121 #define FPU_UNKNOWN 5 /* placeholder; unknown FPU */
123 /* values for mmutype (assigned for quick testing) */
124 #define MMU_68060 -3 /* 68060 on-chip MMU */
125 #define MMU_68040 -2 /* 68040 on-chip MMU */
126 #define MMU_68030 -1 /* 68030 on-chip subset of 68851 */
127 #define MMU_HP 0 /* HP proprietary */
128 #define MMU_68851 1 /* Motorola 68851 */
129 #define MMU_SUN 2 /* Sun MMU */
138 void copypage040(void *fromaddr
, void *toaddr
);
139 void copypage(void *fromaddr
, void *toaddr
);
140 void zeropage(void *addr
);
142 /* locore.s (XXX: move to support.s?) */
147 void lwp_trampoline(void);
148 void savectx(struct pcb
*);
149 void setfunc_trampoline(void);
152 void w16zero(void *, u_int
);
153 void w16copy(const void *, void *, u_int
);
157 int mappedcopyin(void *fromp
, void *top
, size_t count
);
158 int mappedcopyout(void *fromp
, void *top
, size_t count
);
159 extern u_int mappedcopysize
;
160 #endif /* MAPPEDCOPY */
163 void regdump(struct trapframe
*, int);
166 int cachectl1(u_long
, vaddr_t
, size_t, struct proc
*);
167 int dma_cachectl(void *, int);
171 void physaccess(void *, void *, int, int);
172 void physunaccess(void *, int);
175 #endif /* _M68K_M68K_H_ */