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