Skip to content

Commit 9ca91a0

Browse files
author
Kai Luo
committed
Port to 64-bit AIX
1 parent 5df2309 commit 9ca91a0

File tree

2 files changed

+125
-0
lines changed

2 files changed

+125
-0
lines changed

psm/build.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ fn find_assembly(
4141
("powerpc", _, _, _) => Some(("src/arch/powerpc32.s", true)),
4242
("powerpc64", _, _, "musl") => Some(("src/arch/powerpc64_openpower.s", true)),
4343
("powerpc64", "little", _, _) => Some(("src/arch/powerpc64_openpower.s", true)),
44+
("powerpc64", _, "aix", _) => Some(("src/arch/powerpc64_aix.s", true)),
4445
("powerpc64", _, _, _) => Some(("src/arch/powerpc64.s", true)),
4546
("s390x", _, _, _) => Some(("src/arch/zseries_linux.s", true)),
4647
("mips", _, _, _) => Some(("src/arch/mips_eabi.s", true)),

psm/src/arch/powerpc64_aix.s

Lines changed: 124 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,124 @@
1+
.csect .text[PR],2
2+
.file "powerpc64.s"
3+
.globl rust_psm_stack_direction[DS]
4+
.globl .rust_psm_stack_direction
5+
.align 4
6+
.csect rust_psm_stack_direction[DS],3
7+
.vbyte 8, .rust_psm_stack_direction
8+
.vbyte 8, TOC[TC0]
9+
.vbyte 8, 0
10+
.csect .text[PR],2
11+
.rust_psm_stack_direction:
12+
li 3, 2
13+
blr
14+
L..rust_psm_stack_direction_end:
15+
.vbyte 4, 0x00000000
16+
.byte 0x00
17+
.byte 0x09
18+
.byte 0x20
19+
.byte 0x40
20+
.byte 0x80
21+
.byte 0x00
22+
.byte 0x00
23+
.byte 0x01
24+
.vbyte 4, L..rust_psm_stack_direction_end-.rust_psm_stack_direction
25+
.vbyte 2, 0x0018
26+
.byte "rust_psm_stack_direction"
27+
28+
.globl rust_psm_stack_pointer[DS]
29+
.globl .rust_psm_stack_pointer
30+
.align 4
31+
.csect rust_psm_stack_pointer[DS],3
32+
.vbyte 8, .rust_psm_stack_pointer
33+
.vbyte 8, TOC[TC0]
34+
.vbyte 8, 0
35+
.csect .text[PR],2
36+
.rust_psm_stack_pointer:
37+
mr 3, 1
38+
blr
39+
L..rust_psm_stack_pointer_end:
40+
.vbyte 4, 0x00000000
41+
.byte 0x00
42+
.byte 0x09
43+
.byte 0x20
44+
.byte 0x40
45+
.byte 0x80
46+
.byte 0x00
47+
.byte 0x00
48+
.byte 0x01
49+
.vbyte 4, L..rust_psm_stack_pointer_end-.rust_psm_stack_pointer
50+
.vbyte 2, 0x0016
51+
.byte "rust_psm_stack_pointer"
52+
53+
54+
.globl rust_psm_replace_stack[DS]
55+
.globl .rust_psm_replace_stack
56+
.align 4
57+
.csect rust_psm_replace_stack[DS],3
58+
.vbyte 8, .rust_psm_replace_stack
59+
.vbyte 8, TOC[TC0]
60+
.vbyte 8, 0
61+
.csect .text[PR],2
62+
.rust_psm_replace_stack:
63+
ld 2, 8(4)
64+
ld 4, 0(4)
65+
addi 5, 5, -48
66+
mr 1, 5
67+
mtctr 4
68+
bctr
69+
L..rust_psm_replace_stack_end:
70+
.vbyte 4, 0x00000000
71+
.byte 0x00
72+
.byte 0x09
73+
.byte 0x20
74+
.byte 0x40
75+
.byte 0x80
76+
.byte 0x00
77+
.byte 0x02
78+
.byte 0x01
79+
.vbyte 4, 0x00000000
80+
.vbyte 4, L..rust_psm_replace_stack_end-.rust_psm_replace_stack
81+
.vbyte 2, 0x0016
82+
.byte "rust_psm_replace_stack"
83+
84+
85+
.globl rust_psm_on_stack[DS]
86+
.globl .rust_psm_on_stack
87+
.align 4
88+
.csect rust_psm_on_stack[DS],3
89+
.vbyte 8, .rust_psm_on_stack
90+
.vbyte 8, TOC[TC0]
91+
.vbyte 8, 0
92+
.csect .text[PR],2
93+
.rust_psm_on_stack:
94+
mflr 0
95+
std 2, -72(6)
96+
std 0, -8(6)
97+
sub 6, 6, 1
98+
addi 6, 6, -112
99+
stdux 1, 1, 6
100+
ld 2, 8(5)
101+
ld 5, 0(5)
102+
mtctr 5
103+
bctrl
104+
ld 2, 40(1)
105+
ld 0, 104(1)
106+
mtlr 0
107+
ld 1, 0(1)
108+
blr
109+
L..rust_psm_on_stack_end:
110+
.vbyte 4, 0x00000000
111+
.byte 0x00
112+
.byte 0x09
113+
.byte 0x20
114+
.byte 0x40
115+
.byte 0x80
116+
.byte 0x00
117+
.byte 0x00
118+
.byte 0x01
119+
.vbyte 4, L..rust_psm_on_stack_end-.rust_psm_on_stack
120+
.vbyte 2, 0x0011
121+
.byte "rust_psm_on_stack"
122+
123+
.toc
124+

0 commit comments

Comments
 (0)