1 // SPDX-License-Identifier: GPL-2.0
2 #include <linux/ptrace.h>
5 * regs_query_register_offset() - query register offset from its name
6 * @name: the name of a register
8 * regs_query_register_offset() returns the offset of a register in struct
9 * pt_regs from its name. If the name is invalid, this returns -EINVAL;
11 int regs_query_register_offset(const char *name
)
13 const struct pt_regs_offset
*roff
;
14 for (roff
= regoffset_table
; roff
->name
!= NULL
; roff
++)
15 if (!strcmp(roff
->name
, name
))
21 * regs_query_register_name() - query register name from its offset
22 * @offset: the offset of a register in struct pt_regs.
24 * regs_query_register_name() returns the name of a register from its
25 * offset in struct pt_regs. If the @offset is invalid, this returns NULL;
27 const char *regs_query_register_name(unsigned int offset
)
29 const struct pt_regs_offset
*roff
;
30 for (roff
= regoffset_table
; roff
->name
!= NULL
; roff
++)
31 if (roff
->offset
== offset
)