[PATCH 1/3] riscv: ptrace: add regs_set_register()
Ben Dooks
ben.dooks at codethink.co.uk
Wed Nov 13 02:19:50 PST 2024
On 13/11/2024 10:12, Andrew Jones wrote:
> On Wed, Nov 13, 2024 at 09:17:01AM +0000, Ben Dooks wrote:
>> Since we have regs_get_register() and we could use the set counterpart
>> for things like fixing up traps, add regs_set_register() to set a pt_regs
>> value from offset.
>>
>> Signed-off-by: Ben Dooks <ben.dooks at codethink.co.uk>
>> ---
>> arch/riscv/include/asm/ptrace.h | 20 ++++++++++++++++++++
>> 1 file changed, 20 insertions(+)
>>
>> diff --git a/arch/riscv/include/asm/ptrace.h b/arch/riscv/include/asm/ptrace.h
>> index b5b0adcc85c1..66fc1795141d 100644
>> --- a/arch/riscv/include/asm/ptrace.h
>> +++ b/arch/riscv/include/asm/ptrace.h
>> @@ -143,6 +143,26 @@ static inline unsigned long regs_get_register(struct pt_regs *regs,
>> return *(unsigned long *)((unsigned long)regs + offset);
>> }
>>
>> +/**
>> + * regs_set_register() - set register value from its offset
>
> s/from/at/
>
>> + * @regs: pt_regs from which register value is gotten
>
> s/gotten/set/
>
>> + * @offset: offset of the register.
>> + * @to: value to set register to
>
> Can we name this 'value' instead of 'to'?
Thank you, I think these are all good comments.
--
Ben Dooks http://www.codethink.co.uk/
Senior Engineer Codethink - Providing Genius
https://www.codethink.co.uk/privacy.html
More information about the linux-riscv
mailing list