Home | History | Annotate | Download | only in machine
      1 /*	$OpenBSD: regdef.h,v 1.3 2005/08/07 07:29:44 miod Exp $	*/
      2 
      3 /*
      4  * Copyright (c) 1992, 1993
      5  *	The Regents of the University of California.  All rights reserved.
      6  *
      7  * This code is derived from software contributed to Berkeley by
      8  * Ralph Campbell. This file is derived from the MIPS RISC
      9  * Architecture book by Gerry Kane.
     10  *
     11  * Redistribution and use in source and binary forms, with or without
     12  * modification, are permitted provided that the following conditions
     13  * are met:
     14  * 1. Redistributions of source code must retain the above copyright
     15  *    notice, this list of conditions and the following disclaimer.
     16  * 2. Redistributions in binary form must reproduce the above copyright
     17  *    notice, this list of conditions and the following disclaimer in the
     18  *    documentation and/or other materials provided with the distribution.
     19  * 3. Neither the name of the University nor the names of its contributors
     20  *    may be used to endorse or promote products derived from this software
     21  *    without specific prior written permission.
     22  *
     23  * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
     24  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
     25  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
     26  * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
     27  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
     28  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
     29  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
     30  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
     31  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
     32  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
     33  * SUCH DAMAGE.
     34  *
     35  *	@(#)regdef.h	8.1 (Berkeley) 6/10/93
     36  */
     37 #ifndef _MIPS_REGDEF_H_
     38 #define _MIPS_REGDEF_H_
     39 
     40 #if (_MIPS_SIM == _ABI64) && !defined(__mips_n64)
     41 #define __mips_n64 1
     42 #endif
     43 #if (_MIPS_SIM == _ABIN32) &&  !defined(__mips_n32)
     44 #define __mips_n32 1
     45 #endif
     46 
     47 #define zero	$0	/* always zero */
     48 #define AT	$at	/* assembler temp */
     49 #define v0	$2	/* return value */
     50 #define v1	$3
     51 #define a0	$4	/* argument registers */
     52 #define a1	$5
     53 #define a2	$6
     54 #define a3	$7
     55 #if defined(__mips_n32) || defined(__mips_n64)
     56 #define a4	$8	/* expanded register arguments */
     57 #define a5	$9
     58 #define a6	$10
     59 #define a7	$11
     60 #define ta0	$8	/* alias */
     61 #define ta1	$9
     62 #define ta2	$10
     63 #define ta3	$11
     64 #define t0	$12	/* temp registers (not saved across subroutine calls) */
     65 #define t1	$13
     66 #define t2	$14
     67 #define t3	$15
     68 #else
     69 #define t0	$8	/* temp registers (not saved across subroutine calls) */
     70 #define t1	$9
     71 #define t2	$10
     72 #define t3	$11
     73 #define t4	$12
     74 #define t5	$13
     75 #define t6	$14
     76 #define t7	$15
     77 #define ta0	$12	/* alias */
     78 #define ta1	$13
     79 #define ta2	$14
     80 #define ta3	$15
     81 #endif
     82 #define s0	$16	/* saved across subroutine calls (callee saved) */
     83 #define s1	$17
     84 #define s2	$18
     85 #define s3	$19
     86 #define s4	$20
     87 #define s5	$21
     88 #define s6	$22
     89 #define s7	$23
     90 #define t8	$24	/* two more temp registers */
     91 #define t9	$25
     92 #define k0	$26	/* kernel temporary */
     93 #define k1	$27
     94 #define gp	$28	/* global pointer */
     95 #define sp	$29	/* stack pointer */
     96 #define s8	$30	/* one more callee saved */
     97 #define ra	$31	/* return address */
     98 
     99 #endif /* !_MIPS_REGDEF_H_ */
    100