ReactOS 0.4.15-dev-5666-gc548b97
cpu_arm64.c File Reference
#include <assert.h>
#include "ntstatus.h"
#include "dbghelp_private.h"
#include "winternl.h"
#include "wine/debug.h"
Include dependency graph for cpu_arm64.c:

Go to the source code of this file.

Macros

#define NONAMELESSUNION
 
#define NONAMELESSSTRUCT
 
#define WIN32_NO_STATUS
 

Functions

 WINE_DEFAULT_DEBUG_CHANNEL (dbghelp)
 
static BOOL arm64_get_addr (HANDLE hThread, const CONTEXT *ctx, enum cpu_addr ca, ADDRESS64 *addr)
 
static BOOL arm64_stack_walk (struct cpu_stack_walk *csw, STACKFRAME64 *frame, union ctx *ctx)
 
static unsigned arm64_map_dwarf_register (unsigned regno, const struct module *module, BOOL eh_frame)
 
static voidarm64_fetch_context_reg (union ctx *pctx, unsigned regno, unsigned *size)
 
static const chararm64_fetch_regname (unsigned regno)
 
static BOOL arm64_fetch_minidump_thread (struct dump_context *dc, unsigned index, unsigned flags, const CONTEXT *ctx)
 
static BOOL arm64_fetch_minidump_module (struct dump_context *dc, unsigned index, unsigned flags)
 

Variables

DECLSPEC_HIDDEN struct cpu cpu_arm64
 

Macro Definition Documentation

◆ NONAMELESSSTRUCT

#define NONAMELESSSTRUCT

Definition at line 25 of file cpu_arm64.c.

◆ NONAMELESSUNION

#define NONAMELESSUNION

Definition at line 24 of file cpu_arm64.c.

◆ WIN32_NO_STATUS

#define WIN32_NO_STATUS

Definition at line 27 of file cpu_arm64.c.

Function Documentation

◆ arm64_fetch_context_reg()

static void * arm64_fetch_context_reg ( union ctx pctx,
unsigned  regno,
unsigned size 
)
static

Definition at line 170 of file cpu_arm64.c.

171{
172#ifdef __aarch64__
173 CONTEXT *ctx = pctx;
174
175 switch (regno)
176 {
177 case CV_ARM64_X0 + 0:
178 case CV_ARM64_X0 + 1:
179 case CV_ARM64_X0 + 2:
180 case CV_ARM64_X0 + 3:
181 case CV_ARM64_X0 + 4:
182 case CV_ARM64_X0 + 5:
183 case CV_ARM64_X0 + 6:
184 case CV_ARM64_X0 + 7:
185 case CV_ARM64_X0 + 8:
186 case CV_ARM64_X0 + 9:
187 case CV_ARM64_X0 + 10:
188 case CV_ARM64_X0 + 11:
189 case CV_ARM64_X0 + 12:
190 case CV_ARM64_X0 + 13:
191 case CV_ARM64_X0 + 14:
192 case CV_ARM64_X0 + 15:
193 case CV_ARM64_X0 + 16:
194 case CV_ARM64_X0 + 17:
195 case CV_ARM64_X0 + 18:
196 case CV_ARM64_X0 + 19:
197 case CV_ARM64_X0 + 20:
198 case CV_ARM64_X0 + 21:
199 case CV_ARM64_X0 + 22:
200 case CV_ARM64_X0 + 23:
201 case CV_ARM64_X0 + 24:
202 case CV_ARM64_X0 + 25:
203 case CV_ARM64_X0 + 26:
204 case CV_ARM64_X0 + 27:
205 case CV_ARM64_X0 + 28: *size = sizeof(ctx->u.X[0]); return &ctx->u.X[regno - CV_ARM64_X0];
206 case CV_ARM64_PSTATE: *size = sizeof(ctx->Cpsr); return &ctx->Cpsr;
207 case CV_ARM64_FP: *size = sizeof(ctx->u.s.Fp); return &ctx->u.s.Fp;
208 case CV_ARM64_LR: *size = sizeof(ctx->u.s.Lr); return &ctx->u.s.Lr;
209 case CV_ARM64_SP: *size = sizeof(ctx->Sp); return &ctx->Sp;
210 case CV_ARM64_PC: *size = sizeof(ctx->Pc); return &ctx->Pc;
211 }
212#endif
213 FIXME("Unknown register %x\n", regno);
214 return NULL;
215}
#define FIXME(fmt,...)
Definition: debug.h:111
@ CV_ARM64_LR
Definition: cvconst.h:472
@ CV_ARM64_FP
Definition: cvconst.h:471
#define NULL
Definition: types.h:112
@ CV_ARM64_SP
Definition: compat.h:2209
@ CV_ARM64_PSTATE
Definition: compat.h:2211
@ CV_ARM64_X0
Definition: compat.h:2208
@ CV_ARM64_PC
Definition: compat.h:2210
GLsizeiptr size
Definition: glext.h:5919

