Skip to main content

ReservationSet

Trait ReservationSet 

Source
pub trait ReservationSet<Reg>
where Reg: Register,
{ // Required methods fn reservation(&self) -> Option<Reg::Type>; fn set_reservation(&mut self, address: Reg::Type); fn clear_reservation(&mut self); }
Expand description

Reservation set used to implement Zalrsc extension’s lr/sc instruction pairs.

lr places a reservation on an address, and a subsequent sc succeeds only if the reservation is still held for the same address. Regardless of success or failure, executing sc always invalidates the reservation, as does a subsequent lr.

Required Methods§

Source

fn reservation(&self) -> Option<Reg::Type>

Returns the address of the currently held reservation, if any

Source

fn set_reservation(&mut self, address: Reg::Type)

Place a reservation on address, replacing any previously held reservation

Source

fn clear_reservation(&mut self)

Clear any currently held reservation

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§