1 #if (defined(__riscv) && (__riscv_xlen == 64)) && defined(__linux__)
3 #include "sanitizer_common/sanitizer_asm.h"
5 ASM_HIDDEN(COMMON_INTERCEPTOR_SPILL_AREA)
7 .comm _ZN14__interception10real_vforkE,8,8
8 .globl ASM_WRAPPER_NAME(vfork)
9 ASM_TYPE_FUNCTION(ASM_WRAPPER_NAME(vfork))
10 ASM_WRAPPER_NAME(vfork):
11 // Save ra in the off-stack spill area.
12 // allocate space on stack
16 call COMMON_INTERCEPTOR_SPILL_AREA
17 // restore previous values from stack
24 // Call real vfork. This may return twice. User code that runs between the first and the second return
25 // may clobber the stack frame of the interceptor; that's why it does not have a frame.
26 la x10, _ZN14__interception10real_vforkE
32 // store x10 by adjusted stack
34 // jump to exit label if x10 is 0
37 // x0 != 0 => parent process. Clear stack shadow.
40 call COMMON_INTERCEPTOR_HANDLE_VFORK
44 call COMMON_INTERCEPTOR_SPILL_AREA
46 // load value by stack
53 ASM_INTERCEPTOR_TRAMPOLINE(vfork)
54 ASM_TRAMPOLINE_ALIAS(vfork, vfork)