Interrupt attach is called by the kernel only once ??

const struct sigevent *intHandler(void *arg, int id)
{
start_clock = ClockCycles();
//printf(“start clock: %lld\n”, start_clock);

return(&event);
}

#if 0
const struct sigevent *ISR(void *area, int id1)
{

StartInterruptTime = GetTimeStamp();

return (&event);

}
#endif

int ConfigureISR()
{

// Get IO privilege
//
ThreadCtl( _NTO_TCTL_IO, 0 );

//
// Setup COID and event

chid = ChannelCreate( 0 );
SIGEV_INTR_INIT( &event);

//interruptID = InterruptAttachEvent(11, &e, NULL);

interruptID = InterruptAttach(11, intHandler, NULL, 0, 0);
if (interruptID == -1)

{
fprintf(stderr, “can’t attach to IRQ\n”);
perror (NULL);
exit (EXIT_FAILURE);
}

InterruptWait(0, NULL);

//InterruptUnmask (11, interruptID);

end_clock = ClockCycles();

// printf(“end clock: %lld\n”, end_clock);

//microseconds

InterruptLatency = (uint32) ((end_clock - start_clock)*1000000/(SYSPAGE_ENTRY(qtime)->cycles_per_sec));

//printf(“microseconds: %ld\n”, InterruptLatency);
measurements[17] = InterruptLatency;

return (EXIT_SUCCESS);

}

There is a client and server : Client is sending data to the server . Server is receiving the data and sending a response back to the client. Ethernet interface for communication between client and server. Client is a tool (intecrio tool) for sending data. Server is an embedded PC target (fit pc2) with qnx rtos. Server wi be executing some other process. When server receives the data along the Ethernet interface then the kernel as to stop what it is doing. And start executing the newly arrived data.

My task - I want to take the timestamp when the kernel is interrupted and time at which the kernel starts handling it. In QNX microkernel- I am not able to take the timestamp at which the kernel is interrupted . So I am planning to take the timestamp at which the interrupt handler is called by the kernel . Later I will store this timestamp in a memory and server will send this back to the client.