master
1/* $NetBSD: m68k.h,v 1.24 2019/04/06 03:06:26 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. Neither the name of the University nor the names of its contributors
21 * may be used to endorse or promote products derived from this software
22 * without specific prior written permission.
23 *
24 * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
25 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
26 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
27 * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
28 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
29 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
30 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
31 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
32 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
33 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
34 * SUCH DAMAGE.
35 *
36 * from: Utah $Hdr: cpu.h 1.16 91/03/25$
37 * from: @(#)cpu.h 8.4 (Berkeley) 1/5/94
38 */
39
40#ifndef _M68K_M68K_H_
41#define _M68K_M68K_H_
42
43/*
44 * Declarations for things exported by sources in this directory,
45 * or required by sources in here and not declared elsewhere.
46 *
47 * These declarations generally do NOT belong in <machine/cpu.h>,
48 * because that defines the interface between the common code and
49 * the machine-dependent code, whereas this defines the interface
50 * between the shared m68k code and the machine-dependent code.
51 *
52 * The MMU stuff is exported separately so it can be used just
53 * where it is really needed. Same for function codes, etc.
54 */
55
56#ifdef _KERNEL
57/*
58 * All m68k ports must provide these globals.
59 */
60extern int cputype; /* CPU on this host */
61extern int ectype; /* external cache on this host */
62extern int fputype; /* FPU on this host */
63extern int mmutype; /* MMU on this host */
64#endif /* _KERNEL */
65
66/* values for cputype */
67#define CPU_68010 -1 /* 68010 */
68#define CPU_68020 0 /* 68020 */
69#define CPU_68030 1 /* 68030 */
70#define CPU_68040 2 /* 68040 */
71#define CPU_68060 3 /* 68060 */
72
73/* values for ectype */
74#define EC_PHYS -1 /* external physical address cache */
75#define EC_NONE 0 /* no external cache */
76#define EC_VIRT 1 /* external virtual address cache */
77
78/* values for fputype */
79#define FPU_NONE 0 /* no FPU */
80#define FPU_68881 1 /* 68881 FPU */
81#define FPU_68882 2 /* 68882 FPU */
82#define FPU_68040 3 /* 68040 on-chip FPU */
83#define FPU_68060 4 /* 68060 on-chip FPU */
84#define FPU_UNKNOWN 5 /* placeholder; unknown FPU */
85
86/* values for mmutype (assigned for quick testing) */
87#define MMU_68060 -3 /* 68060 on-chip MMU */
88#define MMU_68040 -2 /* 68040 on-chip MMU */
89#define MMU_68030 -1 /* 68030 on-chip subset of 68851 */
90#define MMU_HP 0 /* HP proprietary */
91#define MMU_68851 1 /* Motorola 68851 */
92#define MMU_SUN 2 /* Sun MMU */
93
94
95#ifdef _KERNEL
96
97struct pcb;
98struct trapframe;
99struct fpframe;
100
101/* copypage.s */
102void copypage040(void *fromaddr, void *toaddr);
103void copypage(void *fromaddr, void *toaddr);
104void zeropage(void *addr);
105
106/* support.s */
107int getdfc(void);
108int getsfc(void);
109
110/* switch_subr.s */
111void lwp_trampoline(void);
112void m68881_save(struct fpframe *);
113void m68881_restore(struct fpframe *);
114void savectx(struct pcb *);
115
116/* w16copy.s */
117void w16zero(void *, u_int);
118void w16copy(const void *, void *, u_int);
119
120/* fpu.c */
121int fpu_probe(void);
122
123/* regdump.c */
124void regdump(struct trapframe *, int);
125
126/* sys_machdep.c */
127int cachectl1(u_long, vaddr_t, size_t, struct proc *);
128int dma_cachectl(void *, int);
129
130/* vm_machdep.c */
131int kvtop(void *);
132void physaccess(void *, void *, int, int);
133void physunaccess(void *, int);
134
135#endif /* _KERNEL */
136#endif /* _M68K_M68K_H_ */