ReactOS  0.4.13-dev-985-gcbf4784
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, LPSTACKFRAME64 frame, CONTEXT *context)
 
static unsigned arm64_map_dwarf_register (unsigned regno, BOOL eh_frame)
 
static voidarm64_fetch_context_reg (CONTEXT *ctx, 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 ( CONTEXT ctx,
unsigned  regno,
unsigned *  size 
)
static

Definition at line 166 of file cpu_arm64.c.

167 {
168 #ifdef __aarch64__
169  switch (regno)
170  {
171  case CV_ARM64_X0 + 0:
172  case CV_ARM64_X0 + 1:
173  case CV_ARM64_X0 + 2:
174  case CV_ARM64_X0 + 3:
175  case CV_ARM64_X0 + 4:
176  case CV_ARM64_X0 + 5:
177  case CV_ARM64_X0 + 6:
178  case CV_ARM64_X0 + 7:
179  case CV_ARM64_X0 + 8:
180  case CV_ARM64_X0 + 9:
181  case CV_ARM64_X0 + 10:
182  case CV_ARM64_X0 + 11:
183  case CV_ARM64_X0 + 12:
184  case CV_ARM64_X0 + 13:
185  case CV_ARM64_X0 + 14:
186  case CV_ARM64_X0 + 15:
187  case CV_ARM64_X0 + 16:
188  case CV_ARM64_X0 + 17:
189  case CV_ARM64_X0 + 18:
190  case CV_ARM64_X0 + 19:
191  case CV_ARM64_X0 + 20:
192  case CV_ARM64_X0 + 21:
193  case CV_ARM64_X0 + 22:
194  case CV_ARM64_X0 + 23:
195  case CV_ARM64_X0 + 24:
196  case CV_ARM64_X0 + 25:
197  case CV_ARM64_X0 + 26:
198  case CV_ARM64_X0 + 27:
199  case CV_ARM64_X0 + 28: *size = sizeof(ctx->u.X[0]); return &ctx->u.X[regno - CV_ARM64_X0];
200  case CV_ARM64_PSTATE: *size = sizeof(ctx->Cpsr); return &ctx->Cpsr;
201  case CV_ARM64_FP: *size = sizeof(ctx->u.s.Fp); return &ctx->u.s.Fp;
202  case CV_ARM64_LR: *size = sizeof(ctx->u.s.Lr); return &ctx->u.s.Lr;
203  case CV_ARM64_SP: *size = sizeof(ctx->Sp); return &ctx->Sp;
204  case CV_ARM64_PC: *size = sizeof(ctx->Pc); return &ctx->Pc;
205  }
206 #endif
207  FIXME("Unknown register %x\n", regno);
208  return NULL;
209 }
#define FIXME(fmt,...)
Definition: debug.h:110
smooth NULL
Definition: ftsmooth.c:416
GLsizeiptr size
Definition: glext.h:5919
ULONG Cpsr
Definition: compat.h:353
ULONG Fp
Definition: compat.h:346
ULONG Sp
Definition: compat.h:350
ULONG Pc
Definition: compat.h:352
ULONG Lr
Definition: compat.h:351

◆ arm64_fetch_minidump_module()

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

Definition at line 269 of file cpu_arm64.c.

270 {
271  /* FIXME: actually, we should probably take care of FPO data, unless it's stored in
272  * function table minidump stream
273  */
274  return FALSE;
275 }

◆ 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 255 of file cpu_arm64.c.

256 {
258  {
259  /* FIXME: crop values across module boundaries, */
260 #ifdef __aarch64__
261  ULONG base = ctx->Pc <= 0x80 ? 0 : ctx->Pc - 0x80;
262  minidump_add_memory_block(dc, base, ctx->Pc + 0x80 - base, 0);
263 #endif
264  }
265 
266  return TRUE;
267 }
#define TRUE
Definition: types.h:120
HDC dc
Definition: cylfrac.c:34
void minidump_add_memory_block(struct dump_context *dc, ULONG64 base, ULONG size, ULONG rva) DECLSPEC_HIDDEN
Definition: minidump.c:338
ULONG ContextFlags
Definition: compat.h:331
GLbitfield flags
Definition: glext.h:7161
unsigned int ULONG
Definition: retypes.h:1
ULONG Pc
Definition: compat.h:352

◆ arm64_fetch_regname()

static const char* arm64_fetch_regname ( unsigned  regno)
static

Definition at line 211 of file cpu_arm64.c.

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

◆ 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 }
#define TRUE
Definition: types.h:120
GLenum const GLvoid * addr
Definition: glext.h:9621
ULONG Fp
Definition: compat.h:346
ULONG Sp
Definition: compat.h:350
static const WCHAR ca[]
Definition: main.c:457
ULONG Pc
Definition: compat.h:352

◆ arm64_map_dwarf_register()

static unsigned arm64_map_dwarf_register ( unsigned  regno,
BOOL  eh_frame 
)
static

Definition at line 155 of file cpu_arm64.c.

156 {
157  if (regno <= 28) return CV_ARM64_X0 + regno;
158  if (regno == 29) return CV_ARM64_FP;
159  if (regno == 30) return CV_ARM64_LR;
160  if (regno == 31) return CV_ARM64_SP;
161 
162  FIXME("Don't know how to map register %d\n", regno);
163  return CV_ARM64_NOREG;
164 }
#define FIXME(fmt,...)
Definition: debug.h:110

◆ arm64_stack_walk()

static BOOL arm64_stack_walk ( struct cpu_stack_walk csw,
LPSTACKFRAME64  frame,
CONTEXT context 
)
static

Definition at line 149 of file cpu_arm64.c.

150 {
151  return FALSE;
152 }

◆ WINE_DEFAULT_DEBUG_CHANNEL()

WINE_DEFAULT_DEBUG_CHANNEL ( dbghelp  )

Variable Documentation

◆ cpu_arm64

Initial value:
= {
8,
}
#define IMAGE_FILE_MACHINE_ARM64
Definition: compat.h:118
static BOOL arm64_fetch_minidump_module(struct dump_context *dc, unsigned index, unsigned flags)
Definition: cpu_arm64.c:269
static BOOL arm64_get_addr(HANDLE hThread, const CONTEXT *ctx, enum cpu_addr ca, ADDRESS64 *addr)
Definition: cpu_arm64.c:34
static BOOL arm64_stack_walk(struct cpu_stack_walk *csw, LPSTACKFRAME64 frame, CONTEXT *context)
Definition: cpu_arm64.c:149
smooth NULL
Definition: ftsmooth.c:416
static unsigned arm64_map_dwarf_register(unsigned regno, BOOL eh_frame)
Definition: cpu_arm64.c:155
static BOOL arm64_fetch_minidump_thread(struct dump_context *dc, unsigned index, unsigned flags, const CONTEXT *ctx)
Definition: cpu_arm64.c:255
static const char * arm64_fetch_regname(unsigned regno)
Definition: cpu_arm64.c:211
static void * arm64_fetch_context_reg(CONTEXT *ctx, unsigned regno, unsigned *size)
Definition: cpu_arm64.c:166

Definition at line 277 of file cpu_arm64.c.