1*4882a593Smuzhiyun /* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */ 2*4882a593Smuzhiyun /* 3*4882a593Smuzhiyun * Copyright (C) 2004, 2007-2010, 2011-2012 Synopsys, Inc. (www.synopsys.com) 4*4882a593Smuzhiyun * 5*4882a593Smuzhiyun * This program is free software; you can redistribute it and/or modify 6*4882a593Smuzhiyun * it under the terms of the GNU General Public License version 2 as 7*4882a593Smuzhiyun * published by the Free Software Foundation. 8*4882a593Smuzhiyun * 9*4882a593Smuzhiyun * Amit Bhor, Sameer Dhavale: Codito Technologies 2004 10*4882a593Smuzhiyun */ 11*4882a593Smuzhiyun 12*4882a593Smuzhiyun #ifndef _UAPI__ASM_ARC_PTRACE_H 13*4882a593Smuzhiyun #define _UAPI__ASM_ARC_PTRACE_H 14*4882a593Smuzhiyun 15*4882a593Smuzhiyun #define PTRACE_GET_THREAD_AREA 25 16*4882a593Smuzhiyun 17*4882a593Smuzhiyun #ifndef __ASSEMBLY__ 18*4882a593Smuzhiyun /* 19*4882a593Smuzhiyun * Userspace ABI: Register state needed by 20*4882a593Smuzhiyun * -ptrace (gdbserver) 21*4882a593Smuzhiyun * -sigcontext (SA_SIGNINFO signal frame) 22*4882a593Smuzhiyun * 23*4882a593Smuzhiyun * This is to decouple pt_regs from user-space ABI, to be able to change it 24*4882a593Smuzhiyun * w/o affecting the ABI. 25*4882a593Smuzhiyun * 26*4882a593Smuzhiyun * The intermediate pad,pad2 are relics of initial layout based on pt_regs 27*4882a593Smuzhiyun * for optimizations when copying pt_regs to/from user_regs_struct. 28*4882a593Smuzhiyun * We no longer need them, but can't be changed as they are part of ABI now. 29*4882a593Smuzhiyun * 30*4882a593Smuzhiyun * Also, sigcontext only care about the scratch regs as that is what we really 31*4882a593Smuzhiyun * save/restore for signal handling. However gdb also uses the same struct 32*4882a593Smuzhiyun * hence callee regs need to be in there too. 33*4882a593Smuzhiyun */ 34*4882a593Smuzhiyun struct user_regs_struct { 35*4882a593Smuzhiyun 36*4882a593Smuzhiyun unsigned long pad; 37*4882a593Smuzhiyun struct { 38*4882a593Smuzhiyun unsigned long bta, lp_start, lp_end, lp_count; 39*4882a593Smuzhiyun unsigned long status32, ret, blink, fp, gp; 40*4882a593Smuzhiyun unsigned long r12, r11, r10, r9, r8, r7, r6, r5, r4, r3, r2, r1, r0; 41*4882a593Smuzhiyun unsigned long sp; 42*4882a593Smuzhiyun } scratch; 43*4882a593Smuzhiyun unsigned long pad2; 44*4882a593Smuzhiyun struct { 45*4882a593Smuzhiyun unsigned long r25, r24, r23, r22, r21, r20; 46*4882a593Smuzhiyun unsigned long r19, r18, r17, r16, r15, r14, r13; 47*4882a593Smuzhiyun } callee; 48*4882a593Smuzhiyun unsigned long efa; /* break pt addr, for break points in delay slots */ 49*4882a593Smuzhiyun unsigned long stop_pc; /* give dbg stop_pc after ensuring brkpt trap */ 50*4882a593Smuzhiyun }; 51*4882a593Smuzhiyun 52*4882a593Smuzhiyun struct user_regs_arcv2 { 53*4882a593Smuzhiyun unsigned long r30, r58, r59; 54*4882a593Smuzhiyun }; 55*4882a593Smuzhiyun 56*4882a593Smuzhiyun #endif /* !__ASSEMBLY__ */ 57*4882a593Smuzhiyun 58*4882a593Smuzhiyun #endif /* _UAPI__ASM_ARC_PTRACE_H */ 59