Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.

!DEC$ ADDRIBUTES Help

garylscott1
Beginner
690 Views
I need to write an interface for the below C function. I'm not sure how to declare the interrupt handler

!
!_EXTERN S16BIT _DECL aceSetIrqConditions( S16BIT DevNum,
! U16BIT bEnable,
! U32BIT dwIrqMask,
! void(_DECL *funcExternalIsr)(S16BIT DevNum, U32BIT dwIrqStatus));
!
! My attempt
!
interface

use EMACEKinds, only : S16BIT, U16BIT, U32BIT

integer(S16BIT) function aceSetIrqConditions(DevNum,bEnable,dwIrqMask,funcExternalIsr)

!DEC$ ATTRIBUTES C,ALIAS:"__aceSetIrqConditions" :: aceSetIrqConditions
!DEC$ ATTRIBUTES VALUE :: DevNum
!DEC$ ATTRIBUTES VALUE :: bEnable
!DEC$ ATTRIBUTES VALUE :: dwIrqMask
!DEC$ ATTRIBUTES REFERENCE :: funcExternalIsr !function pointer to interrupt service routine

integer(S16BIT), intent(in) :: DevNum
integer(U16BIT), intent(in) :: bEnable
integer(U16BIT), intent(in) :: dwIrqMask
integer(U16BIT), intent(in) :: funcExternalIsr

end function

end interface
!
! Interrupt Service Routine ??
!
interface

use EMACEKinds, only : S16BIT, U32BIT

integer(S16BIT) function funcExternalIsr(DevNum,dwIrqStatus)
!
!I don't think I should use following C attribute, isn't this an internal fortran routine?
!
!DEC$ ATTRIBUTES C,ALIAS:"__funcExternalIsr" :: funcExternalIsr

!DEC$ ATTRIBUTES VALUE :: DevNum
!DEC$ ATTRIBUTES VALUE :: dwIrqStatus

integer(S16BIT), intent(in) :: DevNum
integer(U16BIT), intent(in) :: dwIrqStatus

end function

end interface


0 Kudos
1 Reply
garylscott1
Beginner
690 Views
or attributes rather
0 Kudos
Reply