#include <linux/ptrace.h>/** * regs_query_register_offset() - query register offset from its name * @name: the name of a register * * regs_query_register_offset() returns the offset of a register in struct * pt_regs from its name. If the name is invalid, this returns -EINVAL; */intregs_query_register_offset(constchar*name){conststructpt_regs_offset*roff;for(roff=regoffset_table;roff->name!=NULL;roff++)if(!strcmp(roff->name,name))returnroff->offset;return-EINVAL;}/** * regs_query_register_name() - query register name from its offset * @offset: the offset of a register in struct pt_regs. * * regs_query_register_name() returns the name of a register from its * offset in struct pt_regs. If the @offset is invalid, this returns NULL; */constchar*regs_query_register_name(unsignedintoffset){conststructpt_regs_offset*roff;for(roff=regoffset_table;roff->name!=NULL;roff++)if(roff->offset==offset)returnroff->name;returnNULL;}