Re: [PATCH v1 1/2] rust: Add cpu_relax() helper

From: FUJITA Tomonori
Date: Thu Aug 14 2025 - 02:14:34 EST


On Mon, 11 Aug 2025 09:39:36 +0000
Alice Ryhl <aliceryhl@xxxxxxxxxx> wrote:

> On Mon, Aug 11, 2025 at 01:10:37PM +0900, FUJITA Tomonori wrote:
>> Add cpu_relax() helper in preparation for supporting
>> read_poll_timeout().
>>
>> Signed-off-by: FUJITA Tomonori <fujita.tomonori@xxxxxxxxx>
>
> Reviewed-by: Alice Ryhl <aliceryhl@xxxxxxxxxx>
>
>> +pub fn cpu_relax() {
>> + // SAFETY: Always safe to call.
>> + unsafe { bindings::cpu_relax() }
>> +}
>
> Let's mark this #[inline].

Thanks, I'll do in the next version.