1*4882a593Smuzhiyun /* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */ 2*4882a593Smuzhiyun /* 3*4882a593Smuzhiyun * Ptrace definitions for the Hexagon architecture 4*4882a593Smuzhiyun * 5*4882a593Smuzhiyun * Copyright (c) 2010-2011, The Linux Foundation. All rights reserved. 6*4882a593Smuzhiyun * 7*4882a593Smuzhiyun * This program is free software; you can redistribute it and/or modify 8*4882a593Smuzhiyun * it under the terms of the GNU General Public License version 2 and 9*4882a593Smuzhiyun * only version 2 as published by the Free Software Foundation. 10*4882a593Smuzhiyun * 11*4882a593Smuzhiyun * This program is distributed in the hope that it will be useful, 12*4882a593Smuzhiyun * but WITHOUT ANY WARRANTY; without even the implied warranty of 13*4882a593Smuzhiyun * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14*4882a593Smuzhiyun * GNU General Public License for more details. 15*4882a593Smuzhiyun * 16*4882a593Smuzhiyun * You should have received a copy of the GNU General Public License 17*4882a593Smuzhiyun * along with this program; if not, write to the Free Software 18*4882a593Smuzhiyun * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 19*4882a593Smuzhiyun * 02110-1301, USA. 20*4882a593Smuzhiyun */ 21*4882a593Smuzhiyun 22*4882a593Smuzhiyun #ifndef _ASM_PTRACE_H 23*4882a593Smuzhiyun #define _ASM_PTRACE_H 24*4882a593Smuzhiyun 25*4882a593Smuzhiyun #include <asm/registers.h> 26*4882a593Smuzhiyun 27*4882a593Smuzhiyun #define instruction_pointer(regs) pt_elr(regs) 28*4882a593Smuzhiyun #define user_stack_pointer(regs) ((regs)->r29) 29*4882a593Smuzhiyun 30*4882a593Smuzhiyun #define profile_pc(regs) instruction_pointer(regs) 31*4882a593Smuzhiyun 32*4882a593Smuzhiyun /* kprobe-based event tracer support */ 33*4882a593Smuzhiyun extern int regs_query_register_offset(const char *name); 34*4882a593Smuzhiyun extern const char *regs_query_register_name(unsigned int offset); 35*4882a593Smuzhiyun 36*4882a593Smuzhiyun #define current_pt_regs() \ 37*4882a593Smuzhiyun ((struct pt_regs *) \ 38*4882a593Smuzhiyun ((unsigned long)current_thread_info() + THREAD_SIZE) - 1) 39*4882a593Smuzhiyun 40*4882a593Smuzhiyun #if CONFIG_HEXAGON_ARCH_VERSION >= 4 41*4882a593Smuzhiyun #define arch_has_single_step() (1) 42*4882a593Smuzhiyun #endif 43*4882a593Smuzhiyun 44*4882a593Smuzhiyun 45*4882a593Smuzhiyun #endif 46