-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcommon.s
50 lines (32 loc) · 1.04 KB
/
common.s
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
# REVIEW: should be in the standard includes
.macro STUB_START module,d1,d2
.section .rodata.stubmodulename,"a"
.word 0
__stub_modulestr_\module:
.asciz "\module"
.align 2
.section .lib.stub,"wa",@progbits
.word __stub_modulestr_\module
.word \d1
.word \d2
.word __stub_idtable_\module
.word __stub_text_\module
.section .rodata.stubidtable,"a"
__stub_idtable_\module:
.section .text.stub,"a",@progbits
__stub_text_\module:
.endm
.macro STUB_END
.endm
.macro STUB_FUNC funcid,funcname
.set push
.set noreorder
.section .text.stub
.weak \funcname
\funcname:
jr $ra
nop
.section .rodata.stubidtable
.word \funcid
.set pop
.endm