/* SPDX-License-Identifier: GPL-2.0-or-later */ /* * OpenRISC Linux * * Linux architectural port borrowing liberally from similar works of * others. All original copyrights apply as per the original source * declaration. * * OpenRISC implementation: * Copyright (C) 2003 Matjaz Breskvar <phoenix@bsemi.com> * Copyright (C) 2010-2011 Jonas Bonn <jonas@southpole.se> * et al.
*/ #ifndef __ASM_OPENRISC_PTRACE_H #define __ASM_OPENRISC_PTRACE_H
/* * Make kernel PTrace/register structures opaque to userspace... userspace can * access thread state via the regset mechanism. This allows us a bit of * flexibility in how we order the registers on the stack, permitting some * optimizations like packing call-clobbered registers together so that * they share a cacheline (not done yet, though... future optimization).
*/
#ifndef __ASSEMBLER__ /* * This struct describes how the registers are laid out on the kernel stack * during a syscall or other kernel entry. * * This structure should always be cacheline aligned on the stack. * FIXME: I don't think that's the case right now. The alignment is * taken care of elsewhere... head.S, process.c, etc.
*/
struct pt_regs { union { struct { /* Named registers */ long sr; /* Stored in place of r0 */ long sp; /* r1 */ long gpr2; long gpr3; long gpr4; long gpr5; long gpr6; long gpr7; long gpr8; long gpr9; long gpr10; long gpr11; long gpr12; long gpr13; long gpr14; long gpr15; long gpr16; long gpr17; long gpr18; long gpr19; long gpr20; long gpr21; long gpr22; long gpr23; long gpr24; long gpr25; long gpr26; long gpr27; long gpr28; long gpr29; long gpr30; long gpr31;
}; struct { /* Old style */ long offset[2]; long gprs[30];
}; struct { /* New style */ long gpr[32];
};
}; long pc; /* For restarting system calls: * Set to syscall number for syscall exceptions, * -1 for all other exceptions.
*/ long orig_gpr11; /* For restarting system calls */ long dummy; /* Cheap alignment fix */ long dummy2; /* Cheap alignment fix */
};
/* TODO: Rename this to REDZONE because that's what it is */ #define STACK_FRAME_OVERHEAD 128 /* size of minimum stack frame */
/** * regs_get_register() - get register value from its offset * @regs: pt_regs from which register value is gotten * @offset: offset of the register. * * regs_get_register returns the value of a register whose offset from @regs. * The @offset is the offset of the register in struct pt_regs. * If @offset is bigger than MAX_REG_OFFSET, this returns 0.
*/ staticinlineunsignedlong regs_get_register(struct pt_regs *regs, unsignedint offset)
{ if (unlikely(offset > MAX_REG_OFFSET)) return 0;
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.