mirror of
https://github.com/torvalds/linux.git
synced 2026-11-27 17:02:17 +00:00
This patch converts riscv to use the generic entry infrastructure from kernel/entry/*. The generic entry makes maintainers' work easier and codes more elegant. Here are the changes: - More clear entry.S with handle_exception and ret_from_exception - Get rid of complex custom signal implementation - Move syscall procedure from assembly to C, which is much more readable. - Connect ret_from_fork & ret_from_kernel_thread to generic entry. - Wrap with irqentry_enter/exit and syscall_enter/exit_from_user_mode - Use the standard preemption code instead of custom Suggested-by: Huacai Chen <[email protected]> Reviewed-by: Björn Töpel <[email protected]> Tested-by: Yipeng Zou <[email protected]> Tested-by: Jisheng Zhang <[email protected]> Signed-off-by: Guo Ren <[email protected]> Signed-off-by: Guo Ren <[email protected]> Cc: Ben Hutchings <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Palmer Dabbelt <[email protected]>
25 lines
633 B
C
25 lines
633 B
C
/* SPDX-License-Identifier: GPL-2.0 */
|
|
|
|
#ifndef _ASM_RISCV_STACKTRACE_H
|
|
#define _ASM_RISCV_STACKTRACE_H
|
|
|
|
#include <linux/sched.h>
|
|
#include <asm/ptrace.h>
|
|
|
|
struct stackframe {
|
|
unsigned long fp;
|
|
unsigned long ra;
|
|
};
|
|
|
|
extern void notrace walk_stackframe(struct task_struct *task, struct pt_regs *regs,
|
|
bool (*fn)(void *, unsigned long), void *arg);
|
|
extern void dump_backtrace(struct pt_regs *regs, struct task_struct *task,
|
|
const char *loglvl);
|
|
|
|
static inline bool on_thread_stack(void)
|
|
{
|
|
return !(((unsigned long)(current->stack) ^ current_stack_pointer) & ~(THREAD_SIZE - 1));
|
|
}
|
|
|
|
#endif /* _ASM_RISCV_STACKTRACE_H */
|