Skip to content

Commit

Permalink
fix utility to show interrupts
Browse files Browse the repository at this point in the history
  • Loading branch information
dirk-zimoch committed Nov 7, 2017
1 parent 4740e35 commit e363d1e
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 17 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,7 @@ O.*
*.o
*.a
*.so
*.so.*
toscaApi/*/
toscaApi/tosca
toscaApi/toscaShowIntr
4 changes: 3 additions & 1 deletion toscaApi/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -66,9 +66,11 @@ clean:

install: build
mkdir -p include bin lib
rm -rf includ/* bin/* lib/*
rm -rf include/* bin/* lib/*
cp $(PROGS) bin
cp $(LIBNAME) $(SHLIBNAME) lib
ifeq ($(SHLIBNAME),$(subst -,!,$(SHLIBNAME)))
ln -s $(SHLIBNAME) lib/lib$(LIB).so
endif
cp $(HEADERS) include
tar cfz - bin lib include | ssh -q root@gfa-eldk tar xfz - -C $(ROOTFS)/$(INSTALLDIR)
21 changes: 21 additions & 0 deletions toscaApi/_toscaShowIntr.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
#include <time.h>
#include "toscaIntr.h"

void handler(void* arg, int inum, int ivec) {
struct timespec tp;
char timestr[30];
clock_gettime(CLOCK_REALTIME, &tp);
strftime(timestr, sizeof(timestr), "%Y-%m-%d %H:%M:%S", localtime(&tp.tv_sec));
if (ivec)
printf("%s.%09ld %s-%d.%d\n", timestr, tp.tv_nsec, (char*) arg, inum, ivec);
else
printf("%s.%09ld %s-%d\n", timestr, tp.tv_nsec, (char*) arg, inum);
}

int main() {
toscaIntrConnectHandler(TOSCA_USER1_INTR_ANY, handler, "USER1");
toscaIntrConnectHandler(TOSCA_USER1_INTR_ANY, handler, "USER2");
toscaIntrConnectHandler(TOSCA_VME_INTR_ANY_VECS(0,255), handler, "VME");
toscaIntrLoop(NULL);
return 0;
}
16 changes: 0 additions & 16 deletions toscaApi/_toscaShowUserIntr.c

This file was deleted.

0 comments on commit e363d1e

Please sign in to comment.