16f52b16cSGreg Kroah-Hartman /* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */ 296433f6eSDavid Howells #ifndef _UAPI_ASMAXP_PTRACE_H 396433f6eSDavid Howells #define _UAPI_ASMAXP_PTRACE_H 496433f6eSDavid Howells 596433f6eSDavid Howells 696433f6eSDavid Howells /* 796433f6eSDavid Howells * This struct defines the way the registers are stored on the 896433f6eSDavid Howells * kernel stack during a system call or other kernel entry 996433f6eSDavid Howells * 1096433f6eSDavid Howells * NOTE! I want to minimize the overhead of system calls, so this 11a104d44bSDaniel Bristot de Oliveira * struct has as little information as possible. It does not have 1296433f6eSDavid Howells * 1396433f6eSDavid Howells * - floating point regs: the kernel doesn't change those 1496433f6eSDavid Howells * - r9-15: saved by the C compiler 1596433f6eSDavid Howells * 1696433f6eSDavid Howells * This makes "fork()" and "exec()" a bit more complex, but should 1796433f6eSDavid Howells * give us low system call latency. 1896433f6eSDavid Howells */ 1996433f6eSDavid Howells 2096433f6eSDavid Howells struct pt_regs { 2196433f6eSDavid Howells unsigned long r0; 2296433f6eSDavid Howells unsigned long r1; 2396433f6eSDavid Howells unsigned long r2; 2496433f6eSDavid Howells unsigned long r3; 2596433f6eSDavid Howells unsigned long r4; 2696433f6eSDavid Howells unsigned long r5; 2796433f6eSDavid Howells unsigned long r6; 2896433f6eSDavid Howells unsigned long r7; 2996433f6eSDavid Howells unsigned long r8; 3096433f6eSDavid Howells unsigned long r19; 3196433f6eSDavid Howells unsigned long r20; 3296433f6eSDavid Howells unsigned long r21; 3396433f6eSDavid Howells unsigned long r22; 3496433f6eSDavid Howells unsigned long r23; 3596433f6eSDavid Howells unsigned long r24; 3696433f6eSDavid Howells unsigned long r25; 3796433f6eSDavid Howells unsigned long r26; 3896433f6eSDavid Howells unsigned long r27; 3996433f6eSDavid Howells unsigned long r28; 4096433f6eSDavid Howells unsigned long hae; 4196433f6eSDavid Howells /* JRP - These are the values provided to a0-a2 by PALcode */ 4296433f6eSDavid Howells unsigned long trap_a0; 4396433f6eSDavid Howells unsigned long trap_a1; 4496433f6eSDavid Howells unsigned long trap_a2; 45*147495d0SIvan Kokshaysky /* This makes the stack 16-byte aligned as GCC expects */ 46*147495d0SIvan Kokshaysky unsigned long __pad0; 4796433f6eSDavid Howells /* These are saved by PAL-code: */ 4896433f6eSDavid Howells unsigned long ps; 4996433f6eSDavid Howells unsigned long pc; 5096433f6eSDavid Howells unsigned long gp; 5196433f6eSDavid Howells unsigned long r16; 5296433f6eSDavid Howells unsigned long r17; 5396433f6eSDavid Howells unsigned long r18; 5496433f6eSDavid Howells }; 5596433f6eSDavid Howells 5696433f6eSDavid Howells /* 5796433f6eSDavid Howells * This is the extended stack used by signal handlers and the context 5896433f6eSDavid Howells * switcher: it's pushed after the normal "struct pt_regs". 5996433f6eSDavid Howells */ 6096433f6eSDavid Howells struct switch_stack { 6196433f6eSDavid Howells unsigned long r9; 6296433f6eSDavid Howells unsigned long r10; 6396433f6eSDavid Howells unsigned long r11; 6496433f6eSDavid Howells unsigned long r12; 6596433f6eSDavid Howells unsigned long r13; 6696433f6eSDavid Howells unsigned long r14; 6796433f6eSDavid Howells unsigned long r15; 6896433f6eSDavid Howells unsigned long r26; 6905096666SAl Viro #ifndef __KERNEL__ 7096433f6eSDavid Howells unsigned long fp[32]; /* fp[31] is fpcr */ 7105096666SAl Viro #endif 7296433f6eSDavid Howells }; 7396433f6eSDavid Howells 7496433f6eSDavid Howells 7596433f6eSDavid Howells #endif /* _UAPI_ASMAXP_PTRACE_H */ 76