|
CHERIoT RTOS
A compartmentalised RTOS for CHERIoT hardware
|
Class encapsulating a set of permissions. More...
#include <cheri.hh>
Public Member Functions | |
| constexpr | PermissionSet (Permission p) |
| Constructs a permission set from a single permission. | |
| constexpr | PermissionSet (std::initializer_list< Permission > permissions) |
| Construct a permission set from a list of permissions. | |
| constexpr | PermissionSet (const PermissionSet &other)=default |
| Copy constructor. | |
| constexpr PermissionSet | operator& (PermissionSet p) |
| And-permissions operation, creates a new permission set containing only permissions present in both this set and the argument. | |
| constexpr PermissionSet & | operator&= (PermissionSet p) |
| And-permissions operation, removes all permissions that are not present in both permission sets. | |
| constexpr PermissionSet | without (Permission p) const |
| Constructs a new permission set without the specified permission. | |
| template<std::same_as< Permission >... Permissions> | |
| constexpr PermissionSet | without (Permission p, Permissions... ps) const |
| Constructs a new permission set without the specified permissions. | |
| constexpr bool | can_derive_from (PermissionSet other) const |
| Returns true if, and only if, this permission set can be derived from the argument set. | |
| constexpr bool | contains (Permission permission) const |
| Returns true if this permission set contains the specified permission. | |
| template<std::same_as< Permission >... Permissions> | |
| constexpr bool | contains (Permission p, Permissions... ps) const |
| Returns true if this permission set contains the specified permissions. | |
| constexpr uint32_t | as_raw () const |
| Returns the raw permission mask as an integer containing a bitfield of permissions. | |
| constexpr Iterator | begin () const |
| Returns an iterator over the permissions starting at the lowest-numbered permission. | |
| constexpr Iterator | end () const |
| Returns an end iterator. | |
| constexpr auto | operator<=> (const PermissionSet Other) const |
| Three-way comparison. | |
| constexpr bool | operator== (PermissionSet other) const |
| Equality operator, wraps the three-way compare operator. | |
Static Public Member Functions | |
| static constexpr uint32_t | valid_permissions_mask () |
| Computes (at compile time) a bitmask containing the set of valid permission bits. | |
| static constexpr PermissionSet | from_raw (uint32_t raw) |
| Constructs a permission set from a raw permission mask. | |
| static constexpr PermissionSet | omnipotent () |
| Returns a permission set representing all permissions. | |
Public Attributes | |
| uint32_t | rawPermissions = 0 |
| The raw bitmap of permissions. | |
|
inlineconstexpr |
|
inlineconstexpr |
|
inlinenodiscardconstexpr |
Returns the raw permission mask as an integer containing a bitfield of permissions.
Definition at line 307 of file cheri.hh.
References rawPermissions.
|
inlinenodiscardconstexpr |
Returns an iterator over the permissions starting at the lowest-numbered permission.
Definition at line 316 of file cheri.hh.
References rawPermissions.
|
inlinenodiscardconstexpr |
Returns true if, and only if, this permission set can be derived from the argument set.
Definition at line 277 of file cheri.hh.
References rawPermissions.
Referenced by operator<=>().
|
inlinenodiscardconstexpr |
Returns true if this permission set contains the specified permissions.
Definition at line 297 of file cheri.hh.
References contains().
|
inlinenodiscardconstexpr |
Returns true if this permission set contains the specified permission.
Definition at line 286 of file cheri.hh.
References rawPermissions.
Referenced by contains().
|
inlinenodiscardconstexpr |
|
inlinestaticconstexpr |
Constructs a permission set from a raw permission mask.
Definition at line 195 of file cheri.hh.
References valid_permissions_mask().
|
inlinestaticconstexpr |
Returns a permission set representing all permissions.
Definition at line 231 of file cheri.hh.
References valid_permissions_mask().
Referenced by CHERI::Capability< T, IsSealedT >::without_permissions().
|
inlineconstexpr |
And-permissions operation, creates a new permission set containing only permissions present in both this set and the argument.
Definition at line 240 of file cheri.hh.
References rawPermissions.
|
inlineconstexpr |
And-permissions operation, removes all permissions that are not present in both permission sets.
Definition at line 249 of file cheri.hh.
References rawPermissions.
|
inlineconstexpr |
Three-way comparison.
Treats a superset as greater-than, identical permissions as equivalent, and sets that don't have a superset releationship as unordered.
Definition at line 337 of file cheri.hh.
References can_derive_from(), and rawPermissions.
|
inlineconstexpr |
|
inlinestaticconstexpr |
Computes (at compile time) a bitmask containing the set of valid permission bits.
FIXME would ideally make this private and expose a public static constexpr field but this seems to trigger a compiler bug when trying to initialise said field using this function.
Definition at line 128 of file cheri.hh.
Referenced by from_raw(), and omnipotent().
|
inlinenodiscardconstexpr |
Constructs a new permission set without the specified permission.
Definition at line 258 of file cheri.hh.
References rawPermissions.
Referenced by without(), and CHERI::Capability< T, IsSealedT >::without_permissions().
|
inlinenodiscardconstexpr |
| uint32_t CHERI::PermissionSet::rawPermissions = 0 |
The raw bitmap of permissions.
This is public so that this class meets the requirements of a structural type and can therefore be used as a template parameter. This field should never be directly modified.
Definition at line 190 of file cheri.hh.
Referenced by as_raw(), begin(), can_derive_from(), contains(), operator&(), operator&=(), operator<=>(), and without().