◆ arm64_fetch_minidump_module()

static BOOL arm64_fetch_minidump_module ( struct dump_context dc,
unsigned  index,
unsigned  flags 
)
static

Definition at line 275 of file cpu_arm64.c.

276{
277 /* FIXME: actually, we should probably take care of FPO data, unless it's stored in
278 * function table minidump stream
279 */
280 return FALSE;
281}
#define FALSE
Definition: types.h:117

◆ arm64_fetch_minidump_thread()

static BOOL arm64_fetch_minidump_thread ( struct dump_context dc,
unsigned  index,
unsigned  flags,
const CONTEXT ctx 
)
static

Definition at line 261 of file cpu_arm64.c.

262{
263 if (ctx->ContextFlags && (flags & ThreadWriteInstructionWindow))
264 {
265 /* FIXME: crop values across module boundaries, */
266#ifdef __aarch64__
267 ULONG base = ctx->Pc <= 0x80 ? 0 : ctx->Pc - 0x80;
268 minidump_add_memory_block(dc, base, ctx->Pc + 0x80 - base, 0);
269#endif
270 }
271
272 return TRUE;
273}
void minidump_add_memory_block(struct dump_context *dc, ULONG64 base, ULONG size, ULONG rva) DECLSPEC_HIDDEN
Definition: minidump.c:355
#define TRUE
Definition: types.h:120
@ ThreadWriteInstructionWindow
Definition: compat.h:1150
GLbitfield flags
Definition: glext.h:7161
unsigned int ULONG
Definition: retypes.h:1
static const WCHAR dc[]

◆ arm64_fetch_regname()

static const char * arm64_fetch_regname ( unsigned  regno)
static

Definition at line 217 of file cpu_arm64.c.

218{
219 switch (regno)
220 {
221 case CV_ARM64_PSTATE: return "cpsr";
222 case CV_ARM64_X0 + 0: return "x0";
223 case CV_ARM64_X0 + 1: return "x1";
224 case CV_ARM64_X0 + 2: return "x2";
225 case CV_ARM64_X0 + 3: return "x3";
226 case CV_ARM64_X0 + 4: return "x4";
227 case CV_ARM64_X0 + 5: return "x5";
228 case CV_ARM64_X0 + 6: return "x6";
229 case CV_ARM64_X0 + 7: return "x7";
230 case CV_ARM64_X0 + 8: return "x8";
231 case CV_ARM64_X0 + 9: return "x9";
232 case CV_ARM64_X0 + 10: return "x10";
233 case CV_ARM64_X0 + 11: return "x11";
234 case CV_ARM64_X0 + 12: return "x12";
235 case CV_ARM64_X0 + 13: return "x13";
236 case CV_ARM64_X0 + 14: return "x14";
237 case CV_ARM64_X0 + 15: return "x15";
238 case CV_ARM64_X0 + 16: return "x16";
239 case CV_ARM64_X0 + 17: return "x17";
240 case CV_ARM64_X0 + 18: return "x18";
241 case CV_ARM64_X0 + 19: return "x19";
242 case CV_ARM64_X0 + 20: return "x20";
243 case CV_ARM64_X0 + 21: return "x21";
244 case CV_ARM64_X0 + 22: return "x22";
245 case CV_ARM64_X0 + 23: return "x23";
246 case CV_ARM64_X0 + 24: return "x24";
247 case CV_ARM64_X0 + 25: return "x25";
248 case CV_ARM64_X0 + 26: return "x26";
249 case CV_ARM64_X0 + 27: return "x27";
250 case CV_ARM64_X0 + 28: return "x28";
251
252 case CV_ARM64_FP: return "fp";
253 case CV_ARM64_LR: return "lr";
254 case CV_ARM64_SP: return "sp";
255 case CV_ARM64_PC: return "pc";
256 }
257 FIXME("Unknown register %x\n", regno);
258 return NULL;
259}

