cpu.h revision 1.67 1 1.67 thorpej /* $NetBSD: cpu.h,v 1.67 2024/01/20 00:15:33 thorpej Exp $ */
2 1.1 oki
3 1.1 oki /*
4 1.52 rmind * Copyright (c) 1988 University of Utah.
5 1.1 oki * Copyright (c) 1982, 1990, 1993
6 1.1 oki * The Regents of the University of California. All rights reserved.
7 1.29 agc *
8 1.29 agc * This code is derived from software contributed to Berkeley by
9 1.29 agc * the Systems Programming Group of the University of Utah Computer
10 1.29 agc * Science Department.
11 1.29 agc *
12 1.29 agc * Redistribution and use in source and binary forms, with or without
13 1.29 agc * modification, are permitted provided that the following conditions
14 1.29 agc * are met:
15 1.29 agc * 1. Redistributions of source code must retain the above copyright
16 1.29 agc * notice, this list of conditions and the following disclaimer.
17 1.29 agc * 2. Redistributions in binary form must reproduce the above copyright
18 1.29 agc * notice, this list of conditions and the following disclaimer in the
19 1.29 agc * documentation and/or other materials provided with the distribution.
20 1.29 agc * 3. Neither the name of the University nor the names of its contributors
21 1.29 agc * may be used to endorse or promote products derived from this software
22 1.29 agc * without specific prior written permission.
23 1.29 agc *
24 1.29 agc * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
25 1.29 agc * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
26 1.29 agc * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
27 1.29 agc * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
28 1.29 agc * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
29 1.29 agc * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
30 1.29 agc * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
31 1.29 agc * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
32 1.29 agc * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
33 1.29 agc * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
34 1.29 agc * SUCH DAMAGE.
35 1.29 agc *
36 1.29 agc * from: Utah $Hdr: cpu.h 1.16 91/03/25$
37 1.29 agc *
38 1.29 agc * @(#)cpu.h 8.4 (Berkeley) 1/5/94
39 1.29 agc */
40 1.1 oki
41 1.1 oki #ifndef _X68K_CPU_H_
42 1.1 oki #define _X68K_CPU_H_
43 1.1 oki
44 1.26 mrg #if defined(_KERNEL_OPT)
45 1.23 thorpej #include "opt_lockdebug.h"
46 1.21 minoura #endif
47 1.1 oki
48 1.1 oki /*
49 1.3 thorpej * Get common m68k CPU definitions.
50 1.3 thorpej */
51 1.3 thorpej #include <m68k/cpu.h>
52 1.56 tsutsui
53 1.56 tsutsui #if defined(_KERNEL)
54 1.56 tsutsui /*
55 1.13 minoura * The rest of this should probably be moved to <machine/x68kcpu.h>
56 1.1 oki * although some of it could probably be put into generic 68k headers.
57 1.1 oki */
58 1.1 oki
59 1.53 tsutsui extern uint8_t *intiobase;
60 1.53 tsutsui extern uint8_t *intiolimit;
61 1.2 oki
62 1.6 oki /* machdep.c functions */
63 1.33 chs void dumpsys(void);
64 1.2 oki
65 1.17 minoura /* machdep.c functions */
66 1.34 he int badaddr(volatile void*);
67 1.34 he int badbaddr(volatile void*);
68 1.2 oki
69 1.67 thorpej #endif /* _KERNEL */
70 1.1 oki
71 1.1 oki /* physical memory sections */
72 1.1 oki #define INTIOBASE (0x00C00000)
73 1.1 oki #define INTIOTOP (0x01000000)
74 1.1 oki
75 1.1 oki /*
76 1.1 oki * Internal IO space:
77 1.1 oki *
78 1.1 oki * Ranges from 0xC00000 to 0x1000000 (IIOMAPSIZE).
79 1.1 oki *
80 1.1 oki * Internal IO space is mapped in the kernel from ``IODEVbase'' to
81 1.1 oki * ``intiolimit'' (defined in locore.s). Since it is always mapped,
82 1.1 oki * conversion between physical and kernel virtual addresses is easy.
83 1.1 oki */
84 1.47 isaki #define IIOV(pa) ((u_int)(pa) - INTIOBASE + (u_int)intiobase)
85 1.47 isaki #define IIOP(va) ((u_int)(va) - (u_int)intiobase + INTIOBASE)
86 1.1 oki #define IIOPOFF(pa) ((int)(pa)-INTIOBASE)
87 1.1 oki #define IIOMAPSIZE btoc(INTIOTOP-INTIOBASE) /* 4mb */
88 1.1 oki
89 1.1 oki #endif /* _X68K_CPU_H_ */
90