18c2ecf20Sopenharmony_ci/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
28c2ecf20Sopenharmony_ci/*
38c2ecf20Sopenharmony_ci *  Copyright (C) 2004, 2006, 2009, 2010 Texas Instruments Incorporated
48c2ecf20Sopenharmony_ci *  Author: Aurelien Jacquiot (aurelien.jacquiot@jaluna.com)
58c2ecf20Sopenharmony_ci *
68c2ecf20Sopenharmony_ci *  Updated for 2.6.34: Mark Salter <msalter@redhat.com>
78c2ecf20Sopenharmony_ci *
88c2ecf20Sopenharmony_ci *  This program is free software; you can redistribute it and/or modify
98c2ecf20Sopenharmony_ci *  it under the terms of the GNU General Public License version 2 as
108c2ecf20Sopenharmony_ci *  published by the Free Software Foundation.
118c2ecf20Sopenharmony_ci */
128c2ecf20Sopenharmony_ci#ifndef _UAPI_ASM_C6X_PTRACE_H
138c2ecf20Sopenharmony_ci#define _UAPI_ASM_C6X_PTRACE_H
148c2ecf20Sopenharmony_ci
158c2ecf20Sopenharmony_ci#define BKPT_OPCODE	0x56454314	/* illegal opcode */
168c2ecf20Sopenharmony_ci
178c2ecf20Sopenharmony_ci#ifdef _BIG_ENDIAN
188c2ecf20Sopenharmony_ci#define PT_LO(odd, even)  odd
198c2ecf20Sopenharmony_ci#define PT_HI(odd, even)  even
208c2ecf20Sopenharmony_ci#else
218c2ecf20Sopenharmony_ci#define PT_LO(odd, even)  even
228c2ecf20Sopenharmony_ci#define PT_HI(odd, even)  odd
238c2ecf20Sopenharmony_ci#endif
248c2ecf20Sopenharmony_ci
258c2ecf20Sopenharmony_ci#define PT_A4_ORG  PT_LO(1, 0)
268c2ecf20Sopenharmony_ci#define PT_TSR	   PT_HI(1, 0)
278c2ecf20Sopenharmony_ci#define PT_ILC	   PT_LO(3, 2)
288c2ecf20Sopenharmony_ci#define PT_RILC    PT_HI(3, 2)
298c2ecf20Sopenharmony_ci#define PT_CSR	   PT_LO(5, 4)
308c2ecf20Sopenharmony_ci#define PT_PC	   PT_HI(5, 4)
318c2ecf20Sopenharmony_ci#define PT_B16	   PT_LO(7, 6)
328c2ecf20Sopenharmony_ci#define PT_B17	   PT_HI(7, 6)
338c2ecf20Sopenharmony_ci#define PT_B18	   PT_LO(9, 8)
348c2ecf20Sopenharmony_ci#define PT_B19	   PT_HI(9, 8)
358c2ecf20Sopenharmony_ci#define PT_B20	   PT_LO(11, 10)
368c2ecf20Sopenharmony_ci#define PT_B21	   PT_HI(11, 10)
378c2ecf20Sopenharmony_ci#define PT_B22	   PT_LO(13, 12)
388c2ecf20Sopenharmony_ci#define PT_B23	   PT_HI(13, 12)
398c2ecf20Sopenharmony_ci#define PT_B24	   PT_LO(15, 14)
408c2ecf20Sopenharmony_ci#define PT_B25	   PT_HI(15, 14)
418c2ecf20Sopenharmony_ci#define PT_B26	   PT_LO(17, 16)
428c2ecf20Sopenharmony_ci#define PT_B27	   PT_HI(17, 16)
438c2ecf20Sopenharmony_ci#define PT_B28	   PT_LO(19, 18)
448c2ecf20Sopenharmony_ci#define PT_B29	   PT_HI(19, 18)
458c2ecf20Sopenharmony_ci#define PT_B30	   PT_LO(21, 20)
468c2ecf20Sopenharmony_ci#define PT_B31	   PT_HI(21, 20)
478c2ecf20Sopenharmony_ci#define PT_B0	   PT_LO(23, 22)
488c2ecf20Sopenharmony_ci#define PT_B1	   PT_HI(23, 22)
498c2ecf20Sopenharmony_ci#define PT_B2	   PT_LO(25, 24)
508c2ecf20Sopenharmony_ci#define PT_B3	   PT_HI(25, 24)
518c2ecf20Sopenharmony_ci#define PT_B4	   PT_LO(27, 26)
528c2ecf20Sopenharmony_ci#define PT_B5	   PT_HI(27, 26)
538c2ecf20Sopenharmony_ci#define PT_B6	   PT_LO(29, 28)
548c2ecf20Sopenharmony_ci#define PT_B7	   PT_HI(29, 28)
558c2ecf20Sopenharmony_ci#define PT_B8	   PT_LO(31, 30)
568c2ecf20Sopenharmony_ci#define PT_B9	   PT_HI(31, 30)
578c2ecf20Sopenharmony_ci#define PT_B10	   PT_LO(33, 32)
588c2ecf20Sopenharmony_ci#define PT_B11	   PT_HI(33, 32)
598c2ecf20Sopenharmony_ci#define PT_B12	   PT_LO(35, 34)
608c2ecf20Sopenharmony_ci#define PT_B13	   PT_HI(35, 34)
618c2ecf20Sopenharmony_ci#define PT_A16	   PT_LO(37, 36)
628c2ecf20Sopenharmony_ci#define PT_A17	   PT_HI(37, 36)
638c2ecf20Sopenharmony_ci#define PT_A18	   PT_LO(39, 38)
648c2ecf20Sopenharmony_ci#define PT_A19	   PT_HI(39, 38)
658c2ecf20Sopenharmony_ci#define PT_A20	   PT_LO(41, 40)
668c2ecf20Sopenharmony_ci#define PT_A21	   PT_HI(41, 40)
678c2ecf20Sopenharmony_ci#define PT_A22	   PT_LO(43, 42)
688c2ecf20Sopenharmony_ci#define PT_A23	   PT_HI(43, 42)
698c2ecf20Sopenharmony_ci#define PT_A24	   PT_LO(45, 44)
708c2ecf20Sopenharmony_ci#define PT_A25	   PT_HI(45, 44)
718c2ecf20Sopenharmony_ci#define PT_A26	   PT_LO(47, 46)
728c2ecf20Sopenharmony_ci#define PT_A27	   PT_HI(47, 46)
738c2ecf20Sopenharmony_ci#define PT_A28	   PT_LO(49, 48)
748c2ecf20Sopenharmony_ci#define PT_A29	   PT_HI(49, 48)
758c2ecf20Sopenharmony_ci#define PT_A30	   PT_LO(51, 50)
768c2ecf20Sopenharmony_ci#define PT_A31	   PT_HI(51, 50)
778c2ecf20Sopenharmony_ci#define PT_A0	   PT_LO(53, 52)
788c2ecf20Sopenharmony_ci#define PT_A1	   PT_HI(53, 52)
798c2ecf20Sopenharmony_ci#define PT_A2	   PT_LO(55, 54)
808c2ecf20Sopenharmony_ci#define PT_A3	   PT_HI(55, 54)
818c2ecf20Sopenharmony_ci#define PT_A4	   PT_LO(57, 56)
828c2ecf20Sopenharmony_ci#define PT_A5	   PT_HI(57, 56)
838c2ecf20Sopenharmony_ci#define PT_A6	   PT_LO(59, 58)
848c2ecf20Sopenharmony_ci#define PT_A7	   PT_HI(59, 58)
858c2ecf20Sopenharmony_ci#define PT_A8	   PT_LO(61, 60)
868c2ecf20Sopenharmony_ci#define PT_A9	   PT_HI(61, 60)
878c2ecf20Sopenharmony_ci#define PT_A10	   PT_LO(63, 62)
888c2ecf20Sopenharmony_ci#define PT_A11	   PT_HI(63, 62)
898c2ecf20Sopenharmony_ci#define PT_A12	   PT_LO(65, 64)
908c2ecf20Sopenharmony_ci#define PT_A13	   PT_HI(65, 64)
918c2ecf20Sopenharmony_ci#define PT_A14	   PT_LO(67, 66)
928c2ecf20Sopenharmony_ci#define PT_A15	   PT_HI(67, 66)
938c2ecf20Sopenharmony_ci#define PT_B14	   PT_LO(69, 68)
948c2ecf20Sopenharmony_ci#define PT_B15	   PT_HI(69, 68)
958c2ecf20Sopenharmony_ci
968c2ecf20Sopenharmony_ci#define NR_PTREGS  70
978c2ecf20Sopenharmony_ci
988c2ecf20Sopenharmony_ci#define PT_DP	   PT_B14  /* Data Segment Pointer (B14) */
998c2ecf20Sopenharmony_ci#define PT_SP	   PT_B15  /* Stack Pointer (B15)  */
1008c2ecf20Sopenharmony_ci
1018c2ecf20Sopenharmony_ci#define PTRACE_GETFDPIC		31	/* get the ELF fdpic loadmap address */
1028c2ecf20Sopenharmony_ci
1038c2ecf20Sopenharmony_ci#define PTRACE_GETFDPIC_EXEC	0	/* [addr] request the executable loadmap */
1048c2ecf20Sopenharmony_ci#define PTRACE_GETFDPIC_INTERP	1	/* [addr] request the interpreter loadmap */
1058c2ecf20Sopenharmony_ci
1068c2ecf20Sopenharmony_ci#ifndef __ASSEMBLY__
1078c2ecf20Sopenharmony_ci
1088c2ecf20Sopenharmony_ci#ifdef _BIG_ENDIAN
1098c2ecf20Sopenharmony_ci#define REG_PAIR(odd, even) unsigned long odd; unsigned long even
1108c2ecf20Sopenharmony_ci#else
1118c2ecf20Sopenharmony_ci#define REG_PAIR(odd, even) unsigned long even; unsigned long odd
1128c2ecf20Sopenharmony_ci#endif
1138c2ecf20Sopenharmony_ci
1148c2ecf20Sopenharmony_ci/*
1158c2ecf20Sopenharmony_ci * this struct defines the way the registers are stored on the
1168c2ecf20Sopenharmony_ci * stack during a system call. fields defined with REG_PAIR
1178c2ecf20Sopenharmony_ci * are saved and restored using double-word memory operations
1188c2ecf20Sopenharmony_ci * which means the word ordering of the pair depends on endianess.
1198c2ecf20Sopenharmony_ci */
1208c2ecf20Sopenharmony_cistruct pt_regs {
1218c2ecf20Sopenharmony_ci	REG_PAIR(tsr, orig_a4);
1228c2ecf20Sopenharmony_ci	REG_PAIR(rilc, ilc);
1238c2ecf20Sopenharmony_ci	REG_PAIR(pc, csr);
1248c2ecf20Sopenharmony_ci
1258c2ecf20Sopenharmony_ci	REG_PAIR(b17, b16);
1268c2ecf20Sopenharmony_ci	REG_PAIR(b19, b18);
1278c2ecf20Sopenharmony_ci	REG_PAIR(b21, b20);
1288c2ecf20Sopenharmony_ci	REG_PAIR(b23, b22);
1298c2ecf20Sopenharmony_ci	REG_PAIR(b25, b24);
1308c2ecf20Sopenharmony_ci	REG_PAIR(b27, b26);
1318c2ecf20Sopenharmony_ci	REG_PAIR(b29, b28);
1328c2ecf20Sopenharmony_ci	REG_PAIR(b31, b30);
1338c2ecf20Sopenharmony_ci
1348c2ecf20Sopenharmony_ci	REG_PAIR(b1, b0);
1358c2ecf20Sopenharmony_ci	REG_PAIR(b3, b2);
1368c2ecf20Sopenharmony_ci	REG_PAIR(b5, b4);
1378c2ecf20Sopenharmony_ci	REG_PAIR(b7, b6);
1388c2ecf20Sopenharmony_ci	REG_PAIR(b9, b8);
1398c2ecf20Sopenharmony_ci	REG_PAIR(b11, b10);
1408c2ecf20Sopenharmony_ci	REG_PAIR(b13, b12);
1418c2ecf20Sopenharmony_ci
1428c2ecf20Sopenharmony_ci	REG_PAIR(a17, a16);
1438c2ecf20Sopenharmony_ci	REG_PAIR(a19, a18);
1448c2ecf20Sopenharmony_ci	REG_PAIR(a21, a20);
1458c2ecf20Sopenharmony_ci	REG_PAIR(a23, a22);
1468c2ecf20Sopenharmony_ci	REG_PAIR(a25, a24);
1478c2ecf20Sopenharmony_ci	REG_PAIR(a27, a26);
1488c2ecf20Sopenharmony_ci	REG_PAIR(a29, a28);
1498c2ecf20Sopenharmony_ci	REG_PAIR(a31, a30);
1508c2ecf20Sopenharmony_ci
1518c2ecf20Sopenharmony_ci	REG_PAIR(a1, a0);
1528c2ecf20Sopenharmony_ci	REG_PAIR(a3, a2);
1538c2ecf20Sopenharmony_ci	REG_PAIR(a5, a4);
1548c2ecf20Sopenharmony_ci	REG_PAIR(a7, a6);
1558c2ecf20Sopenharmony_ci	REG_PAIR(a9, a8);
1568c2ecf20Sopenharmony_ci	REG_PAIR(a11, a10);
1578c2ecf20Sopenharmony_ci	REG_PAIR(a13, a12);
1588c2ecf20Sopenharmony_ci
1598c2ecf20Sopenharmony_ci	REG_PAIR(a15, a14);
1608c2ecf20Sopenharmony_ci	REG_PAIR(sp, dp);
1618c2ecf20Sopenharmony_ci};
1628c2ecf20Sopenharmony_ci
1638c2ecf20Sopenharmony_ci#endif /* __ASSEMBLY__ */
1648c2ecf20Sopenharmony_ci#endif /* _UAPI_ASM_C6X_PTRACE_H */
165