Преглед изворни кода

almost finished regarding suren remarks

zilio nicolas пре 8 година
родитељ
комит
5459bc4a69
18 измењених фајлова са 47 додато и 22 уклоњено
  1. 22 20
      CMakeLists.txt
  2. 1 0
      apps/pio_test.c
  3. 1 0
      apps/xilinx.c
  4. 2 0
      dma/CMakeLists.txt
  5. 1 0
      dma/ipe.c
  6. 1 0
      dma/ipe_benchmark.c
  7. 1 0
      dma/nwl.c
  8. 1 0
      dma/nwl_engine.c
  9. 1 0
      dma/nwl_loopback.c
  10. 2 0
      pcilib/CMakeLists.txt
  11. 1 0
      pcilib/bar.c
  12. 1 0
      pcilib/error.c
  13. 1 0
      pcilib/fifo.c
  14. 1 0
      pcilib/pci.c
  15. 5 2
      pcilib/xml.c
  16. 2 0
      pcitool/CMakeLists.txt
  17. 1 0
      pcitool/cli.c
  18. 2 0
      protocols/CMakeLists.txt

+ 22 - 20
CMakeLists.txt

@@ -9,6 +9,28 @@ set(DISABLE_PCITOOL FALSE CACHE BOOL "Build only the library")
 
 #list(APPEND CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake")
 
+if(NOT DEFINED BIN_INSTALL_DIR)
+    set(BIN_INSTALL_DIR "${CMAKE_INSTALL_PREFIX}/bin")
+endif(NOT DEFINED BIN_INSTALL_DIR)
+
+if(NOT DEFINED LIB_INSTALL_DIR)
+    set(LIB_INSTALL_DIR "${CMAKE_INSTALL_PREFIX}/lib")
+endif(NOT DEFINED LIB_INSTALL_DIR)
+
+if(NOT DEFINED INCLUDE_INSTALL_DIR)
+    set(INCLUDE_INSTALL_DIR "${CMAKE_INSTALL_PREFIX}/include")
+endif(NOT DEFINED INCLUDE_INSTALL_DIR)
+
+if(NOT DEFINED DATA_INSTALL_DIR)
+    set(DATA_INSTALL_DIR "${CMAKE_INSTALL_PREFIX}/share")
+endif(NOT DEFINED DATA_INSTALL_DIR)
+
+if(NOT DEFINED LOCALE_INSTALL_DIR)
+    set(LOCALE_INSTALL_DIR "${DATA_INSTALL_DIR}/locale")
+endif(NOT DEFINED LOCALE_INSTALL_DIR)
+
+SET(ENV{PKG_CONFIG_PATH} "${LIB_INSTALL_DIR}/pkgconfig:$ENV{PKG_CONFIG_PATH}")
+
 find_package(PkgConfig REQUIRED)
 find_package(Threads REQUIRED)
 find_package(PythonLibs REQUIRED)
@@ -47,26 +69,6 @@ set(PACKAGE_TARNAME "${TARNAME}")
 set(PACKAGE_STRING "${PACKAGE_NAME} ${PACKAGE_VERSION}")
 set(PACKAGE_BUGREPORT "http://ufo.kit.edu/ufo/newticket")
 
-if(NOT DEFINED BIN_INSTALL_DIR)
-    set(BIN_INSTALL_DIR "${CMAKE_INSTALL_PREFIX}/bin")
-endif(NOT DEFINED BIN_INSTALL_DIR)
-
-if(NOT DEFINED LIB_INSTALL_DIR)
-    set(LIB_INSTALL_DIR "${CMAKE_INSTALL_PREFIX}/lib")
-endif(NOT DEFINED LIB_INSTALL_DIR)
-
-if(NOT DEFINED INCLUDE_INSTALL_DIR)
-    set(INCLUDE_INSTALL_DIR "${CMAKE_INSTALL_PREFIX}/include")
-endif(NOT DEFINED INCLUDE_INSTALL_DIR)
-
-if(NOT DEFINED DATA_INSTALL_DIR)
-    set(DATA_INSTALL_DIR "${CMAKE_INSTALL_PREFIX}/share")
-endif(NOT DEFINED DATA_INSTALL_DIR)
-
-if(NOT DEFINED LOCALE_INSTALL_DIR)
-    set(LOCALE_INSTALL_DIR "${DATA_INSTALL_DIR}/locale")
-endif(NOT DEFINED LOCALE_INSTALL_DIR)
-
 set(PCILIB_PLUGIN_DIR "${LIB_INSTALL_DIR}/pcilib" CACHE PATH "Directory to install plugins")
 set(PCILIB_DATA_DIR "${DATA_INSTALL_DIR}/pcilib" CACHE PATH "Directory to install data files")
 set(PCILIB_MODEL_DIR "${PCILIB_DATA_DIR}/models" CACHE PATH "Directory to install XML models")

+ 1 - 0
apps/pio_test.c

@@ -1,4 +1,5 @@
 #define _BSD_SOURCE
+#define _DEFAULT_SOURCE
 #define _POSIX_C_SOURCE 199309L
 #include <stdio.h>
 #include <stdlib.h>

+ 1 - 0
apps/xilinx.c

@@ -1,4 +1,5 @@
 #define _BSD_SOURCE
+#define _DEFAULT_SOURCE
 #define _POSIX_C_SOURCE 199309L
 #include <stdio.h>
 #include <stdlib.h>

+ 2 - 0
dma/CMakeLists.txt

