Skip to content

Commit

Permalink
Merge pull request #294 from JanuarYJL/merge_to_master
Browse files Browse the repository at this point in the history
修改xxx_fcontext名称
  • Loading branch information
ruanshudong authored Feb 2, 2024
2 parents 9645023 + 0cfb163 commit 7d892f2
Show file tree
Hide file tree
Showing 62 changed files with 324 additions and 324 deletions.
4 changes: 2 additions & 2 deletions util/include/util/tc_fcontext.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ struct transfer_t {
void * data;
};

extern "C" transfer_t jump_fcontext( fcontext_t const to, void * vp);
extern "C" fcontext_t make_fcontext( void * sp, std::size_t size, void (* fn)( transfer_t) );
extern "C" transfer_t tars_jump_fcontext( fcontext_t const to, void * vp);
extern "C" fcontext_t tars_make_fcontext( void * sp, std::size_t size, void (* fn)( transfer_t) );

}

Expand Down
8 changes: 4 additions & 4 deletions util/src/asm/jump_arm64_aapcs_elf_gas.S
Original file line number Diff line number Diff line change
Expand Up @@ -54,9 +54,9 @@
.file "jump_arm64_aapcs_elf_gas.S"
.text
.align 2
.global jump_fcontext
.type jump_fcontext, %function
jump_fcontext:
.global tars_jump_fcontext
.type tars_jump_fcontext, %function
tars_jump_fcontext:
# prepare stack for GP + FPU
sub sp, sp, #0xb0

Expand Down Expand Up @@ -109,6 +109,6 @@ jump_fcontext:
add sp, sp, #0xb0

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

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

Expand Down
8 changes: 4 additions & 4 deletions util/src/asm/jump_arm_aapcs_elf_gas.S
Original file line number Diff line number Diff line change
Expand Up @@ -40,11 +40,11 @@

.file "jump_arm_aapcs_elf_gas.S"
.text
.globl jump_fcontext
.globl tars_jump_fcontext
.align 2
.type jump_fcontext,%function
.type tars_jump_fcontext,%function
.syntax unified
jump_fcontext:
tars_jump_fcontext:
@ save LR as PC
push {lr}
@ save hidden,V1-V8,LR
Expand Down Expand Up @@ -82,7 +82,7 @@ jump_fcontext:

@ restore PC
pop {pc}
.size jump_fcontext,.-jump_fcontext
.size tars_jump_fcontext,.-tars_jump_fcontext

@ Mark that we don't need executable stack.
.section .note.GNU-stack,"",%progbits
4 changes: 2 additions & 2 deletions util/src/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 _tars_jump_fcontext
.align 2
_jump_fcontext:
_tars_jump_fcontext:
@ save LR as PC
push {lr}
@ save hidden,V1-V8,LR
Expand Down
4 changes: 2 additions & 2 deletions util/src/asm/jump_arm_aapcs_pe_armasm.asm
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,9 @@

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

jump_fcontext PROC
tars_jump_fcontext PROC
; save LR as PC
push {lr}
; save hidden,V1-V8,LR
Expand Down
10 changes: 5 additions & 5 deletions util/src/asm/jump_i386_ms_pe_gas.asm
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,9 @@
.def @feat.00; .scl 3; .type 0; .endef
.set @feat.00, 1

.globl _jump_fcontext
.def _jump_fcontext; .scl 2; .type 32; .endef
_jump_fcontext:
.globl _tars_jump_fcontext
.def _tars_jump_fcontext; .scl 2; .type 32; .endef
_tars_jump_fcontext:
/* prepare stack */
leal -0x2c(%esp), %esp

Expand Down Expand Up @@ -71,7 +71,7 @@ _jump_fcontext:
/* store ESP (pointing to context-data) in EAX */
movl %esp, %eax

/* firstarg of jump_fcontext() == fcontext to jump to */
/* firstarg of tars_jump_fcontext() == fcontext to jump to */
movl 0x30(%esp), %ecx
/* restore ESP (pointing to context-data) from ECX */
Expand Down Expand Up @@ -120,4 +120,4 @@ _jump_fcontext:
jmp *%ecx

.section .drectve
.ascii " -export:\"jump_fcontext\""
.ascii " -export:\"tars_jump_fcontext\""
6 changes: 3 additions & 3 deletions util/src/asm/jump_i386_ms_pe_masm.asm
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
.model flat, c
.code

jump_fcontext PROC EXPORT
tars_jump_fcontext PROC EXPORT
; prepare stack
lea esp, [esp-02ch]

Expand Down Expand Up @@ -63,7 +63,7 @@ ENDIF
; store ESP (pointing to context-data) in EAX
mov eax, esp

