1178172Simp/*-
2178172Simp * Copyright (c) 2001, Juniper Networks, Inc.
3178172Simp * All rights reserved.
4178172Simp * Truman Joe, February 2001.
5178172Simp *
6178172Simp * regdef.h -- MIPS register definitions.
7178172Simp *
8178172Simp *	JNPR: regdef.h,v 1.3 2006/08/07 05:38:57 katta
9178172Simp * $FreeBSD$
10178172Simp */
11178172Simp
12178172Simp#ifndef _MACHINE_REGDEF_H_
13178172Simp#define	_MACHINE_REGDEF_H_
14178172Simp
15202031Simp#include <machine/cdefs.h>		/* For API selection */
16202031Simp
17178172Simp#if defined(__ASSEMBLER__)
18178172Simp/* General purpose CPU register names */
19178172Simp#define	zero	$0	/* wired zero */
20178172Simp#define	AT	$at	/* assembler temp */
21178172Simp#define	v0	$2	/* return value */
22178172Simp#define	v1	$3
23178172Simp#define	a0	$4	/* argument registers */
24178172Simp#define	a1	$5
25178172Simp#define	a2	$6
26178172Simp#define	a3	$7
27202031Simp#if defined(__mips_n32) || defined(__mips_n64)
28202031Simp#define	a4	$8
29202031Simp#define	a5	$9
30202031Simp#define	a6	$10
31202031Simp#define	a7	$11
32202031Simp#define	t0	$12	/* Temp regs, not saved accross subroutine calls */
33202031Simp#define	t1	$13
34202031Simp#define	t2	$14
35202031Simp#define	t3	$15
36202031Simp#else
37178172Simp#define	t0	$8	/* caller saved */
38178172Simp#define	t1	$9
39178172Simp#define	t2	$10
40178172Simp#define	t3	$11
41178172Simp#define	t4	$12	/* caller saved - 32 bit env arg reg 64 bit */
42178172Simp#define	t5	$13
43178172Simp#define	t6	$14
44178172Simp#define	t7	$15
45202031Simp#endif
46178172Simp#define	s0	$16	/* callee saved */
47178172Simp#define	s1	$17
48178172Simp#define	s2	$18
49178172Simp#define	s3	$19
50178172Simp#define	s4	$20
51178172Simp#define	s5	$21
52178172Simp#define	s6	$22
53178172Simp#define	s7	$23
54178172Simp#define	t8	$24	/* code generator */
55178172Simp#define	t9	$25
56178172Simp#define	k0	$26	/* kernel temporary */
57178172Simp#define	k1	$27
58178172Simp#define	gp	$28	/* global pointer */
59178172Simp#define	sp	$29	/* stack pointer */
60178172Simp#define	fp	$30	/* frame pointer */
61178172Simp#define	s8	$30	/* callee saved */
62178172Simp#define	ra	$31	/* return address */
63178172Simp
64202031Simp/*
65202031Simp * These are temp registers whose names can be used in either the old
66202031Simp * or new ABI, although they map to different physical registers.  In
67202031Simp * the old ABI, they map to t4-t7, and in the new ABI, they map to a4-a7.
68202031Simp *
69202031Simp * Because they overlap with the last 4 arg regs in the new ABI, ta0-ta3
70202031Simp * should be used only when we need more than t0-t3.
71202031Simp */
72202031Simp#if defined(__mips_n32) || defined(__mips_n64)
73202031Simp#define	ta0	$8
74202031Simp#define	ta1	$9
75202031Simp#define	ta2	$10
76202031Simp#define	ta3	$11
77202031Simp#else
78202031Simp#define	ta0	$12
79202031Simp#define	ta1	$13
80202031Simp#define	ta2	$14
81202031Simp#define	ta3	$15
82202031Simp#endif /* __mips_n32 || __mips_n64 */
83202031Simp
84178172Simp#endif /* __ASSEMBLER__ */
85178172Simp
86178172Simp#endif /* !_MACHINE_REGDEF_H_ */
87