1 /*-
2 * Copyright (c) 2001, Juniper Networks, Inc.
3 * All rights reserved.
4 * Truman Joe, February 2001.
5 *
6 * regdef.h -- MIPS register definitions.
7 *
8 * JNPR: regdef.h,v 1.3 2006/08/07 05:38:57 katta
9 * $FreeBSD: releng/9.0/sys/mips/include/regdef.h 202175 2010-01-12 21:36:08Z imp $
10 */
11
12 #ifndef _MACHINE_REGDEF_H_
13 #define _MACHINE_REGDEF_H_
14
15 #include <machine/cdefs.h> /* For API selection */
16
17 #if defined(__ASSEMBLER__)
18 /* General purpose CPU register names */
19 #define zero $0 /* wired zero */
20 #define AT $at /* assembler temp */
21 #define v0 $2 /* return value */
22 #define v1 $3
23 #define a0 $4 /* argument registers */
24 #define a1 $5
25 #define a2 $6
26 #define a3 $7
27 #if defined(__mips_n32) || defined(__mips_n64)
28 #define a4 $8
29 #define a5 $9
30 #define a6 $10
31 #define a7 $11
32 #define t0 $12 /* Temp regs, not saved accross subroutine calls */
33 #define t1 $13
34 #define t2 $14
35 #define t3 $15
36 #else
37 #define t0 $8 /* caller saved */
38 #define t1 $9
39 #define t2 $10
40 #define t3 $11
41 #define t4 $12 /* caller saved - 32 bit env arg reg 64 bit */
42 #define t5 $13
43 #define t6 $14
44 #define t7 $15
45 #endif
46 #define s0 $16 /* callee saved */
47 #define s1 $17
48 #define s2 $18
49 #define s3 $19
50 #define s4 $20
51 #define s5 $21
52 #define s6 $22
53 #define s7 $23
54 #define t8 $24 /* code generator */
55 #define t9 $25
56 #define k0 $26 /* kernel temporary */
57 #define k1 $27
58 #define gp $28 /* global pointer */
59 #define sp $29 /* stack pointer */
60 #define fp $30 /* frame pointer */
61 #define s8 $30 /* callee saved */
62 #define ra $31 /* return address */
63
64 /*
65 * These are temp registers whose names can be used in either the old
66 * or new ABI, although they map to different physical registers. In
67 * the old ABI, they map to t4-t7, and in the new ABI, they map to a4-a7.
68 *
69 * Because they overlap with the last 4 arg regs in the new ABI, ta0-ta3
70 * should be used only when we need more than t0-t3.
71 */
72 #if defined(__mips_n32) || defined(__mips_n64)
73 #define ta0 $8
74 #define ta1 $9
75 #define ta2 $10
76 #define ta3 $11
77 #else
78 #define ta0 $12
79 #define ta1 $13
80 #define ta2 $14
81 #define ta3 $15
82 #endif /* __mips_n32 || __mips_n64 */
83
84 #endif /* __ASSEMBLER__ */
85
86 #endif /* !_MACHINE_REGDEF_H_ */
Cache object: 2f9b51e8ad14e20e18b8ffc93fe7dbbc
|