changelog shortlog tags branches changeset files revisions annotate raw help

Mercurial > hg > plan9front / sys/src/libmach/7.c

changeset 7186: 4dd5e2428c1d
author: cinap_lenrek@felloff.net
date: Fri, 03 May 2019 21:00:17 +0200
permissions: -rw-r--r--
description: libmach: initial arm64 support
1 /*
2  * arm definition
3  */
4 #include <u.h>
5 #include <libc.h>
6 #include <bio.h>
7 #include <mach.h>
8 
9 #include "/arm64/include/ureg.h"
10 
11 #define REGOFF(x) (uintptr)(&((struct Ureg *) 0)->x)
12 
13 #define SP REGOFF(sp)
14 #define PC REGOFF(pc)
15 
16 #define REGSIZE sizeof(struct Ureg)
17 
18 Reglist arm64reglist[] =
19 {
20  {"TYPE", REGOFF(type), RINT|RRDONLY, 'Y'},
21  {"PSR", REGOFF(psr), RINT|RRDONLY, 'Y'},
22  {"PC", PC, RINT, 'Y'},
23  {"SP", SP, RINT, 'Y'},
24  {"R30", REGOFF(r30), RINT, 'Y'},
25  {"R29", REGOFF(r29), RINT, 'Y'},
26  {"R28", REGOFF(r28), RINT, 'Y'},
27  {"R27", REGOFF(r27), RINT, 'Y'},
28  {"R26", REGOFF(r26), RINT, 'Y'},
29  {"R25", REGOFF(r25), RINT, 'Y'},
30  {"R24", REGOFF(r24), RINT, 'Y'},
31  {"R23", REGOFF(r23), RINT, 'Y'},
32  {"R22", REGOFF(r22), RINT, 'Y'},
33  {"R21", REGOFF(r21), RINT, 'Y'},
34  {"R20", REGOFF(r20), RINT, 'Y'},
35  {"R19", REGOFF(r19), RINT, 'Y'},
36  {"R18", REGOFF(r18), RINT, 'Y'},
37  {"R17", REGOFF(r17), RINT, 'Y'},
38  {"R16", REGOFF(r16), RINT, 'Y'},
39  {"R15", REGOFF(r15), RINT, 'Y'},
40  {"R14", REGOFF(r14), RINT, 'Y'},
41  {"R13", REGOFF(r13), RINT, 'Y'},
42  {"R12", REGOFF(r12), RINT, 'Y'},
43  {"R11", REGOFF(r11), RINT, 'Y'},
44  {"R10", REGOFF(r10), RINT, 'Y'},
45  {"R9", REGOFF(r9), RINT, 'Y'},
46  {"R8", REGOFF(r8), RINT, 'Y'},
47  {"R7", REGOFF(r7), RINT, 'Y'},
48  {"R6", REGOFF(r6), RINT, 'Y'},
49  {"R5", REGOFF(r5), RINT, 'Y'},
50  {"R4", REGOFF(r4), RINT, 'Y'},
51  {"R3", REGOFF(r3), RINT, 'Y'},
52  {"R2", REGOFF(r2), RINT, 'Y'},
53  {"R1", REGOFF(r1), RINT, 'Y'},
54  {"R0", REGOFF(r0), RINT, 'Y'},
55  { 0 }
56 };
57 
58  /* the machine description */
59 Mach marm64 =
60 {
61  "arm64",
62  MARM64, /* machine type */
63  arm64reglist, /* register set */
64  REGSIZE, /* register set size */
65  0, /* fp register set size */
66  "PC", /* name of PC */
67  "SP", /* name of SP */
68  "R30", /* name of link register */
69  "setSB", /* static base register name */
70  0, /* static base register value */
71  0x10000, /* page size (for segment alignment) */
72  0xFFFFFFFF80000000ULL, /* kernel base */
73  0xFFFF800000000000ULL, /* kernel text mask */
74  0x00007FFFFFFF0000ULL, /* user stack top */
75  4, /* quantization of pc */
76  8, /* szaddr */
77  8, /* szreg */
78  4, /* szfloat */
79  8, /* szdouble */
80 };