* Christoph Hellwig wrote:
> > + if (n < NR_REGPARMS) {
> > + switch (n) {
> > + case 0: return regs->ax;
> > + case 1: return regs->dx;
> > + case 2: return regs->cx;
> > + }
>
> Normal kernel style would be
>
> switch (n) {
>
Hi Christoph,
Thank you for review.
Christoph Hellwig wrote:
> You might want to run this past linux-arch to make sure this is suitable
> for other architectures.
Frankly, I'm not sure about linux-arch, could you explain it?
Anyway, I'm interested in that idea.
>> --- a/arch/x86/include/asm/ptr
You might want to run this past linux-arch to make sure this is suitable
for other architectures.
> --- a/arch/x86/include/asm/ptrace.h
> +++ b/arch/x86/include/asm/ptrace.h
> @@ -7,6 +7,7 @@
>
> #ifdef __KERNEL__
> #include
> +#include
> #endif
I really wonder if we should split asm/ptrac
Add following APIs for accessing registers and stack entries from pt_regs.
- query_register_offset(const char *name)
Query the offset of "name" register.
- query_register_name(unsigned offset)
Query the name of register by its offset.
- get_register(struct pt_regs *regs, unsigned offset)