1 //===-- xray_trampoline_mips64.s --------------------------------*- ASM -*-===//
3 // The LLVM Compiler Infrastructure
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
8 //===----------------------------------------------------------------------===//
10 // This file is a part of XRay, a dynamic runtime instrumentation system.
12 // This implements the MIPS64-specific assembler for the trampolines.
14 //===----------------------------------------------------------------------===//
17 .file "xray_trampoline_mips64.S"
18 .globl __xray_FunctionEntry
20 .type __xray_FunctionEntry,@function
23 // Save argument registers before doing any actual work.
24 .cfi_def_cfa_offset 144
46 lui $gp, %hi(%neg(%gp_rel(__xray_FunctionEntry)))
48 daddiu $gp ,$gp, %lo(%neg(%gp_rel(__xray_FunctionEntry)))
50 dla $t9, _ZN6__xray19XRayPatchedFunctionE
53 beqz $t9, FunctionEntry_restore
55 // a1=0 means that we are tracing an entry event
57 // Function ID is in t0 (the first parameter).
61 FunctionEntry_restore:
62 // Restore argument registers
84 .size __xray_FunctionEntry, FunctionEntry_end-__xray_FunctionEntry
88 .globl __xray_FunctionExit
90 .type __xray_FunctionExit,@function
93 // Save return registers before doing any actual work.
94 .cfi_def_cfa_offset 64
106 lui $gp, %hi(%neg(%gp_rel(__xray_FunctionExit)))
108 daddiu $gp ,$gp, %lo(%neg(%gp_rel(__xray_FunctionExit)))
110 dla $t9, _ZN6__xray19XRayPatchedFunctionE
113 beqz $t9, FunctionExit_restore
115 // a1=1 means that we are tracing an exit event
117 // Function ID is in t0 (the first parameter).
121 FunctionExit_restore:
122 // Restore return registers
135 .size __xray_FunctionExit, FunctionExit_end-__xray_FunctionExit