1 /* $NetBSD: machdep.h,v 1.4 2002/08/25 20:19:59 fredette Exp $ */ 2 3 /* 4 * Copyright (c) 2002 The NetBSD Foundation, Inc. 5 * All rights reserved. 6 * 7 * This code is derived from software contributed to The NetBSD Foundation 8 * by Matthew Fredette. 9 * 10 * Redistribution and use in source and binary forms, with or without 11 * modification, are permitted provided that the following conditions 12 * are met: 13 * 1. Redistributions of source code must retain the above copyright 14 * notice, this list of conditions and the following disclaimer. 15 * 2. Redistributions in binary form must reproduce the above copyright 16 * notice, this list of conditions and the following disclaimer in the 17 * documentation and/or other materials provided with the distribution. 18 * 3. All advertising materials mentioning features or use of this software 19 * must display the following acknowledgement: 20 * This product includes software developed by the NetBSD 21 * Foundation, Inc. and its contributors. 22 * 4. Neither the name of The NetBSD Foundation nor the names of its 23 * contributors may be used to endorse or promote products derived 24 * from this software without specific prior written permission. 25 * 26 * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS 27 * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED 28 * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 29 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS 30 * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 31 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 32 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 33 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 34 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 35 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 36 * POSSIBILITY OF SUCH DAMAGE. 37 */ 38 39 /* 40 * Definitions for the hppa that are completely private 41 * to the machine-dependent code. Anything needed by 42 * machine-independent code is covered in cpu.h or in 43 * other headers. 44 */ 45 46 /* 47 * XXX there is a lot of stuff in various headers under 48 * hp700/include and hppa/include, and a lot of one-off 49 * `extern's in C files that could probably be moved here. 50 */ 51 52 #ifdef _KERNEL 53 54 /* 55 * cache configuration, for most machines is the same 56 * numbers, so it makes sense to do defines w/ numbers depending 57 * on configured cpu types in the kernel. 58 */ 59 extern int icache_stride, icache_line_mask; 60 extern int dcache_stride, dcache_line_mask; 61 62 extern vaddr_t vmmap; /* XXX - See mem.c */ 63 64 /* Kernel virtual address space available: */ 65 extern vaddr_t virtual_start, virtual_end; 66 67 /* Total physical pages, and low reserved physical pages. */ 68 extern int totalphysmem; 69 extern int resvmem; 70 71 /* BTLB minimum and maximum sizes, in pages. */ 72 extern u_int hppa_btlb_size_min; 73 extern u_int hppa_btlb_size_max; 74 75 /* FPU variables and functions. */ 76 extern int fpu_present; 77 extern u_int fpu_version; 78 extern u_int fpu_csw; 79 extern paddr_t fpu_cur_uspace; 80 void hppa_fpu_bootstrap __P((u_int)); 81 void hppa_fpu_flush __P((struct proc *)); 82 void hppa_fpu_emulate __P((struct trapframe *, struct proc *)); 83 84 /* Interrupt dispatching. */ 85 extern u_int hppa_intr_depth; 86 void hppa_intr __P((struct trapframe *)); 87 88 /* Special pmap functions. */ 89 void pmap_bootstrap __P((vaddr_t *, vaddr_t *)); 90 void pmap_redzone __P((vaddr_t, vaddr_t, int)); 91 92 /* Functions to write low memory and the kernel text. */ 93 void hppa_ktext_stw __P((vaddr_t, int)); 94 void hppa_ktext_stb __P((vaddr_t, char)); 95 96 /* Machine check handling. */ 97 extern u_int os_hpmc; 98 extern u_int os_hpmc_cont; 99 extern u_int os_hpmc_cont_end; 100 int os_toc __P((void)); 101 extern u_int os_toc_end; 102 void hppa_machine_check __P((int)); 103 104 /* BTLB handling. */ 105 int hppa_btlb_insert __P((pa_space_t space, vaddr_t va, paddr_t pa, 106 vsize_t *lenp, u_int prot)); 107 int hppa_btlb_reload __P((void)); 108 int hppa_btlb_purge __P((pa_space_t, vaddr_t, vsize_t *)); 109 110 #endif /* _KERNEL */ 111