@@ -33,8 +33,7 @@ use volatile::Volatile;
3333/// The field descriptions are taken from the
3434/// [AMD64 manual volume 2](https://support.amd.com/TechDocs/24593.pdf)
3535/// (with slight modifications).
36- #[ allow( missing_debug_implementations) ]
37- #[ derive( Clone ) ]
36+ #[ derive( Clone , Debug ) ]
3837#[ repr( C ) ]
3938#[ repr( align( 16 ) ) ]
4039pub struct InterruptDescriptorTable {
@@ -575,12 +574,9 @@ pub struct Entry<F> {
575574impl < T > fmt:: Debug for Entry < T > {
576575 fn fmt ( & self , f : & mut fmt:: Formatter < ' _ > ) -> fmt:: Result {
577576 f. debug_struct ( "Entry" )
578- . field ( "pointer_low " , & self . pointer_low )
577+ . field ( "handler_addr " , & format_args ! ( "{:#x}" , self . handler_addr ( ) ) )
579578 . field ( "gdt_selector" , & self . gdt_selector )
580579 . field ( "options" , & self . options )
581- . field ( "pointer_middle" , & self . pointer_middle )
582- . field ( "pointer_high" , & self . pointer_high )
583- . field ( "reserved" , & self . reserved )
584580 . finish ( )
585581 }
586582}
@@ -645,6 +641,13 @@ impl<F> Entry<F> {
645641 self . options . set_present ( true ) ;
646642 & mut self . options
647643 }
644+
645+ #[ inline]
646+ fn handler_addr ( & self ) -> u64 {
647+ self . pointer_low as u64
648+ | ( self . pointer_middle as u64 ) << 16
649+ | ( self . pointer_high as u64 ) << 32
650+ }
648651}
649652
650653macro_rules! impl_set_handler_fn {
@@ -674,9 +677,17 @@ impl_set_handler_fn!(DivergingHandlerFuncWithErrCode);
674677
675678/// Represents the options field of an IDT entry.
676679#[ repr( transparent) ]
677- #[ derive( Debug , Clone , Copy , PartialEq ) ]
680+ #[ derive( Clone , Copy , PartialEq ) ]
678681pub struct EntryOptions ( u16 ) ;
679682
683+ impl fmt:: Debug for EntryOptions {
684+ fn fmt ( & self , f : & mut fmt:: Formatter ) -> fmt:: Result {
685+ f. debug_tuple ( "EntryOptions" )
686+ . field ( & format_args ! ( "{:#06x}" , self . 0 ) )
687+ . finish ( )
688+ }
689+ }
690+
680691impl EntryOptions {
681692 /// Creates a minimal options field with all the must-be-one bits set.
682693 #[ inline]
@@ -757,7 +768,6 @@ impl InterruptStackFrame {
757768 ///
758769 /// Also, it is not fully clear yet whether modifications of the interrupt stack frame are
759770 /// officially supported by LLVM's x86 interrupt calling convention.
760- #[ allow( clippy:: should_implement_trait) ]
761771 #[ inline]
762772 pub unsafe fn as_mut ( & mut self ) -> Volatile < & mut InterruptStackFrameValue > {
763773 Volatile :: new ( & mut self . value )
0 commit comments