@@ -712,52 +712,82 @@ impl<T> PartialEq for Entry<T> {
712
712
/// A handler function for an interrupt or an exception without error code.
713
713
///
714
714
/// This type alias is only usable with the `abi_x86_interrupt` feature enabled.
715
- #[ cfg( feature = "abi_x86_interrupt" ) ]
715
+ #[ cfg( all(
716
+ any( target_arch = "x86" , target_arch = "x86_64" ) ,
717
+ feature = "abi_x86_interrupt"
718
+ ) ) ]
716
719
pub type HandlerFunc = extern "x86-interrupt" fn ( InterruptStackFrame ) ;
717
720
/// This type is not usable without the `abi_x86_interrupt` feature.
718
- #[ cfg( not( feature = "abi_x86_interrupt" ) ) ]
721
+ #[ cfg( not( all(
722
+ any( target_arch = "x86" , target_arch = "x86_64" ) ,
723
+ feature = "abi_x86_interrupt"
724
+ ) ) ) ]
719
725
#[ derive( Copy , Clone , Debug ) ]
720
726
pub struct HandlerFunc ( ( ) ) ;
721
727
722
728
/// A handler function for an exception that pushes an error code.
723
729
///
724
730
/// This type alias is only usable with the `abi_x86_interrupt` feature enabled.
725
- #[ cfg( feature = "abi_x86_interrupt" ) ]
731
+ #[ cfg( all(
732
+ any( target_arch = "x86" , target_arch = "x86_64" ) ,
733
+ feature = "abi_x86_interrupt"
734
+ ) ) ]
726
735
pub type HandlerFuncWithErrCode = extern "x86-interrupt" fn ( InterruptStackFrame , error_code : u64 ) ;
727
736
/// This type is not usable without the `abi_x86_interrupt` feature.
728
- #[ cfg( not( feature = "abi_x86_interrupt" ) ) ]
737
+ #[ cfg( not( all(
738
+ any( target_arch = "x86" , target_arch = "x86_64" ) ,
739
+ feature = "abi_x86_interrupt"
740
+ ) ) ) ]
729
741
#[ derive( Copy , Clone , Debug ) ]
730
742
pub struct HandlerFuncWithErrCode ( ( ) ) ;
731
743
732
744
/// A page fault handler function that pushes a page fault error code.
733
745
///
734
746
/// This type alias is only usable with the `abi_x86_interrupt` feature enabled.
735
- #[ cfg( feature = "abi_x86_interrupt" ) ]
747
+ #[ cfg( all(
748
+ any( target_arch = "x86" , target_arch = "x86_64" ) ,
749
+ feature = "abi_x86_interrupt"
750
+ ) ) ]
736
751
pub type PageFaultHandlerFunc =
737
752
extern "x86-interrupt" fn ( InterruptStackFrame , error_code : PageFaultErrorCode ) ;
738
753
/// This type is not usable without the `abi_x86_interrupt` feature.
739
- #[ cfg( not( feature = "abi_x86_interrupt" ) ) ]
754
+ #[ cfg( not( all(
755
+ any( target_arch = "x86" , target_arch = "x86_64" ) ,
756
+ feature = "abi_x86_interrupt"
757
+ ) ) ) ]
740
758
#[ derive( Copy , Clone , Debug ) ]
741
759
pub struct PageFaultHandlerFunc ( ( ) ) ;
742
760
743
761
/// A handler function that must not return, e.g. for a machine check exception.
744
762
///
745
763
/// This type alias is only usable with the `abi_x86_interrupt` feature enabled.
746
- #[ cfg( feature = "abi_x86_interrupt" ) ]
764
+ #[ cfg( all(
765
+ any( target_arch = "x86" , target_arch = "x86_64" ) ,
766
+ feature = "abi_x86_interrupt"
767
+ ) ) ]
747
768
pub type DivergingHandlerFunc = extern "x86-interrupt" fn ( InterruptStackFrame ) -> !;
748
769
/// This type is not usable without the `abi_x86_interrupt` feature.
749
- #[ cfg( not( feature = "abi_x86_interrupt" ) ) ]
770
+ #[ cfg( not( all(
771
+ any( target_arch = "x86" , target_arch = "x86_64" ) ,
772
+ feature = "abi_x86_interrupt"
773
+ ) ) ) ]
750
774
#[ derive( Copy , Clone , Debug ) ]
751
775
pub struct DivergingHandlerFunc ( ( ) ) ;
752
776
753
777
/// A handler function with an error code that must not return, e.g. for a double fault exception.
754
778
///
755
779
/// This type alias is only usable with the `abi_x86_interrupt` feature enabled.
756
- #[ cfg( feature = "abi_x86_interrupt" ) ]
780
+ #[ cfg( all(
781
+ any( target_arch = "x86" , target_arch = "x86_64" ) ,
782
+ feature = "abi_x86_interrupt"
783
+ ) ) ]
757
784
pub type DivergingHandlerFuncWithErrCode =
758
785
extern "x86-interrupt" fn ( InterruptStackFrame , error_code : u64 ) -> !;
759
786
/// This type is not usable without the `abi_x86_interrupt` feature.
760
- #[ cfg( not( feature = "abi_x86_interrupt" ) ) ]
787
+ #[ cfg( not( all(
788
+ any( target_arch = "x86" , target_arch = "x86_64" ) ,
789
+ feature = "abi_x86_interrupt"
790
+ ) ) ) ]
761
791
#[ derive( Copy , Clone , Debug ) ]
762
792
pub struct DivergingHandlerFuncWithErrCode ( ( ) ) ;
763
793
@@ -853,7 +883,10 @@ pub unsafe trait HandlerFuncType {
853
883
854
884
macro_rules! impl_handler_func_type {
855
885
( $f: ty) => {
856
- #[ cfg( feature = "abi_x86_interrupt" ) ]
886
+ #[ cfg( all(
887
+ any( target_arch = "x86" , target_arch = "x86_64" ) ,
888
+ feature = "abi_x86_interrupt"
889
+ ) ) ]
857
890
unsafe impl HandlerFuncType for $f {
858
891
#[ inline]
859
892
fn to_virt_addr( self ) -> VirtAddr {
0 commit comments