summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authordaniel <danieruru@gmail.com>2013-01-13 13:25:38 +0900
committerdaniel <danieruru@gmail.com>2013-01-13 13:25:38 +0900
commit7f2e52e8dbcda238268dd7339ba8c3dce908e252 (patch)
tree56f94b4bd9682a33d790dc7a3a234471e4da4eca
parent52cc0f0f558190e310c898ec7e616ed2b8306f02 (diff)
fire the interrupt from the right place
-rw-r--r--gpib.c2
-rw-r--r--libvxi11client/Makefile1
-rw-r--r--libvxi11client/libvxi11client.c2
-rw-r--r--libvxi11client/perlbits/Client.xs2
-rw-r--r--libvxi11client/perlbits/Makefile.PL2
-rw-r--r--vxi11_server.c14
6 files changed, 15 insertions, 8 deletions
diff --git a/gpib.c b/gpib.c
index b2b24b7..bfa82ff 100644
--- a/gpib.c
+++ b/gpib.c
@@ -3,6 +3,7 @@
#include "flash.h"
#include "error_utils.h"
#include "bus.h"
+#include "vxi11_server.h"
#include <glib.h>
@@ -297,6 +298,7 @@ void TNT_4882_Status(int status_register,unsigned int byte,int operation)
if(set_srq) { // If SRQ desired
globals.Remote.vxi_service_request = 1;
TNT_Out(R_auxmr,F_reqt); // Set request true
+ vxi11_fireinterrupt();
} else {
globals.Remote.vxi_service_request = 0;
TNT_Out(R_auxmr,F_reqf); // Set request false
diff --git a/libvxi11client/Makefile b/libvxi11client/Makefile
index 304e180..ec74afe 100644
--- a/libvxi11client/Makefile
+++ b/libvxi11client/Makefile
@@ -28,6 +28,7 @@ perl:
-rm -rf VXI11-Client
h2xs -A -x -n VXI11::Client
cp vxi11.h libvxi11client.c libvxi11client.h vxi11_clnt.c vxi11_xdr.c VXI11-Client/
+ cp perlbits/README VXI11-Client/
cp perlbits/perlglue.c perlbits/perlglue.h VXI11-Client/
cp perlbits/Client.xs VXI11-Client/
cp perlbits/Makefile.PL VXI11-Client/
diff --git a/libvxi11client/libvxi11client.c b/libvxi11client/libvxi11client.c
index ff8f86f..4697775 100644
--- a/libvxi11client/libvxi11client.c
+++ b/libvxi11client/libvxi11client.c
@@ -499,7 +499,7 @@ int vxi11_enable_srq(bool enable, char* handle, void (*callback)(void)) {
if (enable) {
if (handle != NULL) {
params.handle.handle_val = handle;
- params.handle.handle_len = strlen(handle);
+ params.handle.handle_len = strlen(handle) + 1;
}
interruptcallback = callback;
}
diff --git a/libvxi11client/perlbits/Client.xs b/libvxi11client/perlbits/Client.xs
index ebfc037..3bd831f 100644
--- a/libvxi11client/perlbits/Client.xs
+++ b/libvxi11client/perlbits/Client.xs
@@ -6,6 +6,8 @@
MODULE = VXI11::Client PACKAGE = VXI11::Client
+PROTOTYPES: ENABLE
+
int
abort()
CODE:
diff --git a/libvxi11client/perlbits/Makefile.PL b/libvxi11client/perlbits/Makefile.PL
index 055880e..43b9d41 100644
--- a/libvxi11client/perlbits/Makefile.PL
+++ b/libvxi11client/perlbits/Makefile.PL
@@ -9,7 +9,7 @@ WriteMakefile(
($] >= 5.005 ? ## Add these new keywords supported since 5.005
(ABSTRACT_FROM => 'lib/VXI11/Client.pm', # retrieve abstract from module
AUTHOR => 'daniel <daniel@>') : ()),
- LIBS => ['-pthread -lgthread-2.0 -lrt -lglib-2.0'], # e.g., '-lm'
+ LIBS => ['-lpthread -lgthread-2.0 -lrt -lglib-2.0'], # e.g., '-lm'
DEFINE => '', # e.g., '-DHAVE_SOMETHING'
INC => '-I. -I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include', # e.g., '-I. -I/usr/include/other'
OBJECT => '$(O_FILES)', # link all the C files too
diff --git a/vxi11_server.c b/vxi11_server.c
index 520cb03..1a2a175 100644
--- a/vxi11_server.c
+++ b/vxi11_server.c
@@ -1,3 +1,4 @@
+#include "vxi11_server.h"
#include "vxi11.h"
#include "globals.h"
#include "gpib.h"
@@ -323,11 +324,13 @@ device_unlock_1_svc(Device_Link *argp, struct svc_req *rqstp) {
return &result;
}
-void fireinterrupt() {
- Device_SrqParms params;
- params.handle.handle_val = inthandler;
- params.handle.handle_len = strlen(inthandler);
- device_intr_srq_1(&params, intclient);
+void vxi11_fireinterrupt() {
+ if (intclient != NULL) {
+ Device_SrqParms params;
+ params.handle.handle_val = inthandler;
+ params.handle.handle_len = strlen(inthandler);
+ device_intr_srq_1(&params, intclient);
+ }
}
Device_Error *
@@ -350,7 +353,6 @@ device_enable_srq_1_svc(Device_EnableSrqParms *argp, struct svc_req *rqstp) {
#ifdef DEBUG
printf("Interrupt handle set to %s\n", inthandler);
#endif
- fireinterrupt();
}
}
result.error = 0;