Home | History | Annotate | Line # | Download | only in include
frame.h revision 1.1
      1 /*	$NetBSD: frame.h,v 1.1 1995/02/13 23:07:39 cgd Exp $	*/
      2 
      3 /*
      4  * Copyright (c) 1994, 1995 Carnegie-Mellon University.
      5  * All rights reserved.
      6  *
      7  * Author: Chris G. Demetriou
      8  *
      9  * Permission to use, copy, modify and distribute this software and
     10  * its documentation is hereby granted, provided that both the copyright
     11  * notice and this permission notice appear in all copies of the
     12  * software, derivative works or modified versions, and any portions
     13  * thereof, and that both notices appear in supporting documentation.
     14  *
     15  * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS"
     16  * CONDITION.  CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND
     17  * FOR ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE.
     18  *
     19  * Carnegie Mellon requests users of this software to return to
     20  *
     21  *  Software Distribution Coordinator  or  Software.Distribution (at) CS.CMU.EDU
     22  *  School of Computer Science
     23  *  Carnegie Mellon University
     24  *  Pittsburgh PA 15213-3890
     25  *
     26  * any improvements or extensions that they make and grant Carnegie the
     27  * rights to redistribute these changes.
     28  */
     29 
     30 #ifndef _ALPHA_FRAME_H_
     31 #define	_ALPHA_FRAME_H_
     32 
     33 /*
     34  * XXX where did this info come from?
     35  */
     36 
     37 /*
     38  * Trap and syscall frame.
     39  *
     40  * Hardware puts fields marked "[HW]" on stack.  We have to add
     41  * all of the general-purpose registers except for zero, for sp,
     42  * which is automatically saved in usp for traps, and implicitly
     43  * saved for syscalls, and for a0-a2, which are saved by hardware.
     44  */
     45 
     46 /* Number of registers saved, including padding. */
     47 #define	FRAME_NSAVEREGS	28
     48 
     49 /* The offsets of the registers to be saved, into the array. */
     50 #define	FRAME_V0	0
     51 #define	FRAME_T0	1
     52 #define	FRAME_T1	2
     53 #define	FRAME_T2	3
     54 #define	FRAME_T3	4
     55 #define	FRAME_T4	5
     56 #define	FRAME_T5	6
     57 #define	FRAME_T6	7
     58 #define	FRAME_T7	8
     59 #define	FRAME_S0	9
     60 #define	FRAME_S1	10
     61 #define	FRAME_S2	11
     62 #define	FRAME_S3	12
     63 #define	FRAME_S4	13
     64 #define	FRAME_S5	14
     65 #define	FRAME_S6	15
     66 #define	FRAME_A3	16
     67 #define	FRAME_A4	17
     68 #define	FRAME_A5	18
     69 #define	FRAME_T8	19
     70 #define	FRAME_T9	20
     71 #define	FRAME_T10	21
     72 #define	FRAME_T11	22
     73 #define	FRAME_RA	23
     74 #define	FRAME_T12	24
     75 #define	FRAME_AT	25
     76 #define	FRAME_SP	26
     77 #define	FRAME_SPARE	27	/* spare; padding */
     78 
     79 struct trapframe {
     80 	u_int64_t	tf_regs[FRAME_NSAVEREGS]; /* GPRs (listed above) */
     81 	u_int64_t	tf_ps;			/* processor status [HW] */
     82 	u_int64_t	tf_pc;			/* program counter [HW] */
     83 	u_int64_t	tf_gp;			/* global pointer [HW] */
     84 	u_int64_t	tf_a0;			/* saved a0 [HW] */
     85 	u_int64_t	tf_a1;			/* saved a1 [HW] */
     86 	u_int64_t	tf_a2;			/* saved a2 [HW] */
     87 };
     88 
     89 #endif /* _ALPHA_FRAME_H_ */
     90