/* * This file is subject to the terms and conditions of the GNU General Public * License. See the file "COPYING" in the main directory of this archive * for more details. * * Copyright (C) 1994, 95, 96, 97, 98, 99, 2000 by Ralf Baechle * Copyright (C) 1999, 2000 Silicon Graphics, Inc.
*/ #ifndef _ASM_PTRACE_H #define _ASM_PTRACE_H
/* * This struct defines the way the registers are stored on the stack during a * system call/exception. As usual the registers k0/k1 aren't being saved. * * If you add a register here, also add it to regoffset_table[] in * arch/mips/kernel/ptrace.c.
*/ struct pt_regs { #ifdef CONFIG_32BIT /* Saved syscall stack arguments; entries 0-3 unused. */ unsignedlong args[8]; #endif
/* Saved main processor registers. */ unsignedlong regs[32];
/* Query offset/name of register from its name/offset */ externint regs_query_register_offset(constchar *name); #define MAX_REG_OFFSET \
(offsetof(struct pt_regs, __last) - sizeof(unsignedlong))
/** * regs_get_register() - get register value from its offset * @regs: pt_regs from which register value is gotten. * @offset: offset number of the register. * * regs_get_register returns the value of a register. The @offset is the * offset of the register in struct pt_regs address which specified by @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;
/** * regs_within_kernel_stack() - check the address in the stack * @regs: pt_regs which contains kernel stack pointer. * @addr: address which is checked. * * regs_within_kernel_stack() checks @addr is within the kernel stack page(s). * If @addr is within the kernel stack, it returns true. If not, returns false.
*/ staticinlineint regs_within_kernel_stack(struct pt_regs *regs, unsignedlong addr)
{ return ((addr & ~(THREAD_SIZE - 1)) ==
(kernel_stack_pointer(regs) & ~(THREAD_SIZE - 1)));
}
/** * regs_get_kernel_stack_nth() - get Nth entry of the stack * @regs: pt_regs which contains kernel stack pointer. * @n: stack entry number. * * regs_get_kernel_stack_nth() returns @n th entry of the kernel stack which * is specified by @regs. If the @n th entry is NOT in the kernel stack, * this returns 0.
*/ staticinlineunsignedlong regs_get_kernel_stack_nth(struct pt_regs *regs, unsignedint n)
{ unsignedlong *addr = (unsignedlong *)kernel_stack_pointer(regs);
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.