; firstarg of jump_fcontext() == fcontext to jump to
; firstarg of tars_jump_fcontext() == fcontext to jump to
mov ecx, [esp+030h]
; restore ESP (pointing to context-data) from ECX
Expand Down Expand Up @@ -112,5 +112,5 @@ ENDIF

; jump to context
jmp ecx
jump_fcontext ENDP
tars_jump_fcontext ENDP
END
12 changes: 6 additions & 6 deletions util/src/asm/jump_i386_sysv_elf_gas.S
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,10 @@

.file "jump_i386_sysv_elf_gas.S"
.text
.globl jump_fcontext
.globl tars_jump_fcontext
.align 2
.type jump_fcontext,@function
jump_fcontext:
.type tars_jump_fcontext,@function
tars_jump_fcontext:
leal -0x18(%esp), %esp /* prepare stack */

#if !defined(BOOST_USE_TSX)
Expand All @@ -45,10 +45,10 @@ jump_fcontext:
/* store ESP (pointing to context-data) in ECX */
movl %esp, %ecx

/* first arg of jump_fcontext() == fcontext to jump to */
/* first arg of tars_jump_fcontext() == fcontext to jump to */
movl 0x20(%esp), %eax

/* second arg of jump_fcontext() == data to be transferred */
/* second arg of tars_jump_fcontext() == data to be transferred */
movl 0x24(%esp), %edx

/* restore ESP (pointing to context-data) from EAX */
Expand Down Expand Up @@ -77,7 +77,7 @@ jump_fcontext:

/* jump to context */
jmp *%ecx
.size jump_fcontext,.-jump_fcontext
.size tars_jump_fcontext,.-tars_jump_fcontext

/* Mark that we don't need executable stack. */
.section .note.GNU-stack,"",%progbits
8 changes: 4 additions & 4 deletions util/src/asm/jump_i386_sysv_macho_gas.S
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,9 @@
****************************************************************************************/

.text
.globl _jump_fcontext
.globl _tars_jump_fcontext
.align 2
_jump_fcontext:
_tars_jump_fcontext:
leal -0x18(%esp), %esp /* prepare stack */

#if !defined(BOOST_USE_TSX)
Expand All @@ -43,10 +43,10 @@ _jump_fcontext:
/* store ESP (pointing to context-data) in ECX */
movl %esp, %ecx

/* first arg of jump_fcontext() == fcontext to jump to */
/* first arg of tars_jump_fcontext() == fcontext to jump to */
movl 0x1c(%esp), %eax

/* second arg of jump_fcontext() == data to be transferred */
/* second arg of tars_jump_fcontext() == data to be transferred */
movl 0x20(%esp), %edx

/* restore ESP (pointing to context-data) from EAX */
Expand Down
12 changes: 6 additions & 6 deletions util/src/asm/jump_mips32_o32_elf_gas.S
Original file line number Diff line number Diff line change
Expand Up @@ -40,11 +40,11 @@

.file "jump_mips32_o32_elf_gas.S"
.text
.globl jump_fcontext
.globl tars_jump_fcontext
.align 2
.type jump_fcontext,@function
.ent jump_fcontext
jump_fcontext:
.type tars_jump_fcontext,@function
.ent tars_jump_fcontext
tars_jump_fcontext:
# reserve space on stack
addiu $sp, $sp, -96

Expand Down Expand Up @@ -112,8 +112,8 @@ jump_fcontext:

# jump to context
jr $t9
.end jump_fcontext
.size jump_fcontext, .-jump_fcontext
.end tars_jump_fcontext
.size tars_jump_fcontext, .-tars_jump_fcontext

/* Mark that we don't need executable stack. */
.section .note.GNU-stack,"",%progbits
12 changes: 6 additions & 6 deletions util/src/asm/jump_ppc32_sysv_elf_gas.S
Original file line number Diff line number Diff line change
Expand Up @@ -52,12 +52,12 @@

.file "jump_ppc32_sysv_elf_gas.S"
.text
.globl jump_fcontext
.globl tars_jump_fcontext
.align 2
.type jump_fcontext,@function
jump_fcontext:
# Linux: jump_fcontext( hidden transfer_t * R3, R4, R5)
# Other: transfer_t R3:R4 = jump_fcontext( R3, R4)
.type tars_jump_fcontext,@function
tars_jump_fcontext:
# Linux: tars_jump_fcontext( hidden transfer_t * R3, R4, R5)
# Other: transfer_t R3:R4 = tars_jump_fcontext( R3, R4)

mflr %r0 # return address from LR
mffs %f0 # FPSCR
Expand Down Expand Up @@ -195,7 +195,7 @@ jump_fcontext:

# jump to context
bctr
.size jump_fcontext, .-jump_fcontext
.size tars_jump_fcontext, .-tars_jump_fcontext

