#define PIF_SYSCALL 0 /* inside a system call */ #define PIF_SYSCALL_RET_SET 2 /* return value was set via ptrace */ #define PIF_GUEST_FAULT 3 /* indicates program check in sie64a */ #define PIF_FTRACE_FULL_REGS 4 /* all register contents valid (ftrace) */
/* * The pt_regs struct defines the way the registers are stored on * the stack during a system call.
*/ struct pt_regs { union {
user_pt_regs user_regs; struct { unsignedlong args[1];
psw_t psw; unsignedlong gprs[NUM_GPRS];
};
}; unsignedlong orig_gpr2; union { struct { unsignedint int_code; unsignedint int_parm; unsignedlong int_parm_long;
}; struct tpi_info tpi_info;
}; unsignedlong flags; unsignedlong last_break;
};
/* * Program event recording (PER) register set.
*/ struct per_regs { unsignedlong control; /* PER control bits */ unsignedlong start; /* PER starting address */ unsignedlong end; /* PER ending address */
};
/* * PER event contains information about the cause of the last PER exception.
*/ struct per_event { unsignedshort cause; /* PER code, ATMID and AI */ unsignedlong address; /* PER address */ unsignedchar paid; /* PER access identification */
};
/* * Simplified per_info structure used to decode the ptrace user space ABI.
*/ struct per_struct_kernel { unsignedlong cr9; /* PER control bits */ unsignedlong cr10; /* PER starting address */ unsignedlong cr11; /* PER ending address */ unsignedlong bits; /* Obsolete software bits */ unsignedlong starting_addr; /* User specified start address */ unsignedlong ending_addr; /* User specified end address */ unsignedshort perc_atmid; /* PER trap ATMID */ unsignedlong address; /* PER trap instruction address */ unsignedchar access_id; /* PER trap access identification */
};
/** * 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 specifined by @regs. If the @n th entry is NOT in the kernel stack, * this returns 0.
*/ static __always_inline unsignedlong regs_get_kernel_stack_nth(struct pt_regs *regs, unsignedint n)
{ unsignedlong addr;
addr = kernel_stack_pointer(regs) + n * sizeof(long); if (!regs_within_kernel_stack(regs, addr)) return 0; return READ_ONCE_NOCHECK(*(unsignedlong *)addr);
}
/** * regs_get_kernel_argument() - get Nth function argument in kernel * @regs: pt_regs of that context * @n: function argument number (start from 0) * * regs_get_kernel_argument() returns @n th argument of the function call.
*/ staticinlineunsignedlong regs_get_kernel_argument(struct pt_regs *regs, unsignedint n)
{ unsignedint argoffset = STACK_FRAME_OVERHEAD / sizeof(long);
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.