@@ -1,6 +1,8 @@
 include_directories(
     ${CMAKE_SOURCE_DIR}
+    ${CMAKE_BINARY_DIR}
     ${CMAKE_SOURCE_DIR}/pcilib
+    ${CMAKE_BINARY_DIR}/pcilib
 )
 
 set(HEADERS ${HEADERS} nwl.h nwl_private.h nwl_engine.h nwl_irq.h nwl_loopback.h ipe.h ipe_private.h)

+ 1 - 0
dma/ipe.c

@@ -1,5 +1,6 @@
 #define _PCILIB_DMA_IPE_C
 #define _BSD_SOURCE
+#define _DEFAULT_SOURCE
 
 #include <stdio.h>
 #include <stdlib.h>

+ 1 - 0
dma/ipe_benchmark.c

@@ -1,5 +1,6 @@
 #define _PCILIB_DMA_IPE_C
 #define _BSD_SOURCE
+#define _DEFAULT_SOURCE
 
 #include <stdio.h>
 #include <stdlib.h>

+ 1 - 0
dma/nwl.c

@@ -1,5 +1,6 @@
 #define _PCILIB_DMA_NWL_C
 #define _BSD_SOURCE
+#define _DEFAULT_SOURCE
 #define _GNU_SOURCE
 
 #include <stdio.h>

+ 1 - 0
dma/nwl_engine.c

@@ -1,4 +1,5 @@
 #define _BSD_SOURCE
+#define _DEFAULT_SOURCE
 
 #include <stdio.h>
 #include <stdlib.h>

+ 1 - 0
dma/nwl_loopback.c

@@ -1,4 +1,5 @@
 #define _BSD_SOURCE
+#define _DEFAULT_SOURCE
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>

+ 2 - 0
pcilib/CMakeLists.txt

@@ -2,7 +2,9 @@ include_directories(
     ${CMAKE_SOURCE_DIR}
 	${PYTHON_INCLUDE_DIRS}
 	${XMLLIB_INCLUDE_DIRS}
+    ${CMAKE_BINARY_DIR}
     ${CMAKE_SOURCE_DIR}/pcilib
+    ${CMAKE_BINARY_DIR}/pcilib
 )
 
 set(HEADERS pcilib.h pci.h export.h bar.h fifo.h model.h bank.h register.h

+ 1 - 0
pcilib/bar.c

@@ -1,4 +1,5 @@
 #define _BSD_SOURCE
+#define _DEFAULT_SOURCE
 #define _POSIX_C_SOURCE 200809L
 
 #include <stdio.h>

+ 1 - 0
pcilib/error.c

@@ -1,4 +1,5 @@
 #define _BSD_SOURCE
+#define _DEFAULT_SOURCE
 
 #include <stdio.h>
 #include <stdlib.h>

+ 1 - 0
pcilib/fifo.c

@@ -1,4 +1,5 @@
 #define _BSD_SOURCE
+#define _DEFAULT_SOURCE
 #define _POSIX_C_SOURCE 200809L
 
 #include <stdio.h>

+ 1 - 0
pcilib/pci.c

@@ -1,6 +1,7 @@
 //#define PCILIB_FILE_IO
 #define _XOPEN_SOURCE 700
 #define _BSD_SOURCE
+#define _DEFAULT_SOURCE
 #define _POSIX_C_SOURCE 200809L
 
 #include <stdio.h>

+ 5 - 2
pcilib/xml.c

@@ -21,6 +21,10 @@
 #include "bank.h"
 #include "register.h"
 #include <libxml/xmlschemastypes.h>
+#include <libxml/tree.h>
+#include <libxml/parser.h>
+#include <libxml/xpath.h>
+#include <libxml/xpathInternals.h>
 
 #include <dirent.h>
 #include <errno.h>
@@ -450,7 +454,6 @@ void pcilib_xml_initialize_registers(pcilib_t* pci,xmlDocPtr doc){
 	xmlChar *type=NULL;
 	xmlNodePtr mynode;	
 	xmlXPathContextPtr context;
-	int number_registers;
 	pcilib_register_description_t *registers=NULL;
 	pcilib_register_description_t myregister;
 	int i,j;
@@ -488,7 +491,7 @@ void pcilib_xml_initialize_registers(pcilib_t* pci,xmlDocPtr doc){
 	/**we arrange the register for them to be well placed for pci-l*/
 	pcilib_xml_arrange_registers(registers,nodesetadress->nodeNr+nodesetsubadress->nodeNr);
 	/**we fille the pcilib_t struct*/
-        pcilib_add_registers(pci,number_registers,registers);
+        pcilib_add_registers(pci,nodesetadress->nodeNr+nodesetsubadress->nodeNr,registers);
 }
 
 

+ 2 - 0
pcitool/CMakeLists.txt

@@ -1,6 +1,8 @@
 include_directories(
     ${CMAKE_SOURCE_DIR}
+    ${CMAKE_BINARY_DIR}
     ${CMAKE_SOURCE_DIR}/pcilib
+    ${CMAKE_BINARY_DIR}/pcilib
     ${FASTWRITER_INCLUDE_DIRS}
 )
 

+ 1 - 0
pcitool/cli.c

@@ -1,6 +1,7 @@
 #define _XOPEN_SOURCE 700
 #define _POSIX_C_SOURCE 200112L
 #define _BSD_SOURCE
+#define _DEFAULT_SOURCE
 
 #include <stdio.h>
 #include <stdlib.h>

+ 2 - 0
protocols/CMakeLists.txt

@@ -1,6 +1,8 @@
 include_directories(
     ${CMAKE_SOURCE_DIR}
+    ${CMAKE_BINARY_DIR}
     ${CMAKE_SOURCE_DIR}/pcilib
+    ${CMAKE_BINARY_DIR}/pcilib
 )
 
 set(HEADERS ${HEADERS} default.h software.h)