122851890Sopenharmony_ci/****************************************************************************
222851890Sopenharmony_ci ****************************************************************************
322851890Sopenharmony_ci ***
422851890Sopenharmony_ci ***   This header was automatically generated from a Linux kernel header
522851890Sopenharmony_ci ***   of the same name, to make information necessary for userspace to
622851890Sopenharmony_ci ***   call into the kernel available to libc.  It contains only constants,
722851890Sopenharmony_ci ***   structures, and macros generated from the original header, and thus,
822851890Sopenharmony_ci ***   contains no copyrightable information.
922851890Sopenharmony_ci ***
1022851890Sopenharmony_ci ***   To edit the content of this header, modify the corresponding
1122851890Sopenharmony_ci ***   source file (e.g. under external/kernel-headers/original/) then
1222851890Sopenharmony_ci ***   run bionic/libc/kernel/tools/update_all.py
1322851890Sopenharmony_ci ***
1422851890Sopenharmony_ci ***   Any manual change here will be lost the next time this script will
1522851890Sopenharmony_ci ***   be run. You've been warned!
1622851890Sopenharmony_ci ***
1722851890Sopenharmony_ci ****************************************************************************
1822851890Sopenharmony_ci ****************************************************************************/
1922851890Sopenharmony_ci#ifndef _ASM_PTRACE_H
2022851890Sopenharmony_ci#define _ASM_PTRACE_H
2122851890Sopenharmony_ci
2222851890Sopenharmony_ci#include <linux/types.h>
2322851890Sopenharmony_ci
2422851890Sopenharmony_ci#include <stdint.h>
2522851890Sopenharmony_ci
2622851890Sopenharmony_ci/*
2722851890Sopenharmony_ci * For PTRACE_{POKE,PEEK}USR. 0 - 31 are GPRs,
2822851890Sopenharmony_ci * 32 is syscall's original ARG0, 33 is PC, 34 is BADVADDR.
2922851890Sopenharmony_ci */
3022851890Sopenharmony_ci#define GPR_BASE	0
3122851890Sopenharmony_ci#define GPR_NUM		32
3222851890Sopenharmony_ci#define GPR_END		(GPR_BASE + GPR_NUM - 1)
3322851890Sopenharmony_ci#define ARG0		(GPR_END + 1)
3422851890Sopenharmony_ci#define PC		(GPR_END + 2)
3522851890Sopenharmony_ci#define BADVADDR	(GPR_END + 3)
3622851890Sopenharmony_ci
3722851890Sopenharmony_ci#define NUM_FPU_REGS	32
3822851890Sopenharmony_ci
3922851890Sopenharmony_cistruct user_pt_regs {
4022851890Sopenharmony_ci	/* Main processor registers. */
4122851890Sopenharmony_ci	unsigned long regs[32];
4222851890Sopenharmony_ci
4322851890Sopenharmony_ci	/* Original syscall arg0. */
4422851890Sopenharmony_ci	unsigned long orig_a0;
4522851890Sopenharmony_ci
4622851890Sopenharmony_ci	/* Special CSR registers. */
4722851890Sopenharmony_ci	unsigned long csr_era;
4822851890Sopenharmony_ci	unsigned long csr_badv;
4922851890Sopenharmony_ci	unsigned long reserved[10];
5022851890Sopenharmony_ci} __attribute__((aligned(8)));
5122851890Sopenharmony_ci
5222851890Sopenharmony_cistruct user_fp_state {
5322851890Sopenharmony_ci	uint64_t fpr[32];
5422851890Sopenharmony_ci	uint64_t fcc;
5522851890Sopenharmony_ci	uint32_t fcsr;
5622851890Sopenharmony_ci};
5722851890Sopenharmony_ci
5822851890Sopenharmony_cistruct user_lsx_state {
5922851890Sopenharmony_ci	/* 32 registers, 128 bits width per register. */
6022851890Sopenharmony_ci	uint64_t vregs[32*2];
6122851890Sopenharmony_ci};
6222851890Sopenharmony_ci
6322851890Sopenharmony_cistruct user_lasx_state {
6422851890Sopenharmony_ci	/* 32 registers, 256 bits width per register. */
6522851890Sopenharmony_ci	uint64_t vregs[32*4];
6622851890Sopenharmony_ci};
6722851890Sopenharmony_ci
6822851890Sopenharmony_ci/*
6922851890Sopenharmony_ci * This structure definition saves the LBT data structure,
7022851890Sopenharmony_ci * the data comes from the task_struct structure, format is as follows:
7122851890Sopenharmony_ci * regs[0]: thread.lbt.scr0
7222851890Sopenharmony_ci * regs[1]: thread.lbt.scr1
7322851890Sopenharmony_ci * regs[2]: thread.lbt.scr2
7422851890Sopenharmony_ci * regs[3]: thread.lbt.scr3
7522851890Sopenharmony_ci * regs[4]: thread.lbt.eflags
7622851890Sopenharmony_ci * regs[5]: thread.fpu.ftop
7722851890Sopenharmony_ci */
7822851890Sopenharmony_cistruct user_lbt_state {
7922851890Sopenharmony_ci	uint64_t regs[6];
8022851890Sopenharmony_ci};
8122851890Sopenharmony_ci
8222851890Sopenharmony_ci/* Read and write watchpoint registers.	 */
8322851890Sopenharmony_ci#define NUM_WATCH_REGS 16
8422851890Sopenharmony_ci
8522851890Sopenharmony_cienum pt_watch_style {
8622851890Sopenharmony_ci	pt_watch_style_la32,
8722851890Sopenharmony_ci	pt_watch_style_la64
8822851890Sopenharmony_ci};
8922851890Sopenharmony_ci
9022851890Sopenharmony_cistruct la32_watch_regs {
9122851890Sopenharmony_ci	uint32_t addr;
9222851890Sopenharmony_ci	uint32_t mask;
9322851890Sopenharmony_ci	/* irw/irwsta/irwmask I R W bits.
9422851890Sopenharmony_ci	 * bit 0 -- 1 if W bit is usable.
9522851890Sopenharmony_ci	 * bit 1 -- 1 if R bit is usable.
9622851890Sopenharmony_ci	 * bit 2 -- 1 if I bit is usable.
9722851890Sopenharmony_ci	 */
9822851890Sopenharmony_ci	uint8_t irw;
9922851890Sopenharmony_ci	uint8_t irwstat;
10022851890Sopenharmony_ci	uint8_t irwmask;
10122851890Sopenharmony_ci} __attribute__((aligned(8)));
10222851890Sopenharmony_ci
10322851890Sopenharmony_cistruct la64_watch_regs {
10422851890Sopenharmony_ci	uint64_t addr;
10522851890Sopenharmony_ci	uint64_t mask;
10622851890Sopenharmony_ci	/* irw/irwsta/irwmask I R W bits.
10722851890Sopenharmony_ci	 * bit 0 -- 1 if W bit is usable.
10822851890Sopenharmony_ci	 * bit 1 -- 1 if R bit is usable.
10922851890Sopenharmony_ci	 * bit 2 -- 1 if I bit is usable.
11022851890Sopenharmony_ci	 */
11122851890Sopenharmony_ci	uint8_t irw;
11222851890Sopenharmony_ci	uint8_t irwstat;
11322851890Sopenharmony_ci	uint8_t irwmask;
11422851890Sopenharmony_ci} __attribute__((aligned(8)));
11522851890Sopenharmony_ci
11622851890Sopenharmony_cistruct pt_watch_regs {
11722851890Sopenharmony_ci	int16_t max_valid;
11822851890Sopenharmony_ci	int16_t num_valid;
11922851890Sopenharmony_ci	enum pt_watch_style style;
12022851890Sopenharmony_ci	union {
12122851890Sopenharmony_ci		struct la32_watch_regs la32[NUM_WATCH_REGS];
12222851890Sopenharmony_ci		struct la64_watch_regs la64[NUM_WATCH_REGS];
12322851890Sopenharmony_ci	};
12422851890Sopenharmony_ci};
12522851890Sopenharmony_ci
12622851890Sopenharmony_ci#define PTRACE_SYSEMU			0x1f
12722851890Sopenharmony_ci#define PTRACE_SYSEMU_SINGLESTEP	0x20
12822851890Sopenharmony_ci#define PTRACE_GET_WATCH_REGS		0xd0
12922851890Sopenharmony_ci#define PTRACE_SET_WATCH_REGS		0xd1
13022851890Sopenharmony_ci
13122851890Sopenharmony_ci/* Watch irw/irwmask/irwstat bit definitions */
13222851890Sopenharmony_ci#define LA_WATCH_W		(1 << 0)
13322851890Sopenharmony_ci#define LA_WATCH_R		(1 << 1)
13422851890Sopenharmony_ci#define LA_WATCH_I		(1 << 2)
13522851890Sopenharmony_ci#define LA_WATCH_IRW	(LA_WATCH_W | LA_WATCH_R | LA_WATCH_I)
13622851890Sopenharmony_ci
13722851890Sopenharmony_ci#endif /* _ASM_PTRACE_H */
138