pub struct PageFlags { /* private fields */ }Expand description
Page protection permissions and access status.
Implementations§
Source§impl PageFlags
impl PageFlags
Sourcepub open spec fn flags_spec(&self) -> Set<__ghostPageFlags>
pub open spec fn flags_spec(&self) -> Set<__ghostPageFlags>
{ Self::flags_from_bits(self.bits()) }Sourcepub open spec fn flags_from_bits(bits: u8) -> Set<__ghostPageFlags>
pub open spec fn flags_from_bits(bits: u8) -> Set<__ghostPageFlags>
{
::vstd::set::Set::<
__ghostPageFlags,
>::from_finite_type(|flag: __ghostPageFlags| {
flag.enabled() && (bits & flag.bit()) == flag.bit()
})
}Sourcepub const exec fn R() -> r : Self
pub const exec fn R() -> r : Self
r.bits() == (0b00000001),r.flags_spec() == Self::flags_from_bits((0b00000001) as u8),returnsSelf::R_spec(),Readable.
Sourcepub const exec fn W() -> r : Self
pub const exec fn W() -> r : Self
r.bits() == (0b00000010),r.flags_spec() == Self::flags_from_bits((0b00000010) as u8),returnsSelf::W_spec(),Writable.
Sourcepub const exec fn X() -> r : Self
pub const exec fn X() -> r : Self
r.bits() == (0b00000100),r.flags_spec() == Self::flags_from_bits((0b00000100) as u8),returnsSelf::X_spec(),Executable.
Sourcepub const exec fn RW() -> r : Self
pub const exec fn RW() -> r : Self
r.bits() == (0b00000011),r.flags_spec() == Self::flags_from_bits((0b00000011) as u8),returnsSelf::RW_spec(),Readable + writable.
Sourcepub const exec fn RX() -> r : Self
pub const exec fn RX() -> r : Self
r.bits() == (0b00000101),r.flags_spec() == Self::flags_from_bits((0b00000101) as u8),returnsSelf::RX_spec(),Readable + executable.
Sourcepub const exec fn RWX() -> r : Self
pub const exec fn RWX() -> r : Self
r.bits() == (0b00000111),r.flags_spec() == Self::flags_from_bits((0b00000111) as u8),returnsSelf::RWX_spec(),Readable + writable + executable.
Sourcepub closed spec fn ACCESSED_spec() -> Self
pub closed spec fn ACCESSED_spec() -> Self
Sourcepub const exec fn ACCESSED() -> r : Self
pub const exec fn ACCESSED() -> r : Self
r.bits() == (0b00001000),r.flags_spec() == Self::flags_from_bits((0b00001000) as u8),returnsSelf::ACCESSED_spec(),Has the memory page been read or written.
Sourcepub closed spec fn DIRTY_spec() -> Self
pub closed spec fn DIRTY_spec() -> Self
Sourcepub const exec fn DIRTY() -> r : Self
pub const exec fn DIRTY() -> r : Self
r.bits() == (0b00010000),r.flags_spec() == Self::flags_from_bits((0b00010000) as u8),returnsSelf::DIRTY_spec(),Has the memory page been written.
Sourcepub closed spec fn AVAIL1_spec() -> Self
pub closed spec fn AVAIL1_spec() -> Self
Sourcepub const exec fn AVAIL1() -> r : Self
pub const exec fn AVAIL1() -> r : Self
r.bits() == (0b01000000),r.flags_spec() == Self::flags_from_bits((0b01000000) as u8),returnsSelf::AVAIL1_spec(),The first bit available for software use.
Sourcepub closed spec fn AVAIL2_spec() -> Self
pub closed spec fn AVAIL2_spec() -> Self
Sourcepub const exec fn AVAIL2() -> r : Self
pub const exec fn AVAIL2() -> r : Self
r.bits() == (0b10000000),r.flags_spec() == Self::flags_from_bits((0b10000000) as u8),returnsSelf::AVAIL2_spec(),The second bit available for software use.
Sourcepub proof fn lemma_all_constant()
pub proof fn lemma_all_constant()
Self::all().bits() == Self::all_spec().bits_spec(),Self::all_spec().bits_spec()
== (0 as u8)
| (if $crate::__bitflags_cfg_expr! {
(#[doc = r" Readable."]) true
} {
((0b00000001) as u8)
} else {
0 as u8
})
| (if $crate::__bitflags_cfg_expr! {
(#[doc = r" Writable."]) true
} {
((0b00000010) as u8)
} else {
0 as u8
})
| (if $crate::__bitflags_cfg_expr! {
(#[doc = r" Executable."]) true
} {
((0b00000100) as u8)
} else {
0 as u8
})
| (if $crate::__bitflags_cfg_expr! {
(#[doc = r" Readable + writable."]) true
} {
((0b00000011) as u8)
} else {
0 as u8
})
| (if $crate::__bitflags_cfg_expr! {
(#[doc = r" Readable + executable."]) true
} {
((0b00000101) as u8)
} else {
0 as u8
})
| (if $crate::__bitflags_cfg_expr! {
(#[doc = r" Readable + writable + executable."]) true
} {
((0b00000111) as u8)
} else {
0 as u8
})
| (if $crate::__bitflags_cfg_expr! {
(#[doc = r" Has the memory page been read or written."]) true
} {
((0b00001000) as u8)
} else {
0 as u8
})
| (if $crate::__bitflags_cfg_expr! {
(#[doc = r" Has the memory page been written."]) true
} {
((0b00010000) as u8)
} else {
0 as u8
})
| (if $crate::__bitflags_cfg_expr! {
(#[doc = r" The first bit available for software use."]) true
} {
((0b01000000) as u8)
} else {
0 as u8
})
| (if $crate::__bitflags_cfg_expr! {
(#[doc = r" The second bit available for software use."]) true
} {
((0b10000000) as u8)
} else {
0 as u8
}),Self::all().bits()
== (0 as u8)
| (if $crate::__bitflags_cfg_expr! {
(#[doc = r" Readable."]) true
} {
((0b00000001) as u8)
} else {
0 as u8
})
| (if $crate::__bitflags_cfg_expr! {
(#[doc = r" Writable."]) true
} {
((0b00000010) as u8)
} else {
0 as u8
})
| (if $crate::__bitflags_cfg_expr! {
(#[doc = r" Executable."]) true
} {
((0b00000100) as u8)
} else {
0 as u8
})
| (if $crate::__bitflags_cfg_expr! {
(#[doc = r" Readable + writable."]) true
} {
((0b00000011) as u8)
} else {
0 as u8
})
| (if $crate::__bitflags_cfg_expr! {
(#[doc = r" Readable + executable."]) true
} {
((0b00000101) as u8)
} else {
0 as u8
})
| (if $crate::__bitflags_cfg_expr! {
(#[doc = r" Readable + writable + executable."]) true
} {
((0b00000111) as u8)
} else {
0 as u8
})
| (if $crate::__bitflags_cfg_expr! {
(#[doc = r" Has the memory page been read or written."]) true
} {
((0b00001000) as u8)
} else {
0 as u8
})
| (if $crate::__bitflags_cfg_expr! {
(#[doc = r" Has the memory page been written."]) true
} {
((0b00010000) as u8)
} else {
0 as u8
})
| (if $crate::__bitflags_cfg_expr! {
(#[doc = r" The first bit available for software use."]) true
} {
((0b01000000) as u8)
} else {
0 as u8
})
| (if $crate::__bitflags_cfg_expr! {
(#[doc = r" The second bit available for software use."]) true
} {
((0b10000000) as u8)
} else {
0 as u8
}),Sourcepub broadcast proof fn lemma_consts()
pub broadcast proof fn lemma_consts()
Self::all().bits()
== (0 as u8)
| (if $crate::__bitflags_cfg_expr! {
(#[doc = r" Readable."]) true
} {
((0b00000001) as u8)
} else {
0 as u8
})
| (if $crate::__bitflags_cfg_expr! {
(#[doc = r" Writable."]) true
} {
((0b00000010) as u8)
} else {
0 as u8
})
| (if $crate::__bitflags_cfg_expr! {
(#[doc = r" Executable."]) true
} {
((0b00000100) as u8)
} else {
0 as u8
})
| (if $crate::__bitflags_cfg_expr! {
(#[doc = r" Readable + writable."]) true
} {
((0b00000011) as u8)
} else {
0 as u8
})
| (if $crate::__bitflags_cfg_expr! {
(#[doc = r" Readable + executable."]) true
} {
((0b00000101) as u8)
} else {
0 as u8
})
| (if $crate::__bitflags_cfg_expr! {
(#[doc = r" Readable + writable + executable."]) true
} {
((0b00000111) as u8)
} else {
0 as u8
})
| (if $crate::__bitflags_cfg_expr! {
(#[doc = r" Has the memory page been read or written."]) true
} {
((0b00001000) as u8)
} else {
0 as u8
})
| (if $crate::__bitflags_cfg_expr! {
(#[doc = r" Has the memory page been written."]) true
} {
((0b00010000) as u8)
} else {
0 as u8
})
| (if $crate::__bitflags_cfg_expr! {
(#[doc = r" The first bit available for software use."]) true
} {
((0b01000000) as u8)
} else {
0 as u8
})
| (if $crate::__bitflags_cfg_expr! {
(#[doc = r" The second bit available for software use."]) true
} {
((0b10000000) as u8)
} else {
0 as u8
}),$crate::__bitflags_cfg_guarded_expr!(
(#[doc = r" Readable."]) Self::R().bits() == ((0b00000001) as u8)
),$crate::__bitflags_cfg_guarded_expr!(
(#[doc = r" Writable."]) Self::W().bits() == ((0b00000010) as u8)
),$crate::__bitflags_cfg_guarded_expr!(
(#[doc = r" Executable."]) Self::X().bits() == ((0b00000100) as u8)
),$crate::__bitflags_cfg_guarded_expr!(
(#[doc = r" Readable + writable."]) Self::RW().bits() == ((0b00000011) as u8)
),$crate::__bitflags_cfg_guarded_expr!(
(#[doc = r" Readable + executable."]) Self::RX().bits() == ((0b00000101) as u8)
),$crate::__bitflags_cfg_guarded_expr!(
(#[doc = r" Readable + writable + executable."]) Self::RWX().bits() == ((0b00000111)
as u8)
),$crate::__bitflags_cfg_guarded_expr!(
(#[doc = r" Has the memory page been read or written."]) Self::ACCESSED().bits() ==
((0b00001000) as u8)
),$crate::__bitflags_cfg_guarded_expr!(
(#[doc = r" Has the memory page been written."]) Self::DIRTY().bits() ==
((0b00010000) as u8)
),$crate::__bitflags_cfg_guarded_expr!(
(#[doc = r" The first bit available for software use."]) Self::AVAIL1().bits() ==
((0b01000000) as u8)
),$crate::__bitflags_cfg_guarded_expr!(
(#[doc = r" The second bit available for software use."]) Self::AVAIL2().bits() ==
((0b10000000) as u8)
),Sourcepub proof fn lemma_from_bits_bits(bits: u8)
pub proof fn lemma_from_bits_bits(bits: u8)
bits & Self::all().bits() == bits,ensuresSelf::from_bits(bits)->0.bits() == bits,Sourcepub proof fn lemma_eq_from_bits(left: Self, right: Self)
pub proof fn lemma_eq_from_bits(left: Self, right: Self)
left.bits() == right.bits(),ensuresleft == right,Sourcepub closed spec fn empty_spec() -> Self
pub closed spec fn empty_spec() -> Self
Sourcepub const exec fn empty() -> r : Self
pub const exec fn empty() -> r : Self
r.bits() == 0,r.flags_spec() == Self::flags_from_bits(0),returnsSelf::empty(),Sourcepub const exec fn all() -> r : Self
pub const exec fn all() -> r : Self
r == Self::all_spec(),r.bits() == Self::all().bits(),r.flags_spec() == Self::flags_from_bits(Self::all().bits()),Sourcepub closed spec fn known_bits_spec(&self) -> u8
pub closed spec fn known_bits_spec(&self) -> u8
The bits in self that correspond to declared flags.
Sourcepub const exec fn known_bits(&self) -> r : u8
pub const exec fn known_bits(&self) -> r : u8
self.known_bits(),Sourcepub closed spec fn unknown_bits_spec(&self) -> u8
pub closed spec fn unknown_bits_spec(&self) -> u8
The bits in self that do not correspond to declared flags.
Sourcepub const exec fn unknown_bits(&self) -> r : u8
pub const exec fn unknown_bits(&self) -> r : u8
self.unknown_bits(),Sourcepub open spec fn contains_unknown_bits_spec(&self) -> bool
pub open spec fn contains_unknown_bits_spec(&self) -> bool
{ self.unknown_bits() != 0 }This method returns true if any unknown bits are set.
Sourcepub const exec fn contains_unknown_bits(&self) -> r : bool
pub const exec fn contains_unknown_bits(&self) -> r : bool
self.contains_unknown_bits(),Sourcepub open spec fn is_empty_spec(&self) -> bool
pub open spec fn is_empty_spec(&self) -> bool
{ self.bits() == 0 }Whether all bits in self are unset.
Sourcepub open spec fn is_all_spec(&self) -> bool
pub open spec fn is_all_spec(&self) -> bool
{ Self::all().bits() | self.bits() == self.bits() }Whether all known bits are set.
Sourcepub open spec fn contains_spec(&self, other: Self) -> bool
pub open spec fn contains_spec(&self, other: Self) -> bool
{ (self.bits() & other.bits()) == other.bits() }Whether all set bits in other are also set in self.
Sourcepub open spec fn contains_flags_spec(&self, other: Self) -> bool
pub open spec fn contains_flags_spec(&self, other: Self) -> bool
{ self.contains(other) }Sourcepub open spec fn intersects_spec(&self, other: Self) -> bool
pub open spec fn intersects_spec(&self, other: Self) -> bool
{ (self.bits() & other.bits()) != 0 }Whether any set bits in other are also set in self.
Sourcepub const exec fn intersects(&self, other: Self) -> r : bool
pub const exec fn intersects(&self, other: Self) -> r : bool
self.intersects(other),Sourcepub closed spec fn from_bits_truncate_spec(bits: u8) -> Self
pub closed spec fn from_bits_truncate_spec(bits: u8) -> Self
Sourcepub closed spec fn from_bits_retain_spec(bits: u8) -> Self
pub closed spec fn from_bits_retain_spec(bits: u8) -> Self
Sourcepub const exec fn from_bits_retain(bits: u8) -> r : Self
pub const exec fn from_bits_retain(bits: u8) -> r : Self
r.bits() == bits,r.flags_spec() == Self::flags_from_bits(bits),returnsSelf::from_bits_retain(bits),Sourcepub exec fn from_name(name: &str) -> r : Option<Self>
pub exec fn from_name(name: &str) -> r : Option<Self>
r matches Some(
flags_value,
) ==> {
&&& flags_value.flags_spec() == Self::flags_from_bits(flags_value.bits())
},Get a flags value with the bits of a flag with the given name set.
This method will return None if name is empty or doesn’t
correspond to any named flag.
Sourcepub const exec fn from_bits_truncate(bits: u8) -> r : Self
pub const exec fn from_bits_truncate(bits: u8) -> r : Self
r.bits() == (bits & Self::all().bits()),r.flags_spec() == Self::flags_from_bits(bits & Self::all().bits()),returnsSelf::from_bits_truncate(bits),Sourcepub closed spec fn from_bits_spec(bits: u8) -> Option<Self>
pub closed spec fn from_bits_spec(bits: u8) -> Option<Self>
Sourcepub const exec fn from_bits(bits: u8) -> r : Option<Self>
pub const exec fn from_bits(bits: u8) -> r : Option<Self>
r is Some == ((bits & Self::all().bits()) == bits),r matches Some(
flags_value,
) ==> {
&&& flags_value.bits() == bits
&&& flags_value.flags_spec() == Self::flags_from_bits(bits)
},returnsSelf::from_bits(bits),Sourcepub closed spec fn remove_spec(self, other: Self) -> Self
pub closed spec fn remove_spec(self, other: Self) -> Self
Sourcepub exec fn insert(&mut self, other: Self)
pub exec fn insert(&mut self, other: Self)
final(self).bits() == (old(self).bits() | other.bits()),final(self).flags_spec() == Self::flags_from_bits(old(self).bits() | other.bits()),Sourcepub exec fn remove(&mut self, other: Self)
pub exec fn remove(&mut self, other: Self)
*final(self) == old(self).remove_spec(other),final(self).bits() == (old(self).bits() & !other.bits()),final(self).flags_spec() == Self::flags_from_bits(old(self).bits() & !other.bits()),Sourcepub exec fn toggle(&mut self, other: Self)
pub exec fn toggle(&mut self, other: Self)
final(self).bits() == (old(self).bits() ^ other.bits()),final(self).flags_spec() == Self::flags_from_bits(old(self).bits() ^ other.bits()),The bitwise exclusive-or (^) of the bits in self and other.
Sourcepub exec fn set(&mut self, other: Self, value: bool)
pub exec fn set(&mut self, other: Self, value: bool)
value ==> final(self).bits() == (old(self).bits() | other.bits()),!value ==> final(self).bits() == (old(self).bits() & !other.bits()),Call insert when value is true or remove when value is false.
Sourcepub exec fn truncate(&mut self)
pub exec fn truncate(&mut self)
final(self).bits() == (old(self).bits() & Self::all().bits()),final(self).flags_spec() == Self::flags_from_bits(old(self).bits() & Self::all().bits()),Remove any unknown bits from the flags.
Sourcepub exec fn clear(&mut self)
pub exec fn clear(&mut self)
final(self).bits() == 0,final(self).flags_spec() == Self::flags_from_bits(0),Unsets all bits in the flags.
Sourcepub closed spec fn union_spec(self, other: Self) -> Self
pub closed spec fn union_spec(self, other: Self) -> Self
Sourcepub const exec fn union(self, other: Self) -> r : Self
pub const exec fn union(self, other: Self) -> r : Self
r.bits() == (self.bits() | other.bits()),returnsself.union(other),Sourcepub closed spec fn intersection_spec(self, other: Self) -> Self
pub closed spec fn intersection_spec(self, other: Self) -> Self
Sourcepub const exec fn intersection(self, other: Self) -> r : Self
pub const exec fn intersection(self, other: Self) -> r : Self
r.bits() == (self.bits() & other.bits()),returnsself.intersection(other),Sourcepub closed spec fn difference_spec(self, other: Self) -> Self
pub closed spec fn difference_spec(self, other: Self) -> Self
Sourcepub const exec fn difference(self, other: Self) -> r : Self
pub const exec fn difference(self, other: Self) -> r : Self
r.bits() == (self.bits() & !other.bits()),returnsself.difference(other),Sourcepub closed spec fn symmetric_difference_spec(self, other: Self) -> Self
pub closed spec fn symmetric_difference_spec(self, other: Self) -> Self
Sourcepub const exec fn symmetric_difference(self, other: Self) -> r : Self
pub const exec fn symmetric_difference(self, other: Self) -> r : Self
r.bits() == (self.bits() ^ other.bits()),returnsself.symmetric_difference(other),Sourcepub closed spec fn complement_spec(self) -> Self
pub closed spec fn complement_spec(self) -> Self
Sourcepub const exec fn complement(self) -> r : Self
pub const exec fn complement(self) -> r : Self
r.bits() == (!self.bits() & Self::all().bits()),r.flags_spec() == Self::flags_from_bits(!self.bits() & Self::all().bits()),returnsself.complement(),Trait Implementations§
Source§impl BitAndAssign for PageFlags
impl BitAndAssign for PageFlags
Source§fn bitand_assign(&mut self, other: Self)
fn bitand_assign(&mut self, other: Self)
&= operation. Read moreSource§impl BitAndSpecImpl for PageFlags
impl BitAndSpecImpl for PageFlags
Source§open spec fn obeys_bitand_spec() -> bool
open spec fn obeys_bitand_spec() -> bool
{ true }Source§open spec fn bitand_req(self, rhs: Self) -> bool
open spec fn bitand_req(self, rhs: Self) -> bool
{ true }Source§open spec fn bitand_spec(self, rhs: Self) -> Self::Output
open spec fn bitand_spec(self, rhs: Self) -> Self::Output
{ self.intersection(rhs) }Source§impl BitOrAssign for PageFlags
impl BitOrAssign for PageFlags
Source§fn bitor_assign(&mut self, other: Self)
fn bitor_assign(&mut self, other: Self)
|= operation. Read moreSource§impl BitXorAssign for PageFlags
impl BitXorAssign for PageFlags
Source§fn bitxor_assign(&mut self, other: Self)
fn bitxor_assign(&mut self, other: Self)
^= operation. Read moreSource§impl BitXorSpecImpl for PageFlags
impl BitXorSpecImpl for PageFlags
Source§open spec fn obeys_bitxor_spec() -> bool
open spec fn obeys_bitxor_spec() -> bool
{ true }Source§open spec fn bitxor_req(self, rhs: Self) -> bool
open spec fn bitxor_req(self, rhs: Self) -> bool
{ true }Source§open spec fn bitxor_spec(self, rhs: Self) -> Self::Output
open spec fn bitxor_spec(self, rhs: Self) -> Self::Output
{ self.symmetric_difference(rhs) }Source§impl SubAssign for PageFlags
impl SubAssign for PageFlags
Source§fn sub_assign(&mut self, other: Self)
fn sub_assign(&mut self, other: Self)
-= operation. Read more