1 /* $NetBSD: m68k.h,v 1.6 1997/10/21 19:15:33 gwr 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_68020 0 /* 68020 */ 72 #define CPU_68030 1 /* 68030 */ 73 #define CPU_68040 2 /* 68040 */ 74 #define CPU_68060 3 /* 68060 */ 75 76 /* values for ectype */ 77 #define EC_PHYS -1 /* external physical address cache */ 78 #define EC_NONE 0 /* no external cache */ 79 #define EC_VIRT 1 /* external virtual address cache */ 80 81 /* values for fputype */ 82 #define FPU_NONE 0 /* no FPU */ 83 #define FPU_68881 1 /* 68881 FPU */ 84 #define FPU_68882 2 /* 68882 FPU */ 85 #define FPU_68040 3 /* 68040 on-chip FPU */ 86 #define FPU_68060 4 /* 68060 on-chip FPU */ 87 #define FPU_UNKNOWN 5 /* placeholder; unknown FPU */ 88 89 /* values for mmutype (assigned for quick testing) */ 90 #define MMU_68060 -3 /* 68060 on-chip MMU */ 91 #define MMU_68040 -2 /* 68040 on-chip MMU */ 92 #define MMU_68030 -1 /* 68030 on-chip subset of 68851 */ 93 #define MMU_HP 0 /* HP proprietary */ 94 #define MMU_68851 1 /* Motorola 68851 */ 95 #define MMU_SUN 2 /* Sun MMU */ 96 97 98 #ifdef _KERNEL 99 100 struct trapframe; 101 102 /* copypage.s */ 103 void copypage040 __P((void *fromaddr, void *toaddr)); 104 void copypage __P((void *fromaddr, void *toaddr)); 105 void zeropage __P((void *addr)); 106 107 /* locore.s (XXX: move to support.s?) */ 108 int getdfc __P((void)); 109 int getsfc __P((void)); 110 111 #ifdef MAPPEDCOPY 112 /* mappedcopy.c */ 113 int mappedcopyin __P((void *fromp, void *top, size_t count)); 114 int mappedcopyout __P((void *fromp, void *top, size_t count)); 115 extern u_int mappedcopysize; 116 #endif /* MAPPEDCOPY */ 117 118 /* regdump.c */ 119 void regdump __P((struct trapframe *, int)); 120 121 #endif /* _KERNEL */ 122 #endif /* _M68K_M68K_H_ */ 123