Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,16 @@
# Changelog

## Unreleased

### Bugfixes

- Fixed value of `El23Attributes::XN`.

### Improvements

- Added `NT` and `CONTIGUOUS_OR_PROTECTED` bits to `El1Attributes` and `El23Attributes`.
- Added `El23Attributes::USER_RES1`.

## 0.12.0

### Breaking changes
Expand Down
7 changes: 6 additions & 1 deletion src/descriptor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -152,9 +152,11 @@
const READ_ONLY = 1 << 7;
const ACCESSED = 1 << 10;
const NON_GLOBAL = 1 << 11;
const NT = 1 << 16;
/// Guarded Page - indirect forward edge jumps expect an appropriate BTI landing pad.
const GP = 1 << 50;
const DBM = 1 << 51;
const CONTIGUOUS_OR_PROTECTED = 1 << 52;
/// Privileged Execute-never.
const PXN = 1 << 53;
/// Unprivileged Execute-never.
Expand Down Expand Up @@ -224,14 +226,17 @@
const INNER_SHAREABLE = 3 << 8;

const NS = 1 << 5;
const USER_RES1 = 1 << 6;
const READ_ONLY = 1 << 7;
const ACCESSED = 1 << 10;
const NON_GLOBAL = 1 << 11;
const NT = 1 << 16;
/// Guarded Page - indirect forward edge jumps expect an appropriate BTI landing pad.
const GP = 1 << 50;
const DBM = 1 << 51;
const CONTIGUOUS_OR_PROTECTED = 1 << 52;
/// Execute-never.
const XN = 1 << 53;
const XN = 1 << 54;

// Software flags in block and page descriptor entries.
const SWFLAG_0 = 1 << 55;
Expand Down Expand Up @@ -353,7 +358,7 @@

impl<A: PagingAttributes> Descriptor<A> {
/// An empty (i.e. 0) descriptor.
pub const EMPTY: Self = Self::new(0);

Check warning on line 361 in src/descriptor.rs

View workflow job for this annotation

GitHub Actions / clippy

named constant with interior mutability

warning: named constant with interior mutability --> src/descriptor.rs:361:15 | 361 | pub const EMPTY: Self = Self::new(0); | ^^^^^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.94.0/index.html#declare_interior_mutable_const = note: `#[warn(clippy::declare_interior_mutable_const)]` on by default

const PHYSICAL_ADDRESS_BITMASK: usize = !(PAGE_SIZE - 1) & !(0xffff << 48);

Expand Down Expand Up @@ -501,7 +506,7 @@

/// Assigns the underlying descriptor according to `pa` and `flags, provided that doing so is
/// permitted under BBM rules
pub fn set(&mut self, pa: PhysicalAddress, flags: A) -> Result<(), ()> {

Check warning on line 509 in src/descriptor.rs

View workflow job for this annotation

GitHub Actions / clippy

this returns a `Result<_, ()>`

warning: this returns a `Result<_, ()>` --> src/descriptor.rs:509:5 | 509 | pub fn set(&mut self, pa: PhysicalAddress, flags: A) -> Result<(), ()> { | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | = help: use a custom `Error` type instead = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.94.0/index.html#result_unit_err = note: `#[warn(clippy::result_unit_err)]` on by default
if !self.bbm_permits_update(pa, flags) {
return Err(());
}
Expand Down Expand Up @@ -556,7 +561,7 @@
}

/// Modifies the descriptor by setting or clearing its flags.
pub fn modify_flags(&mut self, set: A, clear: A) -> Result<(), ()> {

Check warning on line 564 in src/descriptor.rs

View workflow job for this annotation

GitHub Actions / clippy

this returns a `Result<_, ()>`

warning: this returns a `Result<_, ()>` --> src/descriptor.rs:564:5 | 564 | pub fn modify_flags(&mut self, set: A, clear: A) -> Result<(), ()> { | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | = help: use a custom `Error` type instead = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.94.0/index.html#result_unit_err
let oldval = self.flags();
let flags = (oldval | set) & !clear;

Expand Down
Loading