Skip to content

Commit

Permalink
s/Unsafety/Safety/g
Browse files Browse the repository at this point in the history
Looks like when I went looking for examples, I found the wrong example.
  • Loading branch information
kitlith committed Nov 2, 2019
1 parent f104aec commit 0936063
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion kernel/src/i386/structures/idt.rs
Original file line number Diff line number Diff line change
Expand Up @@ -584,7 +584,7 @@ impl<F> IdtEntry<F> {

/// Set a task gate for the IDT entry and sets the present bit.
///
/// # Unsafety
/// # Safety
///
/// `tss_selector` must point to a valid TSS, which will remain present.
/// The TSS' `eip` should point to the handler function.
Expand Down
2 changes: 1 addition & 1 deletion kernel/src/paging/hierarchical_table.rs
Original file line number Diff line number Diff line change
Expand Up @@ -648,7 +648,7 @@ pub trait InactiveHierarchyTrait : TableHierarchy {
/// These frames were marked as occupied when initialising the `FrameAllocator`,
/// we're making them available again.
///
/// # Unsafety
/// # Safety
///
/// Having multiple InactiveHierarchy pointing to the same table hierarchy is unsafe.
/// Should not be used for any other purpose, it is only guaranteed to be safe to drop.
Expand Down
2 changes: 1 addition & 1 deletion kernel/src/process/thread_local_storage.rs
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ impl TLSManager {

/// Mark this TLS as free, so it can be re-used by future spawned thread.
///
/// # Unsafety
/// # Safety
///
/// The TLS will be reassigned, so it must never be used again after calling this function.
///
Expand Down
4 changes: 2 additions & 2 deletions kernel/src/scheduler.rs
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ pub fn get_current_process() -> Arc<ProcessStruct> {
/// The passed function will be executed after setting the CURRENT_THREAD, but before
/// setting it back to the RUNNING state.
///
/// # Unsafety
/// # Safety
///
/// Interrupts must be disabled when calling this function. It will mutably borrow [`CURRENT_THREAD`],
/// so we can't have interrupts on top of that which try to access it while it is borrowed mutably by us,
Expand Down Expand Up @@ -339,7 +339,7 @@ where
/// The passed function should take care to change the protection level, and ensure it cleans up all
/// the registers before calling the EIP, in order to avoid leaking information to userspace.
///
/// # Unsafety:
/// # Safety:
///
/// Interrupts must be off when calling this function. It will set [`CURRENT_THREAD`], and then
/// turn them on, as we are running a new thread, no SpinLockIRQ is held.
Expand Down
6 changes: 3 additions & 3 deletions kernel/src/sync/spin_lock_irq.rs
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ static INTERRUPT_DISABLE_COUNTER: AtomicU8 = AtomicU8::new(0);
///
/// Look at documentation for [INTERRUPT_DISABLE_COUNTER] to know more.
///
/// # Unsafety:
/// # Safety
///
/// Should be called in pairs with [disable_interrupts] or [decrement_lock_count],
/// otherwise the counter will get out of sync and deadlocks will likely occur.
Expand All @@ -44,7 +44,7 @@ pub unsafe fn enable_interrupts() {
/// Used to decrement counter while keeping interrupts disabled before an iret.
/// Look at documentation for [INTERRUPT_DISABLE_COUNTER] to know more.
///
/// # Unsafety:
/// # Safety
///
/// Should be called in pairs with [enable_interrupts],
/// otherwise the counter will get out of sync and deadlocks will likely occur.
Expand All @@ -61,7 +61,7 @@ pub unsafe fn decrement_lock_count() {
///
/// Look at documentation for [INTERRUPT_DISABLE_COUNTER] to know more.
///
/// # Unsafety:
/// # Safety
///
/// Should be called in pairs with [enable_interrupts],
/// otherwise the counter will get out of sync and deadlocks will likely occur.
Expand Down

0 comments on commit 0936063

Please sign in to comment.