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§
Sourcefn reservation(&self) -> Option<Reg::Type>
fn reservation(&self) -> Option<Reg::Type>
Returns the address of the currently held reservation, if any
Sourcefn set_reservation(&mut self, address: Reg::Type)
fn set_reservation(&mut self, address: Reg::Type)
Place a reservation on address, replacing any previously held reservation
Sourcefn clear_reservation(&mut self)
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".