Skip to content

fix warnings #488

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
May 24, 2024
Merged
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
16 changes: 8 additions & 8 deletions src/registers/model_specific.rs
Original file line number Diff line number Diff line change
@@ -357,11 +357,11 @@ mod x86_64 {
///
/// # Returns
/// - Field 1 (SYSRET): The CS selector is set to this field + 16. SS.Sel is set to
/// this field + 8. Because SYSRET always returns to CPL 3, the
/// RPL bits 1:0 should be initialized to 11b.
/// this field + 8. Because SYSRET always returns to CPL 3, the
/// RPL bits 1:0 should be initialized to 11b.
/// - Field 2 (SYSCALL): This field is copied directly into CS.Sel. SS.Sel is set to
/// this field + 8. Because SYSCALL always switches to CPL 0, the RPL bits
/// 33:32 should be initialized to 00b.
/// this field + 8. Because SYSCALL always switches to CPL 0, the RPL bits
/// 33:32 should be initialized to 00b.
#[inline]
pub fn read_raw() -> (u16, u16) {
let msr_value = unsafe { Self::MSR.read() };
@@ -398,11 +398,11 @@ mod x86_64 {
///
/// # Parameters
/// - sysret: The CS selector is set to this field + 16. SS.Sel is set to
/// this field + 8. Because SYSRET always returns to CPL 3, the
/// RPL bits 1:0 should be initialized to 11b.
/// this field + 8. Because SYSRET always returns to CPL 3, the
/// RPL bits 1:0 should be initialized to 11b.
/// - syscall: This field is copied directly into CS.Sel. SS.Sel is set to
/// this field + 8. Because SYSCALL always switches to CPL 0, the RPL bits
/// 33:32 should be initialized to 00b.
/// this field + 8. Because SYSCALL always switches to CPL 0, the RPL bits
/// 33:32 should be initialized to 00b.
///
/// # Safety
///
12 changes: 5 additions & 7 deletions src/structures/idt.rs
Original file line number Diff line number Diff line change
@@ -153,9 +153,9 @@ pub struct InterruptDescriptorTable {
/// is enabled.
/// - Execution of any legacy SSE instruction when `CR4.OSFXSR` is cleared to 0.
/// - Execution of any SSE instruction (uses `YMM`/`XMM` registers), or 64-bit media
/// instruction (uses `MMXTM` registers) when `CR0.EM` = 1.
/// instruction (uses `MMXTM` registers) when `CR0.EM` = 1.
/// - Execution of any SSE floating-point instruction (uses `YMM`/`XMM` registers) that
/// causes a numeric exception when `CR4.OSXMMEXCPT` = 0.
/// causes a numeric exception when `CR4.OSXMMEXCPT` = 0.
/// - Use of the `DR4` or `DR5` debug registers when `CR4.DE` = 1.
/// - Execution of `RSM` when not in `SMM` mode.
///
@@ -503,7 +503,7 @@ impl InterruptDescriptorTable {
///
/// - `self` is never destroyed.
/// - `self` always stays at the same memory location. It is recommended to wrap it in
/// a `Box`.
/// a `Box`.
///
#[cfg(all(feature = "instructions", target_arch = "x86_64"))]
#[inline]
@@ -1642,7 +1642,7 @@ mod test {

#[test]
fn entry_derive_test() {
fn foo(_: impl Clone + Copy + PartialEq + fmt::Debug) {}
fn foo(_: impl Copy + PartialEq + fmt::Debug) {}

foo(Entry::<HandlerFuncWithErrCode> {
pointer_low: 0,
@@ -1667,9 +1667,7 @@ mod test {
});

unsafe {
frame
.as_mut()
.update(|f| f.instruction_pointer = f.instruction_pointer + 2u64);
frame.as_mut().update(|f| f.instruction_pointer += 2u64);
}
}
}