18c2ecf20Sopenharmony_ci/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */ 28c2ecf20Sopenharmony_ci/* 38c2ecf20Sopenharmony_ci * Copyright (C) 2004, 2007-2010, 2011-2012 Synopsys, Inc. (www.synopsys.com) 48c2ecf20Sopenharmony_ci * 58c2ecf20Sopenharmony_ci * This program is free software; you can redistribute it and/or modify 68c2ecf20Sopenharmony_ci * it under the terms of the GNU General Public License version 2 as 78c2ecf20Sopenharmony_ci * published by the Free Software Foundation. 88c2ecf20Sopenharmony_ci * 98c2ecf20Sopenharmony_ci * Amit Bhor, Sameer Dhavale: Codito Technologies 2004 108c2ecf20Sopenharmony_ci */ 118c2ecf20Sopenharmony_ci 128c2ecf20Sopenharmony_ci#ifndef _UAPI__ASM_ARC_PTRACE_H 138c2ecf20Sopenharmony_ci#define _UAPI__ASM_ARC_PTRACE_H 148c2ecf20Sopenharmony_ci 158c2ecf20Sopenharmony_ci#define PTRACE_GET_THREAD_AREA 25 168c2ecf20Sopenharmony_ci 178c2ecf20Sopenharmony_ci#ifndef __ASSEMBLY__ 188c2ecf20Sopenharmony_ci/* 198c2ecf20Sopenharmony_ci * Userspace ABI: Register state needed by 208c2ecf20Sopenharmony_ci * -ptrace (gdbserver) 218c2ecf20Sopenharmony_ci * -sigcontext (SA_SIGNINFO signal frame) 228c2ecf20Sopenharmony_ci * 238c2ecf20Sopenharmony_ci * This is to decouple pt_regs from user-space ABI, to be able to change it 248c2ecf20Sopenharmony_ci * w/o affecting the ABI. 258c2ecf20Sopenharmony_ci * 268c2ecf20Sopenharmony_ci * The intermediate pad,pad2 are relics of initial layout based on pt_regs 278c2ecf20Sopenharmony_ci * for optimizations when copying pt_regs to/from user_regs_struct. 288c2ecf20Sopenharmony_ci * We no longer need them, but can't be changed as they are part of ABI now. 298c2ecf20Sopenharmony_ci * 308c2ecf20Sopenharmony_ci * Also, sigcontext only care about the scratch regs as that is what we really 318c2ecf20Sopenharmony_ci * save/restore for signal handling. However gdb also uses the same struct 328c2ecf20Sopenharmony_ci * hence callee regs need to be in there too. 338c2ecf20Sopenharmony_ci*/ 348c2ecf20Sopenharmony_cistruct user_regs_struct { 358c2ecf20Sopenharmony_ci 368c2ecf20Sopenharmony_ci unsigned long pad; 378c2ecf20Sopenharmony_ci struct { 388c2ecf20Sopenharmony_ci unsigned long bta, lp_start, lp_end, lp_count; 398c2ecf20Sopenharmony_ci unsigned long status32, ret, blink, fp, gp; 408c2ecf20Sopenharmony_ci unsigned long r12, r11, r10, r9, r8, r7, r6, r5, r4, r3, r2, r1, r0; 418c2ecf20Sopenharmony_ci unsigned long sp; 428c2ecf20Sopenharmony_ci } scratch; 438c2ecf20Sopenharmony_ci unsigned long pad2; 448c2ecf20Sopenharmony_ci struct { 458c2ecf20Sopenharmony_ci unsigned long r25, r24, r23, r22, r21, r20; 468c2ecf20Sopenharmony_ci unsigned long r19, r18, r17, r16, r15, r14, r13; 478c2ecf20Sopenharmony_ci } callee; 488c2ecf20Sopenharmony_ci unsigned long efa; /* break pt addr, for break points in delay slots */ 498c2ecf20Sopenharmony_ci unsigned long stop_pc; /* give dbg stop_pc after ensuring brkpt trap */ 508c2ecf20Sopenharmony_ci}; 518c2ecf20Sopenharmony_ci 528c2ecf20Sopenharmony_cistruct user_regs_arcv2 { 538c2ecf20Sopenharmony_ci unsigned long r30, r58, r59; 548c2ecf20Sopenharmony_ci}; 558c2ecf20Sopenharmony_ci 568c2ecf20Sopenharmony_ci#endif /* !__ASSEMBLY__ */ 578c2ecf20Sopenharmony_ci 588c2ecf20Sopenharmony_ci#endif /* _UAPI__ASM_ARC_PTRACE_H */ 59