Skip to content

Commit 248db4e

Browse files
ILyoanbrson
authored andcommitted
---
yaml --- r: 54651 b: refs/heads/snap-stage3 c: 03116f2 h: refs/heads/master i: 54649: f543a62 54647: d5d6ca5 v: v3
1 parent 9c4d8bb commit 248db4e

File tree

2 files changed

+20
-15
lines changed

2 files changed

+20
-15
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
refs/heads/master: 5f13e9ccc2e3328d4cd8ca49f84e6840dd998346
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
4-
refs/heads/snap-stage3: a34948a2c5d7cd296abda6970652a9513d67feb7
4+
refs/heads/snap-stage3: 03116f251d2d53842971b356fb320f6101d1a3e5
55
refs/heads/try: 8eb2bab100b42f0ba751552d8eff00eb2134c55a
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b

branches/snap-stage3/src/rt/arch/arm/morestack.S

Lines changed: 19 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -15,14 +15,19 @@
1515

1616
// r4 and r5 are scratch registers for __morestack due to llvm
1717
// ARMFrameLowering::adjustForSegmentedStacks() implementation.
18-
.align 2
19-
.type __morestack,%function
18+
.type __morestack,%function
2019
__morestack:
20+
.fnstart
21+
// Save frame pointer and return address
22+
.save {r4, r5}
23+
.save {lr}
24+
.save {r6, fp, lr}
25+
push {r6, fp, lr}
2126

22-
// Save frame pointer and return address
23-
push {fp, lr}
24-
25-
mov fp, sp
27+
.movsp r6
28+
mov r6, sp
29+
.setfp fp, sp, #4
30+
add fp, sp, #4
2631

2732
// Save argument registers of the original function
2833
push {r0, r1, r2, r3, lr}
@@ -47,20 +52,20 @@ __morestack:
4752
mov pc, r4 // Call the original function
4853

4954
// Switch back to rust stack
50-
mov sp, fp
55+
mov sp, r6
5156

5257
// Save return value
53-
push {r0, r1}
58+
mov r4, r0
59+
mov r5, r1
5460

5561
// Remove the new allocated stack
5662
bl upcall_del_stack@plt
5763

5864
// Restore return value
59-
pop {r0, r1}
60-
65+
mov r0, r4
66+
mov r1, r5
67+
6168
// Return
62-
pop {fp, lr}
69+
pop {r6, fp, lr}
6370
mov pc, lr
64-
.endofmorestack:
65-
.size __morestack, .endofmorestack-__morestack
66-
71+
.fnend

0 commit comments

Comments
 (0)