1 //===-- xray_trampoline_mips64.s --------------------------------*- ASM -*-===//
3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4 // See https://llvm.org/LICENSE.txt for license information.
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
7 //===----------------------------------------------------------------------===//
9 // This file is a part of XRay, a dynamic runtime instrumentation system.
11 // This implements the MIPS64-specific assembler for the trampolines.
13 //===----------------------------------------------------------------------===//
16 .file "xray_trampoline_mips64.S"
17 .globl __xray_FunctionEntry
19 .type __xray_FunctionEntry,@function
22 // Save argument registers before doing any actual work.
23 .cfi_def_cfa_offset 144
45 lui $gp, %hi(%neg(%gp_rel(__xray_FunctionEntry)))
47 daddiu $gp ,$gp, %lo(%neg(%gp_rel(__xray_FunctionEntry)))
49 dla $t9, _ZN6__xray19XRayPatchedFunctionE
52 beqz $t9, FunctionEntry_restore
54 // a1=0 means that we are tracing an entry event
56 // Function ID is in t0 (the first parameter).
60 FunctionEntry_restore:
61 // Restore argument registers
83 .size __xray_FunctionEntry, FunctionEntry_end-__xray_FunctionEntry
87 .globl __xray_FunctionExit
89 .type __xray_FunctionExit,@function
92 // Save return registers before doing any actual work.
93 .cfi_def_cfa_offset 64
105 lui $gp, %hi(%neg(%gp_rel(__xray_FunctionExit)))
107 daddiu $gp ,$gp, %lo(%neg(%gp_rel(__xray_FunctionExit)))
109 dla $t9, _ZN6__xray19XRayPatchedFunctionE
112 beqz $t9, FunctionExit_restore
114 // a1=1 means that we are tracing an exit event
116 // Function ID is in t0 (the first parameter).
120 FunctionExit_restore:
121 // Restore return registers
134 .size __xray_FunctionExit, FunctionExit_end-__xray_FunctionExit