1 /* $NetBSD: machdep.h,v 1.27 2001/09/05 13:21:10 tsutsui Exp $ */ 2 3 /* 4 * Copyright (c) 1994 Gordon W. Ross 5 * Copyright (c) 1993 Adam Glass 6 * Copyright (c) 1988 University of Utah. 7 * Copyright (c) 1982, 1990 The Regents of the University of California. 8 * All rights reserved. 9 * 10 * This code is derived from software contributed to Berkeley by 11 * the Systems Programming Group of the University of Utah Computer 12 * Science Department. 13 * 14 * Redistribution and use in source and binary forms, with or without 15 * modification, are permitted provided that the following conditions 16 * are met: 17 * 1. Redistributions of source code must retain the above copyright 18 * notice, this list of conditions and the following disclaimer. 19 * 2. Redistributions in binary form must reproduce the above copyright 20 * notice, this list of conditions and the following disclaimer in the 21 * documentation and/or other materials provided with the distribution. 22 * 3. All advertising materials mentioning features or use of this software 23 * must display the following acknowledgement: 24 * This product includes software developed by the University of 25 * California, Berkeley and its contributors. 26 * 4. Neither the name of the University nor the names of its contributors 27 * may be used to endorse or promote products derived from this software 28 * without specific prior written permission. 29 * 30 * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND 31 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 32 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 33 * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE 34 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 35 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 36 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 37 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 38 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 39 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 40 * SUCH DAMAGE. 41 * 42 * from: Utah Hdr: cpu.h 1.16 91/03/25 43 * from: @(#)cpu.h 7.7 (Berkeley) 6/27/91 44 * cpu.h,v 1.2 1993/05/22 07:58:17 cgd Exp 45 */ 46 47 /* 48 * Internal definitions unique to sun3/68k cpu support. 49 * These are the "private" declarations - those needed 50 * only here in machine-independent code. The "public" 51 * definitions are in cpu.h (used by common code). 52 */ 53 54 #ifdef _KERNEL 55 56 /* Prototypes... */ 57 58 struct frame; 59 struct fpframe; 60 struct pcb; 61 struct proc; 62 struct reg; 63 struct trapframe; 64 struct uio; 65 struct mmu_rootptr; 66 67 extern label_t *nofault; 68 69 extern vaddr_t vmmap; /* XXX - See mem.c */ 70 71 /* Cache flush functions. */ 72 void DCIA __P((void)); 73 void DCIU __P((void)); 74 void ICIA __P((void)); 75 76 void clock_init __P((void)); 77 void cninit __P((void)); 78 79 void dumpconf __P((void)); 80 void dumpsys __P((void)); 81 82 void enable_fpu __P((int)); 83 void enable_init __P((void)); 84 void enable_video __P((int)); 85 86 int fpu_emulate __P((struct trapframe *, struct fpframe *)); 87 88 /* Backward compatibility... */ 89 #define getsr _getsr 90 91 void** getvbr __P((void)); 92 int getcrp __P((struct mmu_rootptr *)); 93 94 void initfpu __P((void)); 95 void intreg_init __P((void)); 96 97 void isr_init __P((void)); 98 void isr_config __P((void)); 99 100 void m68881_save __P((struct fpframe *)); 101 void m68881_restore __P((struct fpframe *)); 102 103 void netintr __P((void)); 104 105 caddr_t obio_find_mapping __P((paddr_t pa, psize_t size)); 106 void obio_init __P((void)); 107 108 void proc_trampoline __P((void)); 109 110 void savectx __P((struct pcb *)); 111 112 void setvbr __P((void **)); 113 114 void sunmon_abort __P((void)); 115 void sunmon_halt __P((void)); 116 void sunmon_init __P((void)); 117 void sunmon_reboot __P((char *)); 118 119 void swapconf __P((void)); 120 121 void switch_exit __P((struct proc *)); 122 123 void zs_init __P((void)); 124 125 #ifdef _SUN3_ 126 127 struct sun3_kcore_hdr; 128 129 extern int cache_size; 130 void cache_enable __P((void)); 131 132 /* Kernel virtual address space available: */ 133 extern vaddr_t virtual_avail, virtual_end; 134 /* Physical address space available: */ 135 extern paddr_t avail_start, avail_end; 136 /* The "hole" (used to skip the Sun3/50 video RAM) */ 137 extern paddr_t hole_start, hole_size; 138 139 /* cache.c */ 140 void cache_enable __P((void)); 141 void cache_flush_page(vaddr_t pgva); 142 void cache_flush_segment(vaddr_t sgva); 143 void cache_flush_context(void); 144 145 /* pmap.c */ 146 void pmap_bootstrap __P((vaddr_t nextva)); 147 void pmap_kcore_hdr __P((struct sun3_kcore_hdr *)); 148 void pmap_get_pagemap __P((int *pt, int off)); 149 150 #endif /* SUN3 */ 151 152 #ifdef _SUN3X_ 153 154 struct mmu_rootptr; 155 struct sun3x_kcore_hdr; 156 157 extern int has_iocache; 158 159 /* This is set by locore.s with the monitor's root ptr. */ 160 extern struct mmu_rootptr mon_crp; 161 162 /* Lowest "managed" kernel virtual address. */ 163 extern vaddr_t virtual_avail; 164 165 /* Cache flush ops, Sun3X specific. */ 166 void DCIAS __P((paddr_t)); 167 void DCIS __P((void)); 168 void ICPA __P((void)); 169 void PCIA __P((void)); 170 /* ATC flush operations. */ 171 void TBIA __P((void)); 172 void TBIS __P((vaddr_t)); 173 void TBIAS __P((void)); 174 void TBIAU __P((void)); 175 176 void loadcrp __P((struct mmu_rootptr *)); 177 178 void pmap_bootstrap __P((vaddr_t nextva)); 179 void pmap_kcore_hdr __P((struct sun3x_kcore_hdr *)); 180 int pmap_pa_exists __P((paddr_t pa)); 181 182 #endif /* SUN3X */ 183 184 #endif /* _KERNEL */ 185