Rizin
unix-like reverse engineering framework and cli tools
linux-mips.h
Go to the documentation of this file.
1 // SPDX-FileCopyrightText: 2015 pancake <pancake@nopcode.org>
2 // SPDX-License-Identifier: LGPL-3.0-only
3 
4 #if 0
6  ---+-----------+-------------
7  0 zero always zero
8  1 at reserved for assembler
9  2-3 v0-v1 expression evaluation, result of function
10  4-7 a0-a3 arguments for functions
11  8-15 t0-t7 temporary (not preserved across calls)
12  16-23 s0-s7 saved temporary (preserved across calls)
13  24-25 t8-t9 temporary (not preserved across calls)
14  26-27 k0-k1 reserved for OS kernel
15  28 gp points to global area
16  29 sp stack pointer
17  30 fp frame pointer
18  31 ra return address
19 #if 0
20 16 /* 0 - 31 are integer registers, 32 - 63 are fp registers. */
21 PC = 272
22 17 #define FPR_BASE 32
23 18 #define PC 64
24 19 #define CAUSE 65
25 20 #define BADVADDR 66
26 21 #define MMHI 67
27 22 #define MMLO 68
28 23 #define FPC_CSR 69
29 24 #define FPC_EIR 70
30 #endif
31 
32 #endif
33 
34 /* IMPORTANT - MIPS ptrace always returns the registers in 64bits format,
35  so this register table has been modified from 64 bits to 32 bits.
36  Example:
37  Originals (64 bits):
38  "gpr at .64 8 0\n"
39  "gpr v0 .64 16 0\n"
40  Modified to (32 bits):
41  "gpr at .32 12 0\n"
42  "gpr v0 .32 20 0\n"
43 
44  It is using the same arena->size, but we are only using the last 4 bytes
45  (LITTLE ENDIAN PROBLEMS?)
46 */
47 return strdup(
48  "=PC pc\n"
49  "=SP sp\n"
50  "=BP fp\n"
51  "=A0 a0\n"
52  "=A1 a1\n"
53  "=A2 a2\n"
54  "=A3 a3\n"
55  "gpr zero .32 4 0\n"
56  // XXX DUPPED CAUSES FAILURE "gpr at .32 8 0\n"
57  "gpr at .32 12 0\n"
58  "gpr v0 .32 20 0\n"
59  "gpr v1 .32 28 0\n"
60  /* args */
61  "gpr a0 .32 36 0\n"
62  "gpr a1 .32 44 0\n"
63  "gpr a2 .32 52 0\n"
64  "gpr a3 .32 60 0\n"
65  /* tmp */
66  "gpr t0 .32 68 0\n"
67  "gpr t1 .32 76 0\n"
68  "gpr t2 .32 84 0\n"
69  "gpr t3 .32 92 0\n"
70  "gpr t4 .32 100 0\n"
71  "gpr t5 .32 108 0\n"
72  "gpr t6 .32 116 0\n"
73  "gpr t7 .32 124 0\n"
74  /* saved */
75  "gpr s0 .32 132 0\n"
76  "gpr s1 .32 140 0\n"
77  "gpr s2 .32 148 0\n"
78  "gpr s3 .32 156 0\n"
79  "gpr s4 .32 164 0\n"
80  "gpr s5 .32 172 0\n"
81  "gpr s6 .32 180 0\n"
82  "gpr s7 .32 188 0\n"
83  /* tmp */
84  "gpr t8 .32 196 0\n"
85  "gpr t9 .32 204 0\n"
86  /* special */
87  "gpr k0 .32 212 0\n"
88  "gpr k1 .32 220 0\n"
89  "gpr gp .32 228 0\n"
90  "gpr sp .32 236 0\n"
91  "gpr fp .32 244 0\n"
92  "gpr ra .32 252 0\n"
93  /* extra */
94  "gpr pc .32 276 0\n");
#define PC(addr, is_thumb)
Definition: arm_il32.c:108
void usage(const char *message)
@ OS
Definition: inflate.h:24
a0
Definition: insn-good.s.cs:704
#define reg(n)
@ v0
Definition: lanai.h:84
@ v1
Definition: lanai.h:85
return strdup("=PC pc\n" "=SP sp\n" "=BP fp\n" "=A0 a0\n" "=A1 a1\n" "=A2 a2\n" "=A3 a3\n" "gpr zero .32 4 0\n" "gpr at .32 12 0\n" "gpr v0 .32 20 0\n" "gpr v1 .32 28 0\n" "gpr a0 .32 36 0\n" "gpr a1 .32 44 0\n" "gpr a2 .32 52 0\n" "gpr a3 .32 60 0\n" "gpr t0 .32 68 0\n" "gpr t1 .32 76 0\n" "gpr t2 .32 84 0\n" "gpr t3 .32 92 0\n" "gpr t4 .32 100 0\n" "gpr t5 .32 108 0\n" "gpr t6 .32 116 0\n" "gpr t7 .32 124 0\n" "gpr s0 .32 132 0\n" "gpr s1 .32 140 0\n" "gpr s2 .32 148 0\n" "gpr s3 .32 156 0\n" "gpr s4 .32 164 0\n" "gpr s5 .32 172 0\n" "gpr s6 .32 180 0\n" "gpr s7 .32 188 0\n" "gpr t8 .32 196 0\n" "gpr t9 .32 204 0\n" "gpr k0 .32 212 0\n" "gpr k1 .32 220 0\n" "gpr gp .32 228 0\n" "gpr sp .32 236 0\n" "gpr fp .32 244 0\n" "gpr ra .32 252 0\n" "gpr pc .32 276 0\n")
@ reserved
Definition: lm32_isa.h:94
static struct sockaddr static addrlen static backlog const void static flags void struct sockaddr socklen_t static fromlen const void const struct sockaddr to
Definition: sfsocketcall.h:125
#define s0(x)
Definition: sha256.c:59
Definition: z80asm.h:102
Definition: z80asm.h:140
static int sp
Definition: z80asm.c:91