Home | History | Annotate | Line # | Download | only in include
      1 /*	$NetBSD: reg.h,v 1.7 2008/10/26 19:53:03 uwe Exp $	*/
      2 
      3 /*-
      4  * Copyright (c) 1990 The Regents of the University of California.
      5  * All rights reserved.
      6  *
      7  * This code is derived from software contributed to Berkeley by
      8  * William Jolitz.
      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. Neither the name of the University nor the names of its contributors
     19  *    may be used to endorse or promote products derived from this software
     20  *    without specific prior written permission.
     21  *
     22  * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
     23  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
     24  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
     25  * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
     26  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
     27  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
     28  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
     29  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
     30  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
     31  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
     32  * SUCH DAMAGE.
     33  *
     34  *	@(#)reg.h	5.5 (Berkeley) 1/18/91
     35  */
     36 
     37 #ifndef _SH3_REG_H_
     38 #define	_SH3_REG_H_
     39 
     40 /*
     41  * Location of the users' stored
     42  * registers within appropriate frame of 'trap' and 'syscall', relative to
     43  * base of stack frame.
     44  *
     45  * XXX
     46  * The #defines aren't used in the kernel, but some user-level code still
     47  * expects them.
     48  */
     49 
     50 /* When referenced during a trap/exception, registers are at these offsets */
     51 
     52 #define	tSPC	(0)
     53 #define	tSSR	(1)
     54 #define	tPR	(2)
     55 #define	tR14	(3)
     56 #define	tR13	(4)
     57 #define	tR12	(5)
     58 #define	tR11	(6)
     59 #define	tR10	(7)
     60 #define	tR9	(8)
     61 
     62 #define	tR8	(11)
     63 #define	tR7	(12)
     64 #define	tR6	(13)
     65 #define	tR5	(14)
     66 #define	tR4	(15)
     67 #define	tR3	(16)
     68 #define	tR2	(17)
     69 #define	tR1	(18)
     70 #define	tR0	(19)
     71 
     72 /*
     73  * Registers accessible to ptrace(2) syscall for debugger
     74  * The machine-dependent code for PT_{SET,GET}REGS needs to
     75  * use whichever order, defined above, is correct, so that it
     76  * is all invisible to the user.
     77  */
     78 struct reg {
     79 	int r_spc;
     80 	int r_ssr;
     81 	int r_pr;
     82 	int r_mach;
     83 	int r_macl;
     84 	int r_r15;
     85 	int r_r14;
     86 	int r_r13;
     87 	int r_r12;
     88 	int r_r11;
     89 	int r_r10;
     90 	int r_r9;
     91 	int r_r8;
     92 	int r_r7;
     93 	int r_r6;
     94 	int r_r5;
     95 	int r_r4;
     96 	int r_r3;
     97 	int r_r2;
     98 	int r_r1;
     99 	int r_r0;
    100 	int r_gbr;
    101 };
    102 
    103 
    104 /*
    105  * Old struct reg that is missing r_gbr.  Compat ptrace(2) requests
    106  * are renamed to PT___GETREGS40 and PT___SETREGS40.
    107  */
    108 struct __reg40 {
    109 	int r_spc;
    110 	int r_ssr;
    111 	int r_pr;
    112 	int r_mach;
    113 	int r_macl;
    114 	int r_r15;
    115 	int r_r14;
    116 	int r_r13;
    117 	int r_r12;
    118 	int r_r11;
    119 	int r_r10;
    120 	int r_r9;
    121 	int r_r8;
    122 	int r_r7;
    123 	int r_r6;
    124 	int r_r5;
    125 	int r_r4;
    126 	int r_r3;
    127 	int r_r2;
    128 	int r_r1;
    129 	int r_r0;
    130 };
    131 
    132 #endif /* !_SH3_REG_H_ */
    133