mirror of
https://github.com/AuxXxilium/linux_dsm_epyc7002.git
synced 2024-12-16 15:36:45 +07:00
2874c5fd28
Based on 1 normalized pattern(s): this program is free software you can redistribute it and or modify it under the terms of the gnu general public license as published by the free software foundation either version 2 of the license or at your option any later version extracted by the scancode license scanner the SPDX license identifier GPL-2.0-or-later has been chosen to replace the boilerplate/reference in 3029 file(s). Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Reviewed-by: Allison Randal <allison@lohutok.net> Cc: linux-spdx@vger.kernel.org Link: https://lkml.kernel.org/r/20190527070032.746973796@linutronix.de Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
67 lines
1.2 KiB
ArmAsm
67 lines
1.2 KiB
ArmAsm
/* SPDX-License-Identifier: GPL-2.0-or-later */
|
|
/*
|
|
* Split from ftrace_64.S
|
|
*/
|
|
|
|
#include <linux/magic.h>
|
|
#include <asm/ppc_asm.h>
|
|
#include <asm/asm-offsets.h>
|
|
#include <asm/ftrace.h>
|
|
#include <asm/ppc-opcode.h>
|
|
#include <asm/export.h>
|
|
|
|
_GLOBAL_TOC(ftrace_caller)
|
|
lbz r3, PACA_FTRACE_ENABLED(r13)
|
|
cmpdi r3, 0
|
|
beqlr
|
|
|
|
/* Taken from output of objdump from lib64/glibc */
|
|
mflr r3
|
|
ld r11, 0(r1)
|
|
stdu r1, -112(r1)
|
|
std r3, 128(r1)
|
|
ld r4, 16(r11)
|
|
subi r3, r3, MCOUNT_INSN_SIZE
|
|
.globl ftrace_call
|
|
ftrace_call:
|
|
bl ftrace_stub
|
|
nop
|
|
#ifdef CONFIG_FUNCTION_GRAPH_TRACER
|
|
.globl ftrace_graph_call
|
|
ftrace_graph_call:
|
|
b ftrace_graph_stub
|
|
_GLOBAL(ftrace_graph_stub)
|
|
#endif
|
|
ld r0, 128(r1)
|
|
mtlr r0
|
|
addi r1, r1, 112
|
|
|
|
_GLOBAL(ftrace_stub)
|
|
blr
|
|
|
|
#ifdef CONFIG_FUNCTION_GRAPH_TRACER
|
|
_GLOBAL(ftrace_graph_caller)
|
|
/* load r4 with local address */
|
|
ld r4, 128(r1)
|
|
subi r4, r4, MCOUNT_INSN_SIZE
|
|
|
|
/* Grab the LR out of the caller stack frame */
|
|
ld r11, 112(r1)
|
|
ld r3, 16(r11)
|
|
|
|
bl prepare_ftrace_return
|
|
nop
|
|
|
|
/*
|
|
* prepare_ftrace_return gives us the address we divert to.
|
|
* Change the LR in the callers stack frame to this.
|
|
*/
|
|
ld r11, 112(r1)
|
|
std r3, 16(r11)
|
|
|
|
ld r0, 128(r1)
|
|
mtlr r0
|
|
addi r1, r1, 112
|
|
blr
|
|
#endif /* CONFIG_FUNCTION_GRAPH_TRACER */
|