@@ -33,8 +33,7 @@ use volatile::Volatile;
33
33
/// The field descriptions are taken from the
34
34
/// [AMD64 manual volume 2](https://support.amd.com/TechDocs/24593.pdf)
35
35
/// (with slight modifications).
36
- #[ allow( missing_debug_implementations) ]
37
- #[ derive( Clone ) ]
36
+ #[ derive( Clone , Debug ) ]
38
37
#[ repr( C ) ]
39
38
#[ repr( align( 16 ) ) ]
40
39
pub struct InterruptDescriptorTable {
@@ -575,12 +574,9 @@ pub struct Entry<F> {
575
574
impl < T > fmt:: Debug for Entry < T > {
576
575
fn fmt ( & self , f : & mut fmt:: Formatter < ' _ > ) -> fmt:: Result {
577
576
f. debug_struct ( "Entry" )
578
- . field ( "pointer_low " , & self . pointer_low )
577
+ . field ( "handler_addr " , & format_args ! ( "{:#x}" , self . handler_addr ( ) ) )
579
578
. field ( "gdt_selector" , & self . gdt_selector )
580
579
. field ( "options" , & self . options )
581
- . field ( "pointer_middle" , & self . pointer_middle )
582
- . field ( "pointer_high" , & self . pointer_high )
583
- . field ( "reserved" , & self . reserved )
584
580
. finish ( )
585
581
}
586
582
}
@@ -645,6 +641,13 @@ impl<F> Entry<F> {
645
641
self . options . set_present ( true ) ;
646
642
& mut self . options
647
643
}
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
+ }
648
651
}
649
652
650
653
macro_rules! impl_set_handler_fn {
@@ -674,9 +677,17 @@ impl_set_handler_fn!(DivergingHandlerFuncWithErrCode);
674
677
675
678
/// Represents the options field of an IDT entry.
676
679
#[ repr( transparent) ]
677
- #[ derive( Debug , Clone , Copy , PartialEq ) ]
680
+ #[ derive( Clone , Copy , PartialEq ) ]
678
681
pub struct EntryOptions ( u16 ) ;
679
682
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
+
680
691
impl EntryOptions {
681
692
/// Creates a minimal options field with all the must-be-one bits set.
682
693
#[ inline]
@@ -757,7 +768,6 @@ impl InterruptStackFrame {
757
768
///
758
769
/// Also, it is not fully clear yet whether modifications of the interrupt stack frame are
759
770
/// officially supported by LLVM's x86 interrupt calling convention.
760
- #[ allow( clippy:: should_implement_trait) ]
761
771
#[ inline]
762
772
pub unsafe fn as_mut ( & mut self ) -> Volatile < & mut InterruptStackFrameValue > {
763
773
Volatile :: new ( & mut self . value )
0 commit comments