xtensa: support DMA buffers in high memory
[cris-mirror.git] / arch / riscv / kernel / ftrace.c
blobd0de68d144cb03327116dcb434814b874e44a658
1 /* SPDX-License-Identifier: GPL-2.0 */
2 /*
3 * Copyright (C) 2013 Linaro Limited
4 * Author: AKASHI Takahiro <takahiro.akashi@linaro.org>
5 * Copyright (C) 2017 Andes Technology Corporation
6 */
8 #include <linux/ftrace.h>
11 * Most of this file is copied from arm64.
13 void prepare_ftrace_return(unsigned long *parent, unsigned long self_addr,
14 unsigned long frame_pointer)
16 unsigned long return_hooker = (unsigned long)&return_to_handler;
17 unsigned long old;
18 struct ftrace_graph_ent trace;
19 int err;
21 if (unlikely(atomic_read(&current->tracing_graph_pause)))
22 return;
25 * We don't suffer access faults, so no extra fault-recovery assembly
26 * is needed here.
28 old = *parent;
30 trace.func = self_addr;
31 trace.depth = current->curr_ret_stack + 1;
33 if (!ftrace_graph_entry(&trace))
34 return;
36 err = ftrace_push_return_trace(old, self_addr, &trace.depth,
37 frame_pointer, NULL);
38 if (err == -EBUSY)
39 return;
40 *parent = return_hooker;