1 1.20 rmind /* $NetBSD: frame.h,v 1.20 2012/02/19 21:06:26 rmind Exp $ */ 2 1.11 agc 3 1.11 agc /*- 4 1.13 wiz * Copyright (c) 2002 The NetBSD Foundation, Inc. All rights reserved. 5 1.11 agc * Copyright (c) 1990 The Regents of the University of California. 6 1.11 agc * All rights reserved. 7 1.11 agc * 8 1.11 agc * This code is derived from software contributed to Berkeley by 9 1.11 agc * William Jolitz. 10 1.11 agc * 11 1.11 agc * Redistribution and use in source and binary forms, with or without 12 1.11 agc * modification, are permitted provided that the following conditions 13 1.11 agc * are met: 14 1.11 agc * 1. Redistributions of source code must retain the above copyright 15 1.11 agc * notice, this list of conditions and the following disclaimer. 16 1.11 agc * 2. Redistributions in binary form must reproduce the above copyright 17 1.11 agc * notice, this list of conditions and the following disclaimer in the 18 1.11 agc * documentation and/or other materials provided with the distribution. 19 1.11 agc * 3. Neither the name of the University nor the names of its contributors 20 1.11 agc * may be used to endorse or promote products derived from this software 21 1.11 agc * without specific prior written permission. 22 1.11 agc * 23 1.11 agc * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND 24 1.11 agc * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 25 1.11 agc * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 26 1.11 agc * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE 27 1.11 agc * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 28 1.11 agc * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 29 1.11 agc * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 30 1.11 agc * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 31 1.11 agc * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 32 1.11 agc * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 33 1.11 agc * SUCH DAMAGE. 34 1.11 agc * 35 1.11 agc * @(#)frame.h 5.2 (Berkeley) 1/18/91 36 1.11 agc */ 37 1.1 itojun 38 1.1 itojun /*- 39 1.1 itojun * Copyright (c) 1995 Charles M. Hannum. All rights reserved. 40 1.1 itojun * 41 1.1 itojun * This code is derived from software contributed to Berkeley by 42 1.1 itojun * William Jolitz. 43 1.1 itojun * 44 1.1 itojun * Redistribution and use in source and binary forms, with or without 45 1.1 itojun * modification, are permitted provided that the following conditions 46 1.1 itojun * are met: 47 1.1 itojun * 1. Redistributions of source code must retain the above copyright 48 1.1 itojun * notice, this list of conditions and the following disclaimer. 49 1.1 itojun * 2. Redistributions in binary form must reproduce the above copyright 50 1.1 itojun * notice, this list of conditions and the following disclaimer in the 51 1.1 itojun * documentation and/or other materials provided with the distribution. 52 1.1 itojun * 3. All advertising materials mentioning features or use of this software 53 1.1 itojun * must display the following acknowledgement: 54 1.1 itojun * This product includes software developed by the University of 55 1.1 itojun * California, Berkeley and its contributors. 56 1.1 itojun * 4. Neither the name of the University nor the names of its contributors 57 1.1 itojun * may be used to endorse or promote products derived from this software 58 1.1 itojun * without specific prior written permission. 59 1.1 itojun * 60 1.1 itojun * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND 61 1.1 itojun * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 62 1.1 itojun * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 63 1.1 itojun * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE 64 1.1 itojun * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 65 1.1 itojun * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 66 1.1 itojun * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 67 1.1 itojun * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 68 1.1 itojun * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 69 1.1 itojun * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 70 1.1 itojun * SUCH DAMAGE. 71 1.1 itojun * 72 1.1 itojun * @(#)frame.h 5.2 (Berkeley) 1/18/91 73 1.1 itojun */ 74 1.1 itojun 75 1.1 itojun #ifndef _SH3_FRAME_H_ 76 1.7 uch #define _SH3_FRAME_H_ 77 1.1 itojun 78 1.1 itojun #include <sys/signal.h> 79 1.1 itojun 80 1.1 itojun /* 81 1.5 uch * Exception Stack Frame 82 1.1 itojun */ 83 1.1 itojun struct trapframe { 84 1.3 uch /* software member */ 85 1.8 uch int tf_expevt; 86 1.2 tsubai int tf_ubc; 87 1.3 uch /* hardware registers */ 88 1.1 itojun int tf_spc; 89 1.1 itojun int tf_ssr; 90 1.16 uwe int tf_gbr; 91 1.1 itojun int tf_macl; 92 1.1 itojun int tf_mach; 93 1.1 itojun int tf_pr; 94 1.1 itojun int tf_r13; 95 1.1 itojun int tf_r12; 96 1.1 itojun int tf_r11; 97 1.1 itojun int tf_r10; 98 1.1 itojun int tf_r9; 99 1.1 itojun int tf_r8; 100 1.1 itojun int tf_r7; 101 1.1 itojun int tf_r6; 102 1.1 itojun int tf_r5; 103 1.1 itojun int tf_r4; 104 1.1 itojun int tf_r3; 105 1.1 itojun int tf_r2; 106 1.1 itojun int tf_r1; 107 1.1 itojun int tf_r0; 108 1.1 itojun int tf_r15; 109 1.4 uch int tf_r14; 110 1.1 itojun }; 111 1.1 itojun 112 1.1 itojun /* 113 1.1 itojun * Stack frame inside cpu_switch() 114 1.1 itojun */ 115 1.1 itojun struct switchframe { 116 1.17 uwe int sf_gbr; 117 1.17 uwe int sf_sr; 118 1.17 uwe int sf_pr; 119 1.17 uwe int sf_r8; 120 1.17 uwe int sf_r9; 121 1.17 uwe int sf_r10; 122 1.17 uwe int sf_r11; 123 1.17 uwe int sf_r12; 124 1.17 uwe int sf_r13; 125 1.17 uwe int sf_r14; 126 1.4 uch int sf_r15; 127 1.4 uch int sf_r6_bank; 128 1.8 uch int sf_r7_bank; 129 1.1 itojun }; 130 1.1 itojun 131 1.1 itojun /* 132 1.12 uwe * Signal frame. 133 1.12 uwe * 134 1.12 uwe * NB: The order of sf_uc and sf_si is different from what other ports 135 1.12 uwe * use (siginfo at the top of the stack), because we want to avoid 136 1.12 uwe * wasting two instructions in __sigtramp_siginfo_2 to skip to the 137 1.12 uwe * ucontext. Not that this order really matters, but I think this 138 1.12 uwe * inconsistency deserves an explanation. 139 1.12 uwe */ 140 1.12 uwe struct sigframe_siginfo { 141 1.12 uwe #if 0 /* in registers on entry to signal trampoline */ 142 1.12 uwe int sf_signum; /* r4 - "signum" argument for handler */ 143 1.12 uwe siginfo_t *sf_sip; /* r5 - "sip" argument for handler */ 144 1.12 uwe ucontext_t *sf_ucp; /* r6 - "ucp" argument for handler */ 145 1.12 uwe #endif 146 1.12 uwe ucontext_t sf_uc; /* actual saved ucontext */ 147 1.12 uwe siginfo_t sf_si; /* actual saved siginfo */ 148 1.12 uwe }; 149 1.12 uwe 150 1.12 uwe #if defined(COMPAT_16) && defined(_KERNEL) 151 1.12 uwe /* 152 1.12 uwe * Old signal frame format. 153 1.1 itojun */ 154 1.12 uwe struct sigframe_sigcontext { 155 1.12 uwe #if 0 /* in registers on entry to signal trampoline */ 156 1.12 uwe int sf_signum; /* r4 - "signum" argument for handler */ 157 1.12 uwe int sf_code; /* r5 - "code" argument for handler */ 158 1.12 uwe struct sigcontext *sf_scp; /* r6 - "scp" argument for handler */ 159 1.12 uwe #endif 160 1.12 uwe struct sigcontext sf_sc; /* actual saved context */ 161 1.10 thorpej }; 162 1.12 uwe #endif 163 1.10 thorpej 164 1.19 uwe #ifdef _KERNEL 165 1.19 uwe void *getframe(const struct lwp *, int, int *); 166 1.19 uwe #endif 167 1.19 uwe 168 1.1 itojun #endif /* !_SH3_FRAME_H_ */ 169