Re: [PATCH 7/9] rust: time: add arch_timer_get_rate wrapper
From: Andreas Hindborg
Date: Tue Sep 22 2026 - 09:38:02 EST
"Laura Nao" <laura.nao@xxxxxxxxxxxxx> writes:
> From: Deborah Brouwer <deborah.brouwer@xxxxxxxxxxxxx>
>
> Provide a safe Rust wrapper for arch_timer_get_rate().
>
> The Rust binding calls a C helper that returns 0 when the ARM
> architectural timer is not available or not yet initialized. Map this to
> Option<u32> to make the absence of a valid rate explicit to Rust callers.
>
> This allows Rust drivers to query the system timer frequency and
> select appropriate time sources when programming hardware timeouts.
>
> Signed-off-by: Deborah Brouwer <deborah.brouwer@xxxxxxxxxxxxx>
> Signed-off-by: Laura Nao <laura.nao@xxxxxxxxxxxxx>
Reviewed-by: Andreas Hindborg <a.hindborg@xxxxxxxxxx>
Best regards,
Andreas Hindborg