8000 synchronizing file existence in branches 24, 25, 26, trunk. · stackless-dev/stackless_historic@d49a34d · GitHub
[go: up one dir, main page]

Skip to content

Commit d49a34d

Browse files
author
christian.tismer
committed
synchronizing file existence in branches 24, 25, 26, trunk.
Deferring content sync to tomorrow. git-svn-id: http://svn.python.org/projects/stackless/trunk@80285 6015fed2-1504-0410-9fe1-9d1591cc4771
1 parent b1b207c commit d49a34d

File tree

1 file changed

+56
-0
lines changed

1 file changed

+56
-0
lines changed
Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
# NOTE: This is not yet safe to use. Checked in for the same of reference.
2+
#
3+
# (int) slp_switch (void);
4+
5+
.text
6+
.type slp_switch, @function
7+
# This next line is required to the C code can find and
8+
# link against this function.
9+
.global slp_switch
10+
slp_switch:
11+
pushq %rbp
12+
pushq %r15
13+
pushq %r14
14+
pushq %r13
15+
pushq %r12
16+
pushq %rbx
17+
18+
# Disabled for now, which should ideally give us identical
19+
# behaviour to the inline C version. Can add this when we
20+
# are ready for it.
21+
#subq $8, %rsp
22+
#stmxcsr (%rsp)
23+
24+
movq %rsp, %rdi
25+
26+
call slp_save_state # diff = slp_save_state([?]stackref)
27+
28+
cmp $-1, %rax # if (diff == -1)
29+
je .exit # return -1;
30+
31+
cmp $1, %rax # if (diff == 1)
32+
je .no_restore # return 0;
33+
34+
.restore:
35+
add %rax, %rsp # Adjust the stack pointer for the state we are restoring.
36+
37+
call slp_restore_state # slp_restore_state()
38+
39+
.no_restore:
40+
xor %rax, %rax # Switch successful (whether we restored or not).
41+
42+
.exit:
43+
#ldmxcsr (%rsp)
44+
#addq $8, %rsp
45+
46+
popq %rbx
47+
popq %r12
48+
popq %r13
49+
popq %r14
50+
popq %r15
51+
# rbp gets popped by the leave statement
52+
53+
leave
54+
ret
55+
.LFE11:
56+
.size slp_switch, .-slp_switch

0 commit comments

Comments
 (0)
0