From 5384bd14c7dd51b9eea032c9b5c66aa19beccab5 Mon Sep 17 00:00:00 2001 From: Philipp Oppermann Date: Sun, 14 Jan 2024 18:51:56 +0100 Subject: [PATCH 1/2] Update docs to clarify new defaults for `set_handler_fn` --- src/structures/idt.rs | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/src/structures/idt.rs b/src/structures/idt.rs index c2089268..3952ae96 100644 --- a/src/structures/idt.rs +++ b/src/structures/idt.rs @@ -771,10 +771,12 @@ impl Entry { } } - /// Set the handler address for the IDT entry and sets the present bit. - /// - /// For the code selector field, this function uses the code segment selector currently - /// active in the CPU. + /// Sets the handler address for the IDT entry and sets the following defaults: + /// - The code selector is the code segment currently active in the CPU + /// - The present bit is set + /// - Interrupts are disabled on handler invocation + /// - The privilege level (DPL) is [`PrivilegeLevel::Ring0`] + /// - No IST is configured (existing stack will be used) /// /// The function returns a mutable reference to the entry's options that allows /// further customization. @@ -814,10 +816,12 @@ impl Entry { #[cfg(feature = "instructions")] impl Entry { - /// Set the handler function for the IDT entry and sets the present bit. - /// - /// For the code selector field, this function uses the code segment selector currently - /// active in the CPU. + /// Sets the handler function for the IDT entry and sets the following defaults: + /// - The code selector is the code segment currently active in the CPU + /// - The present bit is set + /// - Interrupts are disabled on handler invocation + /// - The privilege level (DPL) is [`PrivilegeLevel::Ring0`] + /// - No IST is configured (existing stack will be used) /// /// The function returns a mutable reference to the entry's options that allows /// further customization. From 0c368ad2b846ee56b7953cf9a9bcbc0870217e88 Mon Sep 17 00:00:00 2001 From: Philipp Oppermann Date: Sun, 14 Jan 2024 18:53:08 +0100 Subject: [PATCH 2/2] List new IDT defaults as breaking change in changelog --- Changelog.md | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/Changelog.md b/Changelog.md index 4d339e42..bb4928eb 100644 --- a/Changelog.md +++ b/Changelog.md @@ -22,6 +22,7 @@ - [Add structures::gdt::Entry type](https://github.com/rust-osdev/x86_64/pull/380) - [Allow GDT to be loaded with shared reference](https://github.com/rust-osdev/x86_64/pull/381) - [seal off the `PageSize` trait](https://github.com/rust-osdev/x86_64/pull/404) +- [idt: Fixup Options structure and cleanup set_handler_fn](https://github.com/rust-osdev/x86_64/pull/226) ## New Features @@ -34,10 +35,6 @@ - [gdt: Check that MAX is in range](https://github.com/rust-osdev/x86_64/pull/365) - [fix `Page::from_page_table_indices`](https://github.com/rust-osdev/x86_64/pull/398) -## Other improvements - -- [idt: Fixup Options structure and cleanup set_handler_fn](https://github.com/rust-osdev/x86_64/pull/226) - # 0.14.11 – 2023-09-15 ## New Features