1
2
3 .text
4
5 #define DEF(n,a) \
6 .globl n; n = a
7
8 #ifndef THUMB_FW
9
10 #if defined(OPT_FIRMWARE_PC24_CALL)
11
12 #define NHSTUB(name, addr)\
13 .globl _##name ;\
14 .weak _##name ;\
15 _##name = ## addr
16
17 #define STUB(addr)\
18 .globl sub_ ## addr ;\
19 sub_ ## addr = 0x ## addr
20
21 #else
22
23 #define NHSTUB(name, addr)\
24 .globl _##name ;\
25 .weak _##name ;\
26 _##name: ;\
27 ldr pc, = ## addr
28
29 #define STUB(addr)\
30 .globl sub_ ## addr ;\
31 sub_ ## addr: ;\
32 ldr pc, =0x ## addr
33
34 #endif
35
36 #else
37
38
39
40 .syntax unified
41
42 #define NHSTUB(name, addr)\
43 .globl _##name ;\
44 .weak _##name ;\
45 _##name: ;\
46 .code 16 ;\
47 ldr.w pc, [pc, #0] ;\
48 .long addr
49
50
51 #define NHSTUB2(name, addr)\
52 .globl _##name ;\
53 .weak _##name ;\
54 _##name: ;\
55 .code 32 ;\
56 ldr pc, [pc, #-4] ;\
57 .code 16 ;\
58 .long addr
59
60 #define STUB(addr)\
61 .globl sub_ ## addr ;\
62 sub_ ## addr: ;\
63 .code 16 ;\
64 ldr.w pc, [pc, #0] ;\
65 .long 0x ## addr | 1
66
67
68 #define STUB2(addr)\
69 .globl sub_ ## addr ;\
70 sub_ ## addr: ;\
71 .code 32 ;\
72 ldr pc, [pc, #-4] ;\
73 .code 16 ;\
74 .long 0x ## addr
75
76 #endif
77
78
79 #define FAKEDEF(n, m) \
80 .globl n; n: ;\
81 .rept m ; \
82 .long 0 ; \
83 .endr
84
85
86
87
88 #define IGNORE(name)
89
90
91 #define DEF_CONST(n, m) \
92 .globl n; n: ;\
93 .long m