/* Mark that we don't need executable stack. */
.section .note.GNU-stack,"",%progbits
4 changes: 2 additions & 2 deletions util/src/asm/jump_ppc32_sysv_macho_gas.S
Original file line number Diff line number Diff line change
Expand Up @@ -74,9 +74,9 @@
*******************************************************/

.text
.globl _jump_fcontext
.globl _tars_jump_fcontext
.align 2
_jump_fcontext:
_tars_jump_fcontext:
; reserve space on stack
subi r1, r1, 244

Expand Down
12 changes: 6 additions & 6 deletions util/src/asm/jump_ppc32_sysv_xcoff_gas.S
Original file line number Diff line number Diff line change
Expand Up @@ -72,13 +72,13 @@
* ------------------------------------------------- *
* *
*******************************************************/
.globl .jump_fcontext
.globl jump_fcontext[DS]
.globl .tars_jump_fcontext
.globl tars_jump_fcontext[DS]
.align 2
.csect jump_fcontext[DS]
jump_fcontext:
.long .jump_fcontext
.jump_fcontext:
.csect tars_jump_fcontext[DS]
tars_jump_fcontext:
.long .tars_jump_fcontext
.tars_jump_fcontext:
# reserve space on stack
subi r1, r1, 244

Expand Down
36 changes: 18 additions & 18 deletions util/src/asm/jump_ppc64_sysv_elf_gas.S
Original file line number Diff line number Diff line change
Expand Up @@ -67,33 +67,33 @@
*******************************************************/

.file "jump_ppc64_sysv_elf_gas.S"
.globl jump_fcontext
.globl tars_jump_fcontext
#if _CALL_ELF == 2
.text
.align 2
jump_fcontext:
addis %r2, %r12, .TOC.-jump_fcontext@ha
addi %r2, %r2, .TOC.-jump_fcontext@l
.localentry jump_fcontext, . - jump_fcontext
tars_jump_fcontext:
addis %r2, %r12, .TOC.-tars_jump_fcontext@ha
addi %r2, %r2, .TOC.-tars_jump_fcontext@l
.localentry tars_jump_fcontext, . - tars_jump_fcontext
#else
.section ".opd","aw"
.align 3
jump_fcontext:
tars_jump_fcontext:
# ifdef _CALL_LINUX
.quad .L.jump_fcontext,.TOC.@tocbase,0
.type jump_fcontext,@function
.quad .L.tars_jump_fcontext,.TOC.@tocbase,0
.type tars_jump_fcontext,@function
.text
.align 2
.L.jump_fcontext:
.L.tars_jump_fcontext:
# else
.hidden .jump_fcontext
.globl .jump_fcontext
.quad .jump_fcontext,.TOC.@tocbase,0
.size jump_fcontext,24
.type .jump_fcontext,@function
.hidden .tars_jump_fcontext
.globl .tars_jump_fcontext
.quad .tars_jump_fcontext,.TOC.@tocbase,0
.size tars_jump_fcontext,24
.type .tars_jump_fcontext,@function
.text
.align 2
.jump_fcontext:
.tars_jump_fcontext:
# endif
#endif
# reserve space on stack
Expand Down Expand Up @@ -189,7 +189,7 @@ jump_fcontext:

# jump to context
bctr
.size jump_fcontext, .-jump_fcontext
.size tars_jump_fcontext, .-tars_jump_fcontext
#else
# zero in r3 indicates first jump to context-function
cmpdi %r3, 0
Expand All @@ -210,9 +210,9 @@ use_entry_arg:
# jump to context
bctr
# ifdef _CALL_LINUX
.size .jump_fcontext, .-.L.jump_fcontext
.size .tars_jump_fcontext, .-.L.tars_jump_fcontext
# else
.size .jump_fcontext, .-.jump_fcontext
.size .tars_jump_fcontext, .-.tars_jump_fcontext
# endif
#endif

Expand Down
4 changes: 2 additions & 2 deletions util/src/asm/jump_ppc64_sysv_macho_gas.S
Original file line number Diff line number Diff line change
Expand Up @@ -68,9 +68,9 @@

.text
.align 2
.globl _jump_fcontext
.globl _tars_jump_fcontext

_jump_fcontext:
_tars_jump_fcontext:
; reserve space on stack
subi r1, r1, 184

Expand Down
4 changes: 2 additions & 2 deletions util/src/asm/jump_ppc64_sysv_xcoff_gas.S
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
*/

.align 2
.globl .jump_fcontext
.jump_fcontext:
.globl .tars_jump_fcontext
.tars_jump_fcontext:
# reserve space on stack
subi 1, 1, 184

Expand Down
Loading

0 comments on commit 7d892f2

Please sign in to comment.