Skip to content

Commit

Permalink
Add prefix to boost/context API names (#4470)
Browse files Browse the repository at this point in the history
And remove MS related files.
  • Loading branch information
twose authored Nov 5, 2021
1 parent 4d5604a commit 424cc99
Show file tree
Hide file tree
Showing 50 changed files with 233 additions and 1,497 deletions.
4 changes: 2 additions & 2 deletions include/swoole_asm_context.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@ SW_EXTERN_C_BEGIN

typedef void *fcontext_t;

intptr_t jump_fcontext(fcontext_t *ofc, fcontext_t nfc, intptr_t vp, bool preserve_fpu = false);
fcontext_t make_fcontext(void *sp, size_t size, void (*fn)(intptr_t));
intptr_t swoole_jump_fcontext(fcontext_t *ofc, fcontext_t nfc, intptr_t vp, bool preserve_fpu = false);
fcontext_t swoole_make_fcontext(void *sp, size_t size, void (*fn)(intptr_t));

SW_EXTERN_C_END

Expand Down
6 changes: 3 additions & 3 deletions src/coroutine/context.cc
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ Context::Context(size_t stack_size, const CoroutineFunc &fn, void *private_data)
ctx_.uc_link = nullptr;
makecontext(&ctx_, (void (*)(void)) & context_func, 1, this);
#else
ctx_ = make_fcontext(sp, stack_size_, (void (*)(intptr_t)) & context_func);
ctx_ = swoole_make_fcontext(sp, stack_size_, (void (*)(intptr_t)) & context_func);
swap_ctx_ = nullptr;
#endif

Expand Down Expand Up @@ -123,7 +123,7 @@ bool Context::swap_in() {
#if USE_UCONTEXT
return 0 == swapcontext(&swap_ctx_, &ctx_);
#else
jump_fcontext(&swap_ctx_, ctx_, (intptr_t) this, true);
swoole_jump_fcontext(&swap_ctx_, ctx_, (intptr_t) this, true);
return true;
#endif
}
Expand All @@ -132,7 +132,7 @@ bool Context::swap_out() {
#if USE_UCONTEXT
return 0 == swapcontext(&ctx_, &swap_ctx_);
#else
jump_fcontext(&ctx_, swap_ctx_, (intptr_t) this, true);
swoole_jump_fcontext(&ctx_, swap_ctx_, (intptr_t) this, true);
return true;
#endif
}
Expand Down
8 changes: 4 additions & 4 deletions thirdparty/boost/asm/jump_arm64_aapcs_elf_gas.S
Original file line number Diff line number Diff line change
Expand Up @@ -54,9 +54,9 @@
.cpu generic+fp+simd
.text
.align 2
.global jump_fcontext
.type jump_fcontext, %function
jump_fcontext:
.global swoole_jump_fcontext
.type swoole_jump_fcontext, %function
swoole_jump_fcontext:
# prepare stack for GP + FPU
sub sp, sp, #0xb0

Expand Down Expand Up @@ -126,7 +126,7 @@ jump_fcontext:
add sp, sp, #0xb0

ret x4
.size jump_fcontext,.-jump_fcontext
.size swoole_jump_fcontext,.-swoole_jump_fcontext
#ifndef __NetBSD__
# Mark that we don't need executable stack.
.section .note.GNU-stack,"",%progbits
Expand Down
4 changes: 2 additions & 2 deletions thirdparty/boost/asm/jump_arm64_aapcs_macho_gas.S
Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,9 @@
*******************************************************/

.text
.globl _jump_fcontext
.globl _swoole_jump_fcontext
.balign 16
_jump_fcontext:
_swoole_jump_fcontext:
; prepare stack for GP + FPU
sub sp, sp, #0xb0

Expand Down
10 changes: 5 additions & 5 deletions thirdparty/boost/asm/jump_arm_aapcs_elf_gas.S
Original file line number Diff line number Diff line change
Expand Up @@ -39,10 +39,10 @@
*******************************************************/

.text
.globl jump_fcontext
.globl swoole_jump_fcontext
.align 2
.type jump_fcontext,%function
jump_fcontext:
.type swoole_jump_fcontext,%function
swoole_jump_fcontext:
@ save LR as PC
push {lr}
@ save V1-V8,LR
Expand Down Expand Up @@ -84,10 +84,10 @@ jump_fcontext:
@ use third arg as return value after jump
@ and as first arg in context function
mov a1, a3

@ restore v1-V8,LR,PC
pop {v1-v8,lr,pc}
.size jump_fcontext,.-jump_fcontext
.size swoole_jump_fcontext,.-swoole_jump_fcontext

#ifndef __NetBSD__
@ Mark that we don't need executable stack.
Expand Down
6 changes: 3 additions & 3 deletions thirdparty/boost/asm/jump_arm_aapcs_macho_gas.S
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,9 @@
* *****************************************************/

.text
.globl _jump_fcontext
.globl _swoole_jump_fcontext
.align 2
_jump_fcontext:
_swoole_jump_fcontext:
@ save LR as PC
push {lr}
@ save V1-V8,LR
Expand Down Expand Up @@ -98,6 +98,6 @@ _jump_fcontext:
@ use third arg as return value after jump
@ and as first arg in context function
mov a1, a3

@ restore v1-V8,LR,PC
pop {v1-v8,lr,pc}
4 changes: 2 additions & 2 deletions thirdparty/boost/asm/jump_arm_aapcs_pe_armasm.asm
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,9 @@

AREA |.text|, CODE
ALIGN 4
EXPORT jump_fcontext
EXPORT swoole_jump_fcontext

jump_fcontext PROC
swoole_jump_fcontext PROC
@ save LR as PC
push {lr}
@ save V1-V8,LR
Expand Down
140 changes: 0 additions & 140 deletions thirdparty/boost/asm/jump_i386_ms_pe_gas.asm

This file was deleted.

Loading

0 comments on commit 424cc99

Please sign in to comment.