◆ arm64_get_addr()

static BOOL arm64_get_addr ( HANDLE  hThread,
const CONTEXT ctx,
enum cpu_addr  ca,
ADDRESS64 addr 
)
static

Definition at line 34 of file cpu_arm64.c.

36{
37 addr->Mode = AddrModeFlat;
38 addr->Segment = 0; /* don't need segment */
39 switch (ca)
40 {
41#ifdef __aarch64__
42 case cpu_addr_pc: addr->Offset = ctx->Pc; return TRUE;
43 case cpu_addr_stack: addr->Offset = ctx->Sp; return TRUE;
44 case cpu_addr_frame: addr->Offset = ctx->u.s.Fp; return TRUE;
45#endif
46 default: addr->Mode = -1;
47 return FALSE;
48 }
49}
@ cpu_addr_frame
@ cpu_addr_pc
@ cpu_addr_stack
static const WCHAR ca[]
Definition: main.c:455
@ AddrModeFlat
Definition: compat.h:1159
GLenum const GLvoid * addr
Definition: glext.h:9621

◆ arm64_map_dwarf_register()

static unsigned arm64_map_dwarf_register ( unsigned  regno,
const struct module module,
BOOL  eh_frame 
)
static

Definition at line 158 of file cpu_arm64.c.

159{
160 if (regno <= 28) return CV_ARM64_X0 + regno;
161 if (regno == 29) return CV_ARM64_FP;
162 if (regno == 30) return CV_ARM64_LR;
163 if (regno == 31) return CV_ARM64_SP;
164 if (regno >= 64 && regno <= 95) return CV_ARM64_Q0 + regno - 64;
165
166 FIXME("Don't know how to map register %d\n", regno);
167 return CV_ARM64_NOREG;
168}
@ CV_ARM64_Q0
Definition: cvconst.h:478
@ CV_ARM64_NOREG
Definition: compat.h:2207

◆ arm64_stack_walk()

static BOOL arm64_stack_walk ( struct cpu_stack_walk csw,
STACKFRAME64 frame,
union ctx ctx 
)
static

Definition at line 151 of file cpu_arm64.c.

153{
154 return FALSE;
155}

◆ WINE_DEFAULT_DEBUG_CHANNEL()

WINE_DEFAULT_DEBUG_CHANNEL ( dbghelp  )

Variable Documentation

◆ cpu_arm64

Initial value:
= {
8,
}
static BOOL arm64_fetch_minidump_thread(struct dump_context *dc, unsigned index, unsigned flags, const CONTEXT *ctx)
Definition: cpu_arm64.c:261
static BOOL arm64_fetch_minidump_module(struct dump_context *dc, unsigned index, unsigned flags)
Definition: cpu_arm64.c:275
static BOOL arm64_stack_walk(struct cpu_stack_walk *csw, STACKFRAME64 *frame, union ctx *ctx)
Definition: cpu_arm64.c:151
static BOOL arm64_get_addr(HANDLE hThread, const CONTEXT *ctx, enum cpu_addr ca, ADDRESS64 *addr)
Definition: cpu_arm64.c:34
static unsigned arm64_map_dwarf_register(unsigned regno, const struct module *module, BOOL eh_frame)
Definition: cpu_arm64.c:158
static const char * arm64_fetch_regname(unsigned regno)
Definition: cpu_arm64.c:217
static void * arm64_fetch_context_reg(union ctx *pctx, unsigned regno, unsigned *size)
Definition: cpu_arm64.c:170
#define IMAGE_FILE_MACHINE_ARM64
Definition: compat.h:129

Definition at line 283 of file cpu_arm64.c.