1 /* $NetBSD: machdep.h,v 1.15 2011/01/23 21:53:40 skrll 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 * 19 * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS 20 * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED 21 * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 22 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS 23 * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 24 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 25 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 26 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 27 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 28 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 29 * POSSIBILITY OF SUCH DAMAGE. 30 */ 31 32 /* 33 * Definitions for the hppa that are completely private 34 * to the machine-dependent code. Anything needed by 35 * machine-independent code is covered in cpu.h or in 36 * other headers. 37 */ 38 39 /* 40 * XXX there is a lot of stuff in various headers under 41 * hp700/include and hppa/include, and a lot of one-off 42 * `extern's in C files that could probably be moved here. 43 */ 44 45 #ifdef _KERNEL 46 47 /* The primary (aka monarch) CPU HPA */ 48 extern hppa_hpa_t hppa_mcpuhpa; 49 50 /* 51 * cache configuration, for most machines is the same 52 * numbers, so it makes sense to do defines w/ numbers depending 53 * on configured CPU types in the kernel. 54 */ 55 extern int icache_stride, icache_line_mask; 56 extern int dcache_stride, dcache_line_mask; 57 58 extern vaddr_t vmmap; /* XXX - See mem.c */ 59 60 /* Kernel virtual address space available: */ 61 extern vaddr_t virtual_start, virtual_end; 62 63 /* Total physical pages, and low reserved physical pages. */ 64 extern int totalphysmem; 65 extern int availphysmem; 66 extern int resvmem; 67 68 /* BTLB minimum and maximum sizes, in pages. */ 69 extern u_int hppa_btlb_size_min; 70 extern u_int hppa_btlb_size_max; 71 72 /* FPU variables and functions. */ 73 extern int fpu_present; 74 extern u_int fpu_version; 75 extern u_int fpu_csw; 76 void hppa_fpu_bootstrap(u_int); 77 void hppa_fpu_flush(struct lwp *); 78 void hppa_fpu_emulate(struct trapframe *, struct lwp *, u_int); 79 80 /* Interrupt dispatching. */ 81 void hppa_intr(struct trapframe *); 82 83 /* Special pmap functions. */ 84 void pmap_redzone(vaddr_t, vaddr_t, int); 85 86 /* Functions to write low memory and the kernel text. */ 87 void hppa_ktext_stw(vaddr_t, int); 88 void hppa_ktext_stb(vaddr_t, char); 89 90 /* Machine check handling. */ 91 extern u_int os_hpmc; 92 extern u_int os_hpmc_cont; 93 extern u_int os_hpmc_cont_end; 94 int os_toc(void); 95 extern u_int os_toc_end; 96 void hppa_machine_check(int); 97 98 /* BTLB handling. */ 99 int hppa_btlb_insert(pa_space_t, vaddr_t, paddr_t, vsize_t *, u_int); 100 int hppa_btlb_reload(void); 101 int hppa_btlb_purge(pa_space_t, vaddr_t, vsize_t *); 102 103 #endif /* _KERNEL */ 104