Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .github/workflows/auto-pr-precise.yml
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ jobs:
git checkout -b ${{steps.create_branch.outputs.PRBRANCH}}
echo "TITLE<<__AUTOPR_EOF" >> $GITHUB_OUTPUT
git log --format="| %s" ${{ github.event.commits[0].id }}~..${{ github.event.after }} | tr '\n' ' ' >> $GITHUB_OUTPUT
echo "" >> $GITHUB_OUTPUT
echo "__AUTOPR_EOF" >> $GITHUB_OUTPUT
echo "MESSAGE<<__AUTOPR_EOF" >> $GITHUB_OUTPUT
git log --format="> %B" ${{ github.event.commits[0].id }}~..${{ github.event.after }} >> $GITHUB_OUTPUT
Expand Down
40 changes: 28 additions & 12 deletions thread/thread.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -753,12 +753,20 @@ R"(

DEF_ASM_FUNC(_photon_thread_stub)
R"(
call _asan_start
mov 0x40(%rbp), %rdi
movq $0, 0x40(%rbp)
call *0x48(%rbp)
mov %rax, 0x48(%rbp)
mov %rbp, %rdi
mov %rbp, %rbx
xor %rbp, %rbp
)"
#ifdef __SANITIZE_ADDRESS__
R"(
call _asan_start
)"
#endif
R"(
mov 0x40(%rbx), %rdi
movq %rbp, 0x40(%rbx)
call *0x48(%rbx)
mov %rax, 0x48(%rbx)
mov %rbx, %rdi
call _photon_thread_die
)"
);
Expand Down Expand Up @@ -818,7 +826,6 @@ R"(

DEF_ASM_FUNC(_photon_thread_stub)
R"(
call _asan_start
mov 0x40(%rbp), %rcx
movq $0, 0x40(%rbp)
call *0x48(%rbp)
Expand Down Expand Up @@ -893,13 +900,21 @@ R"(
)"

DEF_ASM_FUNC(_photon_thread_stub)
R"(
mov x28, x29
mov x29, xzr
)"
#ifdef __ADDRESS_SANITIZER__
R"(
bl _asan_start //; asan_start()
ldp x0, x1, [x29, #0x40] //; load arg, start into x0, x1
str xzr, [x29, #0x40] //; set arg as 0
)"
#endif
R"(
ldp x0, x1, [x28, #0x40] //; load arg, start into x0, x1
str xzr, [x28, #0x40] //; set arg as 0
blr x1 //; start(x0)
str x0, [x29, #0x48] //; retval = result
mov x0, x29 //; move th to x0
str x0, [x28, #0x48] //; retval = result
mov x0, x28 //; move th to x0
b _photon_thread_die //; _photon_thread_die(th)
)"
);
Expand Down Expand Up @@ -1284,7 +1299,8 @@ R"(
return rq.current->error_number;
}

inline void thread_yield_fast() {
__attribute__((noinline))
void thread_yield_fast() {
auto sw = AtomicRunQ().goto_next();
switch_context(sw.from, sw.to);
}
Expand Down