+ free(xpcu_event);
+ }
+
+ return 0;
+}
+
+int xpcu_int_state(struct interrupt *it, int enable) {
+ struct xpcu_event_s *xpcu_event = (struct xpcu_event_s*)it->hInterrupt;
+ pthread_mutex_t *interrupt = &dummy_interrupt;
+
+ if (xpcu_event)
+ interrupt = &xpcu_event->interrupt;
+
+ if (enable == ENABLE_INTERRUPT) {
+ it->fEnableOk = 1;
+ it->fStopped = 0;
+ it->dwCounter = 0;
+ pthread_mutex_trylock(interrupt);
+ } else {
+ it->dwCounter = 0;
+ it->fStopped = 1;
+ if (pthread_mutex_trylock(interrupt) == EBUSY)
+ pthread_mutex_unlock(interrupt);