comparison dyncallback/dyncall_thunk_arm64.c @ 552:61c485f8cc06

cosmetics & c-comments for consistency
author Tassilo Philipp
date Mon, 20 Jun 2022 15:11:52 +0200
parents f5577f6bf97a
children
comparison
equal deleted inserted replaced
551:eef302b7a58d 552:61c485f8cc06
30 /* 30 /*
31 31
32 Thunk Register: x9 32 Thunk Register: x9
33 33
34 Thunk: 34 Thunk:
35 adr x9, Thunk 35 adr x9, Thunk
36 ldr x10, .target 36 ldr x10, .target
37 br x10 37 br x10
38 nop 38 nop
39 .target: 39 .target:
40 .xword 0 40 .xword 0
41 41
42 -- Encoded in: 42 -- Encoded in:
43 43
44 0000000000000000 <Thunk>: 44 0000000000000000 <Thunk>:
45 0: 10000009 adr x9, 0 <Thunk> 45 0: 10000009 adr x9, 0 <Thunk>
46 4: 5800006a ldr x10, 10 <.target> 46 4: 5800006a ldr x10, 10 <.target>
47 8: d61f0140 br x10 47 8: d61f0140 br x10
48 c: d503201f nop 48 c: d503201f nop
49 49
50 0000000000000010 <.target>: 50 0000000000000010 <.target>:
51 10: 76543210 .word 0x76543210 51 10: 76543210 .word 0x76543210
52 14: fedcba98 .word 0xfedcba98 52 14: fedcba98 .word 0xfedcba98
53 */ 53 */
54 54
55 void dcbInitThunk(DCThunk* p, void (*entry)()) 55 void dcbInitThunk(DCThunk* p, void (*entry)())
56 { 56 {
57 p->code[0] = 0x10000009; // adr x9, 0 57 p->code[0] = 0x10000009; /* adr x9, 0 */
58 p->code[1] = 0x5800006a; // ldr x9, entry 58 p->code[1] = 0x5800006a; /* ldr x9, entry */
59 p->code[2] = 0xd61f0140; // br x9 59 p->code[2] = 0xd61f0140; /* br x9 */
60 p->code[3] = 0xd503201f; // nop 60 p->code[3] = 0xd503201f; /* nop */
61 p->entry = entry; // entry: 61 p->entry = entry; /* entry: */
62 // .xword 0 62 /* .xword 0 */
63 } 63 }
64 64