Skip to content

Commit

Permalink
Merge pull request #29 from AlanStokes/main
Browse files Browse the repository at this point in the history
Mark page tables as Send
  • Loading branch information
qwandor authored Jun 12, 2023
2 parents 346ea66 + 02ed6dd commit c6db6ff
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/paging.rs
Original file line number Diff line number Diff line change
Expand Up @@ -424,6 +424,10 @@ struct PageTableWithLevel<T: Translation> {
_translation: PhantomData<T>,
}

// SAFETY: The underlying PageTable is process-wide and can be safely accessed from any thread
// with appropriate synchronization. This type manages ownership for the raw pointer.
unsafe impl<T: Translation + Send> Send for PageTableWithLevel<T> {}

impl<T: Translation> PageTableWithLevel<T> {
/// Allocates a new, zeroed, appropriately-aligned page table with the given translation,
/// returning both a pointer to it and its physical address.
Expand Down

0 comments on commit c6db6ff

Please sign in to comment.