Skip to content

Commit

Permalink
Apply comment suggestions
Browse files Browse the repository at this point in the history
Co-authored-by: Amit Levy <[email protected]>
  • Loading branch information
LawrenceEsswood and alevy authored Oct 21, 2024
1 parent fd51098 commit c97deea
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions kernel/src/metaptr.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,18 +12,18 @@ use core::ops::AddAssign;
/// This should be used any time the kernel wishes to grant authority to the user, or any time
/// the user should be required to prove validity of a pointer.
///
/// Values that are just raw addresses but imply nothing about a rust object at that location
/// Values that are just raw addresses but imply nothing about a Rust object at that location
/// should be `usize`.
/// Values that are references, but do not cross the boundary between the user and the
/// kernel (or do cross the boundary but are merely informative and do not imply any rights)
/// can be `*const T` (or `&T` if the kernel knows they are valid).
/// Values that are references, and do need to cross the boundary, should be this type.
///
/// For example, allow is meant to grant authority to the kernel to access a buffer, so is `MetaPtr`.
/// When the user tells the kernel the location of its stack (for debug diagnostics) it need not
/// be `MetaPtr` as the kernel is not making any access.
/// For example, `allow` grants authority to the kernel to access a buffer, so passes [MetaPtr]s.
/// Conversely, when a process communicates its stack location to the kernel it need not be
/// passed as a [MetaPtr], as the kernel does not access it.
///
/// `MetaPtr` is also assumed to be wide enough that it could contain a raw pointer (`*const ()`) or
/// [MetaPtr] is also assumed to be wide enough that it could contain a raw pointer (`*const ()`) or
/// A `usize`, possibly podding with extra bits. It is therefore an appropriate choice for the type
/// of a register that may contain any one of these in the syscall ABI at a point where it is not
/// yet clear which of these it is yet.
Expand Down

0 comments on commit c97deea

Please sign in to comment.