public inbox for linux-riscv@lists.infradead.org
 help / color / mirror / Atom feed
From: Ben Dooks <ben.dooks@codethink.co.uk>
To: Andrew Jones <ajones@ventanamicro.com>
Cc: linux-riscv@lists.infradead.org, palmer@dabbelt.com, alex@ghiti.fr
Subject: Re: [PATCH 1/3] riscv: ptrace: add regs_set_register()
Date: Wed, 13 Nov 2024 10:19:50 +0000	[thread overview]
Message-ID: <7278cda9-740b-4bf7-b6da-dd760121e31f@codethink.co.uk> (raw)
In-Reply-To: <20241113-58aebadd1b4916382031abaa@orel>

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@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

_______________________________________________
linux-riscv mailing list
linux-riscv@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-riscv

  reply	other threads:[~2024-11-13 10:31 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-11-13  9:17 updates for instruction trapping and ptrace Ben Dooks
2024-11-13  9:17 ` [PATCH 1/3] riscv: ptrace: add regs_set_register() Ben Dooks
2024-11-13 10:12   ` Andrew Jones
2024-11-13 10:19     ` Ben Dooks [this message]
2024-11-13  9:17 ` [PATCH 2/3] riscv: traps: make insn fetch common in unknown instruction Ben Dooks
2024-11-13  9:21   ` Ben Dooks
2024-11-13  9:31     ` Ben Dooks
2024-11-13  9:17 ` [PATCH 3/3] riscv: insn: add RV_EXTRACT_FUNCT3() Ben Dooks
2024-11-13 10:17   ` Andrew Jones
2024-11-13 10:35     ` Ben Dooks
  -- strict thread matches above, loose matches on Subject: below --
2024-09-17 13:08 RFC: extern illegal instruction trap and trap RDCYCLE Ben Dooks
2024-09-17 13:08 ` [PATCH 1/3] riscv: ptrace: add regs_set_register() Ben Dooks

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=7278cda9-740b-4bf7-b6da-dd760121e31f@codethink.co.uk \
    --to=ben.dooks@codethink.co.uk \
    --cc=ajones@ventanamicro.com \
    --cc=alex@ghiti.fr \
    --cc=linux-riscv@lists.infradead.org \
    --cc=palmer@dabbelt.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox