Re: [PATCH v3 1/2] riscv: process: Introduce idle thread using Zawrs extension
From: Andreas Schwab
Date: Wed Sep 25 2024 - 10:48:05 EST
On Sep 25 2024, Andrew Jones wrote:
> On Wed, Sep 25, 2024 at 09:15:46PM GMT, Xu Lu wrote:
>> @@ -148,6 +149,21 @@ static inline void wait_for_interrupt(void)
>> __asm__ __volatile__ ("wfi");
>> }
>>
>> +static inline void wrs_nto(unsigned long *addr)
>> +{
>> + int val;
>> +
>> + __asm__ __volatile__(
>> +#ifdef CONFIG_64BIT
>> + "lr.d %[p], %[v]\n\t"
>> +#else
>> + "lr.w %[p], %[v]\n\t"
>> +#endif
>
> val is always 32-bit since it's an int. We should always use lr.w.
Shouldn't val be unsigned long like the pointer that is being read?
--
Andreas Schwab, SUSE Labs, schwab@xxxxxxx
GPG Key fingerprint = 0196 BAD8 1CE9 1970 F4BE 1748 E4D4 88E3 0EEA B9D7
"And now for something completely different."