|
CHERIoT RTOS
A compartmentalised RTOS for CHERIoT hardware
|
Information about a field within a Bitpack. More...
#include <bitpack.hh>
Public Member Functions | |
| bool | operator== (const FieldInfo &) const =default |
| constexpr size_t | width () const |
| Return the field width, in bits. | |
| constexpr Storage | maximum_as_unsigned () const |
| Return the maximum value this field can hold, if it is interpreted as holding an unsigned number. | |
Public Attributes | |
| size_t | minIndex |
| Minimum 0-indexed bit position occupied by this field. | |
| size_t | maxIndex |
| Maximum 0-indexed bit position occupied by this field. | |
| bool | isConst = false |
| Should this field be proxied as constant (and so mutation be slightly less ergonomic)? | |
Information about a field within a Bitpack.
Fields are contiguous spans of bits and so have a lowest and highest bit position within the underlying Storage word.
Fields may be marked as constant to dissuade software from attempting to change their value. Do note, though, that any store of an underlying Storage word will also, necessarily, include the bits for constant Fields. It is likely generally more advisable to not mix constant and non-constant fields within the same Storage word or Bitpack.
Definition at line 461 of file bitpack.hh.
|
inlinenodiscardconstexpr |
Return the maximum value this field can hold, if it is interpreted as holding an unsigned number.
Definition at line 485 of file bitpack.hh.
References width().
|
inlinenodiscardconstexpr |
Return the field width, in bits.
Definition at line 476 of file bitpack.hh.
References maxIndex, and minIndex.
Referenced by maximum_as_unsigned().
| bool Bitpack< StorageParam >::FieldInfo::isConst = false |
Should this field be proxied as constant (and so mutation be slightly less ergonomic)?
Definition at line 471 of file bitpack.hh.
| size_t Bitpack< StorageParam >::FieldInfo::maxIndex |
Maximum 0-indexed bit position occupied by this field.
Definition at line 466 of file bitpack.hh.
Referenced by width().
| size_t Bitpack< StorageParam >::FieldInfo::minIndex |
Minimum 0-indexed bit position occupied by this field.
Definition at line 464 of file bitpack.hh.
Referenced by width().