Skip to content

Commit 1f5fe2b

Browse files
Apply suggestions from code review
Mostly comment changes Co-authored-by: Brad Campbell <bradjc5@gmail.com>
1 parent 70b8125 commit 1f5fe2b

File tree

4 files changed

+10
-8
lines changed

4 files changed

+10
-8
lines changed

kernel/src/platform/mpu.rs

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -125,9 +125,10 @@ pub trait MPU {
125125
fn enable_app_mpu(&self);
126126

127127
/// Notify the MPU there is a new process.
128+
///
128129
/// We do NOT provide the config argument here
129130
/// as doing so blocks the MPU from allocating
130-
/// in the grant region for the pprocess.
131+
/// in the grant region for the process.
131132
fn new_process(&self, _app_id: ProcessId) {}
132133

133134
/// Disables the MPU for userspace apps.
@@ -214,8 +215,11 @@ pub trait MPU {
214215
Ok(RemoveRegionResult::Sync)
215216
}
216217

217-
/// Actually revoke regions previously requested with remove_memory_region
218-
/// Safety: no LiveARef or LivePRef may exist to any memory that might be revoked,
218+
/// Actually revoke regions previously requested with remove_memory_region.
219+
///
220+
/// ### Safety
221+
///
222+
/// No LiveARef or LivePRef may exist to any memory that might be revoked,
219223
/// Nor may any grants be entered via the legacy mechanism if allowed memory might be revoked.
220224
#[allow(unused_variables)]
221225
unsafe fn revoke_regions(

kernel/src/process.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -703,7 +703,9 @@ pub trait Process {
703703

704704
/// Actually revoke regions previously requested with remove_memory_region.
705705
///
706-
/// Safety: no grants for this process can be entered/open when this is called. I.e. this
706+
/// ### Safety
707+
///
708+
/// No grants for this process can be entered/open when this is called. I.e. this
707709
/// should never be called downstream from a capsule.
708710
unsafe fn revoke_regions(&self) -> Result<(), ErrorCode>;
709711

kernel/src/process_standard.rs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -860,9 +860,6 @@ impl<C: Chip, D: 'static + ProcessStandardDebug> Process for ProcessStandard<'_,
860860
})
861861
}
862862

863-
/// Actually revoke regions previously requested with remove_memory_region
864-
/// Safety: no LiveARef or LivePRef may exist to any memory that might be revoked,
865-
/// Nor may any grants be entered via the legacy mechanism if allowed memory might be revoked.
866863
unsafe fn revoke_regions(&self) -> Result<(), ErrorCode> {
867864
self.mpu_config.map_or(Err(ErrorCode::INVAL), |config| {
868865
let result = unsafe { self.chip.mpu().revoke_regions(config, self) };

kernel/src/utilities/capability_ptr.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -203,7 +203,6 @@ impl CapabilityPtr {
203203
/// serve as the only memory isolation primitive in the system, this method
204204
/// can thus break Tock's isolation model. As semi-trusted kernel code can
205205
/// name this type and method, it is thus marked as `unsafe`.
206-
///
207206
#[inline]
208207
pub unsafe fn new_with_authority(
209208
ptr: *const (),

0 commit comments

Comments
 (0)