xref: /netbsd-src/sys/arch/m68k/include/m68k.h (revision 5e4c038a45edbc7d63b7c2daa76e29f88b64a4e3)
1 /*	$NetBSD: m68k.h,v 1.8 2001/06/14 15:49:05 fredette 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  *	from: @(#)cpu.h	8.4 (Berkeley) 1/5/94
42  */
43 
44 #ifndef _M68K_M68K_H_
45 #define	_M68K_M68K_H_
46 
47 /*
48  * Declarations for things exported by sources in this directory,
49  * or required by sources in here and not declared elsewhere.
50  *
51  * These declarations generally do NOT belong in <machine/cpu.h>,
52  * because that defines the interface between the common code and
53  * the machine-dependent code, whereas this defines the interface
54  * between the shared m68k code and the machine-dependent code.
55  *
56  * The MMU stuff is exported separately so it can be used just
57  * where it is really needed.  Same for function codes, etc.
58  */
59 
60 #ifdef _KERNEL
61 /*
62  * All m68k ports must provide these globals.
63  */
64 extern	int cputype;		/* CPU on this host */
65 extern	int ectype; 		/* external cache on this host */
66 extern	int fputype;		/* FPU on this host */
67 extern	int mmutype;		/* MMU on this host */
68 #endif	/* _KERNEL */
69 
70 /* values for cputype */
71 #define	CPU_68010	-1	/* 68010 */
72 #define	CPU_68020	0	/* 68020 */
73 #define	CPU_68030	1	/* 68030 */
74 #define	CPU_68040	2	/* 68040 */
75 #define	CPU_68060	3	/* 68060 */
76 
77 /* values for ectype */
78 #define	EC_PHYS		-1	/* external physical address cache */
79 #define	EC_NONE		0	/* no external cache */
80 #define	EC_VIRT		1	/* external virtual address cache */
81 
82 /* values for fputype */
83 #define	FPU_NONE	0	/* no FPU */
84 #define	FPU_68881	1	/* 68881 FPU */
85 #define	FPU_68882	2	/* 68882 FPU */
86 #define	FPU_68040	3	/* 68040 on-chip FPU */
87 #define	FPU_68060	4	/* 68060 on-chip FPU */
88 #define	FPU_UNKNOWN	5	/* placeholder; unknown FPU */
89 
90 /* values for mmutype (assigned for quick testing) */
91 #define	MMU_68060	-3	/* 68060 on-chip MMU */
92 #define	MMU_68040	-2	/* 68040 on-chip MMU */
93 #define	MMU_68030	-1	/* 68030 on-chip subset of 68851 */
94 #define	MMU_HP		0	/* HP proprietary */
95 #define	MMU_68851	1	/* Motorola 68851 */
96 #define	MMU_SUN		2	/* Sun MMU */
97 
98 
99 #ifdef _KERNEL
100 
101 struct trapframe;
102 
103 /* copypage.s */
104 void	copypage040 __P((void *fromaddr, void *toaddr));
105 void	copypage __P((void *fromaddr, void *toaddr));
106 void	zeropage __P((void *addr));
107 
108 /* locore.s (XXX: move to support.s?) */
109 int 	getdfc __P((void));
110 int 	getsfc __P((void));
111 
112 /* w16copy.s */
113 void	w16zero __P((void *, u_int));
114 void	w16copy __P((const void *, void *, u_int));
115 
116 #ifdef MAPPEDCOPY
117 /* mappedcopy.c */
118 int	mappedcopyin __P((void *fromp, void *top, size_t count));
119 int	mappedcopyout __P((void *fromp, void *top, size_t count));
120 extern	u_int mappedcopysize;
121 #endif /* MAPPEDCOPY */
122 
123 /* regdump.c */
124 void	regdump __P((struct trapframe *, int));
125 
126 #endif /* _KERNEL */
127 #endif /* _M68K_M68K_H_ */
128