diff options
-rw-r--r-- | CMakeLists.txt | 141 | ||||
-rw-r--r-- | pcilib/CMakeLists.txt | 2 | ||||
-rw-r--r-- | pcilib/build.h.in | 1 | ||||
-rw-r--r-- | pcitool.spec.in | 51 | ||||
-rw-r--r-- | pcitool/CMakeLists.txt | 2 | ||||
-rw-r--r-- | pcitool/buildinfo.c | 4 | ||||
-rw-r--r-- | pywrap/pcipywrap.c | 32 |
7 files changed, 141 insertions, 92 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index 3db7ca9..aedc6e2 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -68,6 +68,13 @@ endif (NOT DEFINED PCILIB_DEBUG_DIR) SET(ENV{PKG_CONFIG_PATH} "${LIB_INSTALL_DIR}/pkgconfig:$ENV{PKG_CONFIG_PATH}") +set(EXTRA_SYSTEM_LIBS -lrt) +add_definitions("-fPIC --std=c99 -Wall -O2 -gdwarf-2 -g3 -fno-omit-frame-pointer") +#add_definitions("-fPIC --std=c99 -Wall -O2") + +include(cmake/version.cmake) +VERSION_TO_VARS(${PCILIB_VERSION} PCILIB_VERSION_MAJOR PCILIB_VERSION_MINOR PCILIB_VERSION_MICRO) + find_package(PkgConfig REQUIRED) find_package(Threads REQUIRED) find_package(Doxygen) @@ -102,8 +109,6 @@ if (NOT HAVE_PYTHON) set(DISABLE_SERVERS TRUE) endif (NOT HAVE_PYTHON) -set(EXTRA_SYSTEM_LIBS -lrt) - include(CheckIncludeFiles) check_include_files(stdatomic.h HAVE_STDATOMIC_H) @@ -121,41 +126,6 @@ if (NOT DISABLE_PCITOOL) pkg_check_modules(FASTWRITER fastwriter REQUIRED) endif (NOT DISABLE_PCITOOL) -add_definitions("-fPIC --std=c99 -Wall -O2 -gdwarf-2 -g3 -fno-omit-frame-pointer") -#add_definitions("-fPIC --std=c99 -Wall -O2") - -include(cmake/version.cmake) - -VERSION_TO_VARS(${PCILIB_VERSION} PCILIB_VERSION_MAJOR PCILIB_VERSION_MINOR PCILIB_VERSION_MICRO) - -add_custom_target(build) -add_custom_command(TARGET build - COMMAND ${CMAKE_COMMAND} -DPCILIB_SOURCE_DIR=${CMAKE_SOURCE_DIR} -DPCILIB_BINARY_DIR=${CMAKE_BINARY_DIR} -P ${CMAKE_SOURCE_DIR}/cmake/build.cmake - WORKING_DIRECTORY ${CMAKE_BINARY_DIR} -) -set_source_files_properties(${CMAKE_BINARY_DIR}/pcilib/build.h PROPERTIES GENERATED TRUE) - -set(TARNAME "pcitool") -set(PACKAGE_VERSION ${PCILIB_VERSION}) -set(PACKAGE_NAME "${TARNAME}") -set(PACKAGE_TARNAME "${TARNAME}") -set(PACKAGE_STRING "${PACKAGE_NAME} ${PACKAGE_VERSION}") -set(PACKAGE_BUGREPORT "http://ufo.kit.edu/ufo/newticket") - -set(CPACK_SOURCE_GENERATOR "TBZ2") -set(CPACK_PACKAGE_CONTACT "Suren A. Chilingaryan <csa@suren.me>") -if (${RELEASE} GREATER 0) - set(CPACK_PACKAGE_VERSION "${PACKAGE_VERSION}.${RELEASE}") -else (${RELEASE} GREATER 0) - set(CPACK_PACKAGE_VERSION "${PACKAGE_VERSION}") -endif (${RELEASE} GREATER 0) -set(CPACK_SOURCE_IGNORE_FILES "/.bzr/;CMakeFiles;_CPack_Packages;cmake_install.cmake;CPack.*.cmake;CMakeCache.txt;install_manifest.txt;config.h$;.pc$;Makefile;.tar.bz2$;~$;${CPACK_SOURCE_IGNORE_FILES}") -set(CPACK_SOURCE_PACKAGE_FILE_NAME "${CMAKE_PROJECT_NAME}-${CPACK_PACKAGE_VERSION}") -include(CPack) - -add_custom_target(dist_clean COMMAND ${CMAKE_MAKE_PROGRAM} clean WORKING_DIRECTORY ${CMAKE_CURRENT_DIR}) -add_custom_target(dist DEPENDS dist_clean COMMAND ${CMAKE_MAKE_PROGRAM} package_source) - add_subdirectory(dma) add_subdirectory(protocols) @@ -169,11 +139,7 @@ if (HAVE_PYTHON) add_subdirectory(pywrap) endif (HAVE_PYTHON) -set_target_properties(pcilib PROPERTIES - VERSION ${PCILIB_VERSION} - SOVERSION ${PCILIB_ABI_VERSION} -) - +set_target_properties(pcilib PROPERTIES VERSION ${PCILIB_VERSION} SOVERSION ${PCILIB_ABI_VERSION}) add_custom_target(docs COMMAND ${DOXYGEN_EXECUTABLE} ${CMAKE_CURRENT_BINARY_DIR}/docs/Doxyfile WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/docs @@ -181,19 +147,66 @@ add_custom_target(docs ) set_directory_properties(PROPERTIES ADDITIONAL_MAKE_CLEAN_FILES "docs/html") +install(FILES + ${CMAKE_CURRENT_BINARY_DIR}/misc/pcitool.pc + DESTINATION ${LIB_INSTALL_DIR}/pkgconfig +) -configure_file(${CMAKE_CURRENT_SOURCE_DIR}/pcitool.spec.in ${CMAKE_CURRENT_BINARY_DIR}/pcitool.spec) -configure_file(${CMAKE_CURRENT_SOURCE_DIR}/misc/dkms.conf.in ${CMAKE_CURRENT_BINARY_DIR}/misc/dkms.conf) -configure_file(${CMAKE_CURRENT_SOURCE_DIR}/misc/pcitool.pc.in ${CMAKE_CURRENT_BINARY_DIR}/misc/pcitool.pc) -configure_file(${CMAKE_CURRENT_SOURCE_DIR}/pcilib/config.h.in ${CMAKE_CURRENT_BINARY_DIR}/pcilib/config.h) -configure_file(${CMAKE_CURRENT_SOURCE_DIR}/pcilib/version.h.in ${CMAKE_CURRENT_BINARY_DIR}/pcilib/version.h) -configure_file(${CMAKE_CURRENT_SOURCE_DIR}/docs/Doxyfile.in ${CMAKE_CURRENT_BINARY_DIR}/docs/Doxyfile) if (NOT DISABLE_SERVERS) - configure_file(${CMAKE_CURRENT_SOURCE_DIR}/misc/pcilib_api.service.in ${CMAKE_CURRENT_BINARY_DIR}/misc/pcilib_api.service) - configure_file(${CMAKE_CURRENT_SOURCE_DIR}/misc/pcilib_html.service.in ${CMAKE_CURRENT_BINARY_DIR}/misc/pcilib_html.service) - configure_file(${CMAKE_CURRENT_SOURCE_DIR}/misc/pcilib.sysconfig.in ${CMAKE_CURRENT_BINARY_DIR}/misc/pcilib.sysconfig) + #install Python servers + file(GLOB DEPLOY_FILES_AND_DIRS "${CMAKE_SOURCE_DIR}/pyserver/*") + foreach(ITEM ${DEPLOY_FILES_AND_DIRS}) + if( IS_DIRECTORY "${ITEM}" ) + list(APPEND DIRS_TO_DEPLOY "${ITEM}") + else() + list(APPEND FILES_TO_DEPLOY "${ITEM}") + endif() + endforeach() + install(FILES ${FILES_TO_DEPLOY} DESTINATION ${PCILIB_SERVER_DIR}) + install(DIRECTORY ${DIRS_TO_DEPLOY} DESTINATION ${PCILIB_SERVER_DIR}) endif (NOT DISABLE_SERVERS) + + +set(TARNAME "pcitool") +set(PACKAGE_VERSION ${PCILIB_VERSION}) +set(PACKAGE_NAME "${TARNAME}") +set(PACKAGE_TARNAME "${TARNAME}") +set(PACKAGE_STRING "${PACKAGE_NAME} ${PACKAGE_VERSION}") +set(PACKAGE_BUGREPORT "http://ufo.kit.edu/ufo/newticket") + +set(CPACK_SOURCE_GENERATOR "TBZ2") +set(CPACK_PACKAGE_CONTACT "Suren A. Chilingaryan <csa@suren.me>") +if (${RELEASE} GREATER 0) + set(CPACK_PACKAGE_VERSION "${PACKAGE_VERSION}.${RELEASE}") +else (${RELEASE} GREATER 0) + set(CPACK_PACKAGE_VERSION "${PACKAGE_VERSION}") +endif (${RELEASE} GREATER 0) +set(CPACK_SOURCE_IGNORE_FILES "/build/;/.bzr/;CMakeFiles;_CPack_Packages;cmake_install.cmake;CPack.*.cmake;CMakeCache.txt;install_manifest.txt;config.h$;.pc$;Makefile;.tar.bz2$;~$;${CPACK_SOURCE_IGNORE_FILES}") +set(CPACK_SOURCE_PACKAGE_FILE_NAME "${CMAKE_PROJECT_NAME}-${CPACK_PACKAGE_VERSION}") +include(CPack) + +# In releases, we just keep the pre-generated build.h +if(EXISTS ${CMAKE_SOURCE_DIR}/.bzr/) + add_custom_target(build + COMMAND ${CMAKE_COMMAND} -DPCILIB_SOURCE_DIR=${CMAKE_SOURCE_DIR} -DPCILIB_BINARY_DIR=${CMAKE_BINARY_DIR} -P ${CMAKE_SOURCE_DIR}/cmake/build.cmake + WORKING_DIRECTORY ${CMAKE_BINARY_DIR} + ) + add_dependencies(pcilib build) + add_dependencies(pci build) + + # We need to generate build.h for source releases + add_custom_target(dist_clean COMMAND ${CMAKE_MAKE_PROGRAM} clean WORKING_DIRECTORY ${CMAKE_CURRENT_DIR}) + add_custom_target(dist_prepare DEPENDS dist_clean + COMMAND ${CMAKE_COMMAND} -DPCILIB_SOURCE_DIR=${CMAKE_SOURCE_DIR} -DPCILIB_BINARY_DIR=${CMAKE_SOURCE_DIR} -DPCILIB_RELEASE=${CPACK_PACKAGE_VERSION} -P ${CMAKE_SOURCE_DIR}/cmake/build.cmake + WORKING_DIRECTORY ${CMAKE_BINARY_DIR} + ) + add_custom_target(dist DEPENDS dist_prepare COMMAND ${CMAKE_MAKE_PROGRAM} package_source) + + set_source_files_properties(${CMAKE_BINARY_DIR}/pcilib/build.h PROPERTIES GENERATED TRUE) + set_source_files_properties(${CMAKE_SOURCE_DIR}/pcilib/build.h PROPERTIES GENERATED TRUE) +endif(EXISTS ${CMAKE_SOURCE_DIR}/.bzr/) + if (NOT CMAKE_SOURCE_DIR STREQUAL CMAKE_BINARY_DIR) file(COPY ${CMAKE_SOURCE_DIR}/xml DESTINATION ${CMAKE_BINARY_DIR}) file(COPY ${CMAKE_SOURCE_DIR}/pyserver DESTINATION ${CMAKE_BINARY_DIR}) @@ -207,23 +220,17 @@ if (NOT CMAKE_SOURCE_DIR STREQUAL CMAKE_BINARY_DIR) ) endif(NOT CMAKE_SOURCE_DIR STREQUAL CMAKE_BINARY_DIR) -install(FILES - ${CMAKE_CURRENT_BINARY_DIR}/misc/pcitool.pc - DESTINATION ${LIB_INSTALL_DIR}/pkgconfig -) - +configure_file(${CMAKE_CURRENT_SOURCE_DIR}/pcitool.spec.in ${CMAKE_CURRENT_BINARY_DIR}/pcitool.spec) +configure_file(${CMAKE_CURRENT_SOURCE_DIR}/misc/dkms.conf.in ${CMAKE_CURRENT_BINARY_DIR}/misc/dkms.conf) +configure_file(${CMAKE_CURRENT_SOURCE_DIR}/misc/pcitool.pc.in ${CMAKE_CURRENT_BINARY_DIR}/misc/pcitool.pc) +configure_file(${CMAKE_CURRENT_SOURCE_DIR}/pcilib/config.h.in ${CMAKE_CURRENT_BINARY_DIR}/pcilib/config.h) +configure_file(${CMAKE_CURRENT_SOURCE_DIR}/pcilib/version.h.in ${CMAKE_CURRENT_BINARY_DIR}/pcilib/version.h) +configure_file(${CMAKE_CURRENT_SOURCE_DIR}/docs/Doxyfile.in ${CMAKE_CURRENT_BINARY_DIR}/docs/Doxyfile) if (NOT DISABLE_SERVERS) - #install Python servers - file(GLOB DEPLOY_FILES_AND_DIRS "${CMAKE_SOURCE_DIR}/pyserver/*") - foreach(ITEM ${DEPLOY_FILES_AND_DIRS}) - if( IS_DIRECTORY "${ITEM}" ) - list(APPEND DIRS_TO_DEPLOY "${ITEM}") - else() - list(APPEND FILES_TO_DEPLOY "${ITEM}") - endif() - endforeach() - install(FILES ${FILES_TO_DEPLOY} DESTINATION ${PCILIB_SERVER_DIR}) - install(DIRECTORY ${DIRS_TO_DEPLOY} DESTINATION ${PCILIB_SERVER_DIR}) + configure_file(${CMAKE_CURRENT_SOURCE_DIR}/misc/pcilib_api.service.in ${CMAKE_CURRENT_BINARY_DIR}/misc/pcilib_api.service) + configure_file(${CMAKE_CURRENT_SOURCE_DIR}/misc/pcilib_html.service.in ${CMAKE_CURRENT_BINARY_DIR}/misc/pcilib_html.service) + configure_file(${CMAKE_CURRENT_SOURCE_DIR}/misc/pcilib.sysconfig.in ${CMAKE_CURRENT_BINARY_DIR}/misc/pcilib.sysconfig) endif (NOT DISABLE_SERVERS) + message("-- Configured pcitool ${PCILIB_VERSION_MAJOR}.${PCILIB_VERSION_MINOR}.${PCILIB_VERSION_MICRO} with public ABI ${PCILIB_ABI_VERSION}") diff --git a/pcilib/CMakeLists.txt b/pcilib/CMakeLists.txt index b24c7b3..009357e 100644 --- a/pcilib/CMakeLists.txt +++ b/pcilib/CMakeLists.txt @@ -11,7 +11,7 @@ include_directories( set(HEADERS pcilib.h pci.h datacpy.h memcpy.h pagecpy.h cpu.h timing.h export.h value.h bar.h fifo.h model.h bank.h register.h view.h property.h unit.h xml.h py.h kmem.h irq.h locking.h lock.h dma.h event.h plugin.h tools.h error.h debug.h env.h config.h version.h build.h) add_library(pcilib SHARED pci.c datacpy.c memcpy.c pagecpy.c cpu.c timing.c export.c value.c bar.c fifo.c model.c bank.c register.c view.c unit.c property.c xml.c py.c kmem.c irq.c locking.c lock.c dma.c event.c plugin.c tools.c error.c debug.c env.c) target_link_libraries(pcilib dma protocols views ${CMAKE_THREAD_LIBS_INIT} ${UFODECODE_LIBRARIES} ${CMAKE_DL_LIBS} ${EXTRA_SYSTEM_LIBS} ${LIBXML2_LIBRARIES} ${PYTHON_LIBRARIES}) -add_dependencies(pcilib build dma protocols views) +add_dependencies(pcilib dma protocols views) install(TARGETS pcilib LIBRARY DESTINATION lib${LIB_SUFFIX} diff --git a/pcilib/build.h.in b/pcilib/build.h.in index 1713378..2c8a937 100644 --- a/pcilib/build.h.in +++ b/pcilib/build.h.in @@ -5,3 +5,4 @@ #define PCILIB_BUILD_DATE "${PCILIB_BUILD_DATE}" #define PCILIB_BUILD_DIR "${CMAKE_SOURCE_DIR}" #define PCILIB_LAST_MODIFICATION "${PCILIB_LAST_MODIFICATION}" +#cmakedefine PCILIB_RELEASE "${PCILIB_RELEASE}" diff --git a/pcitool.spec.in b/pcitool.spec.in index a8b1d9b..07773da 100644 --- a/pcitool.spec.in +++ b/pcitool.spec.in @@ -4,24 +4,28 @@ %{!?python2_sitelib: %global python2_sitelib %(%{__python2} -c "from distutils.sysconfig import get_python_lib; print(get_python_lib())")} %{!?python2_sitearch: %global python2_sitearch %(%{__python2} -c "from distutils.sysconfig import get_python_lib; print(get_python_lib(1))")} +%{?!_udevrulesdir: %global _udevrulesdir %{_prefix}/lib/udev/rules.d/ } +%{?!_unitdir: %global _unitdir %{_prefix}/lib/systemd/system/ } +%{?!_dkmsdir: %global _dkmsdir /var/lib/dkms } + Summary: Universal PCI driver Name: pcitool Version: ${CPACK_PACKAGE_VERSION} Release: csa License: GPL-3.0 Group: Development/Libraries +Vendor: Institute for Data Processing and Electronics, KIT +Packager: Suren A. Chilingaryan <csa@suren.me> Source: ${CPACK_SOURCE_PACKAGE_FILE_NAME}.tar.bz2 -BuildRoot: %{_tmppath}/%{name}-%{version}-root URL: http://darksoft.org -Prefix: %{_prefix} -Docdir: %{_docdir} BuildRequires: libfastwriter-devel libxml2-devel uthash BuildRequires: python python-devel swig -BuildRequires: kernel-devel dkms +BuildRequires: dkms BuildRequires: doxygen BuildRequires: pkg-config libtool cmake -Vendor: Institute for Data Processing and Electronics, KIT -Packager: Suren A. Chilingaryan <csa@suren.me> +BuildRoot: %{_tmppath}/%{name}-%{version}-root +Prefix: %{_prefix} +Docdir: %{_docdir} %description pcitool is a command line tool to manipulate PCI hardware. It provides ability @@ -96,8 +100,14 @@ Minimalistic driver used by pcilib to Summary: Pcilib Web API Group: Development/Libraries Requires: pcilib-python = %{version} +Requires: pcilib-test = %{version} Requires: python +%if %{defined suse_version} +Prereq: %fillup_prereq +%endif + + %description -n pcilib-server Pcilib Web API and small demo web server. @@ -120,7 +130,7 @@ mkdir -p $RPM_BUILD_ROOT/%{_libdir}/pcilib${PCILIB_ABI_VERSION}/ install -m 755 tests/reload.sh $RPM_BUILD_ROOT/%{_bindir}/pci-reload # udev -mkdir -p $RPM_BUILD_ROOT/usr/lib/udev/rules.d +mkdir -p $RPM_BUILD_ROOT/%{_udevrulesdir} install -m 644 misc/50-pcidriver.rules $RPM_BUILD_ROOT/%{_udevrulesdir} # DKMS @@ -135,8 +145,21 @@ cp -r driver $RPM_BUILD_ROOT/usr/src/%{modname}-%{version}/ cp -r xml/test $RPM_BUILD_ROOT/%{_datadir}/pcilib${PCILIB_ABI_VERSION}/models/ # Servers +mkdir -p $RPM_BUILD_ROOT/%{_unitdir} +install -m 644 misc/pcilib_api.service $RPM_BUILD_ROOT/%{_unitdir} +install -m 644 misc/pcilib_html.service $RPM_BUILD_ROOT/%{_unitdir} + +%if %{defined suse_version} + mkdir -p $RPM_BUILD_ROOT/var/adm/fillup-templates/ + install -m 644 misc/pcilib.sysconfig $RPM_BUILD_ROOT/var/adm/fillup-templates/sysconfig.pcilib +%else + mkdir -p $RPM_BUILD_ROOT/%{_sysconfdir}/sysconfig + install -m 644 misc/pcilib.sysconfig $RPM_BUILD_ROOT/%{_sysconfdir}/sysconfig/pcilib +%endif + cp -r pyserver $RPM_BUILD_ROOT/%{_datadir}/pcilib${PCILIB_ABI_VERSION}/ + %clean rm -rf $RPM_BUILD_ROOT @@ -159,6 +182,13 @@ exit 0 /usr/sbin/dkms remove -m %{modname} -v %{version} --all --rpm_safe_upgrade exit 0 +%post -n pcilib-server + +%if %{defined suse_version} + %fillup_and_insserv -i +%endif + + %files %defattr(-, root, root) %{_bindir}/pci @@ -169,6 +199,7 @@ exit 0 %doc docs/README %doc docs/HARDWARE %dir %{_libdir}/pcilib${PCILIB_ABI_VERSION}/ +%dir %{_datadir}/pcilib${PCILIB_ABI_VERSION}/ %dir %{_datadir}/pcilib${PCILIB_ABI_VERSION}/models/ %{_datadir}/pcilib${PCILIB_ABI_VERSION}/models/*.xsd %{_libdir}/libpcilib.so.* @@ -197,6 +228,12 @@ exit 0 %files -n pcilib-server %defattr(-, root, root) +%if %{defined suse_version} +/var/adm/fillup-templates/sysconfig.* +%else +%{_sysconfdir}/sysconfig/* +%endif +%{_unitdir}/* %{_datadir}/pcilib${PCILIB_ABI_VERSION}/pyserver %changelog diff --git a/pcitool/CMakeLists.txt b/pcitool/CMakeLists.txt index d8b5a6c..af0f6e4 100644 --- a/pcitool/CMakeLists.txt +++ b/pcitool/CMakeLists.txt @@ -15,7 +15,7 @@ link_directories( if (NOT DISABLE_PCITOOL) set(HEADERS ${HEADERS} sysinfo.h formaters.h buildinfo.h) add_executable(pci cli.c sysinfo.c formaters.c buildinfo.c) - add_dependencies(pci build pcilib) + add_dependencies(pci pcilib) target_link_libraries(pci pcilib ${FASTWRITER_LIBRARIES}) set_target_properties(pci PROPERTIES LINK_FLAGS "${CMAKE_THREAD_LIBS_INIT} ${EXTRA_SYSTEM_LIBS}" diff --git a/pcitool/buildinfo.c b/pcitool/buildinfo.c index 624a934..2206c62 100644 --- a/pcitool/buildinfo.c +++ b/pcitool/buildinfo.c @@ -4,7 +4,11 @@ void BuildInfo() { printf("\n"); +#ifdef PCILIB_RELEASE + printf("Release: %s (revision: %s built on %s in %s)\n", PCILIB_RELEASE, PCILIB_REVISION, PCILIB_BUILD_DATE, PCILIB_BUILD_DIR); +#else /* PCILIB_RELEASE */ printf("Revision: %s built on %s in %s\n", PCILIB_REVISION, PCILIB_BUILD_DATE, PCILIB_BUILD_DIR); +#endif /* PCILIB_RELEASE */ printf("Branch: %s by %s\n", PCILIB_REVISION_BRANCH, PCILIB_REVISION_AUTHOR); if (strlen(PCILIB_REVISION_MODIFICATIONS)) { printf("Modifications: %s - %s\n", PCILIB_LAST_MODIFICATION, PCILIB_REVISION_MODIFICATIONS); diff --git a/pywrap/pcipywrap.c b/pywrap/pcipywrap.c index 7431604..f656ec6 100644 --- a/pywrap/pcipywrap.c +++ b/pywrap/pcipywrap.c @@ -459,22 +459,22 @@ PyObject* pcipywrap_set_property(pcipywrap *self, PyObject* val, const char *pro PyObject* pcipywrap_get_registers_list(pcipywrap *self, const char *bank) { - pcilib_register_info_t *list = pcilib_get_register_list(self->ctx, bank, PCILIB_LIST_FLAGS_DEFAULT); - - if(!list) { - set_python_exception("pcilib_get_register_list return NULL"); - return NULL; - } - - PyObject* pyList = PyList_New(0); - for(int i = 0; list[i].name; i++) - { - //serialize item attributes - PyObject* pylistItem = pcilib_convert_register_info_to_pyobject(self->ctx, list[i]); - pcilib_pylist_append(pyList, pylistItem); - } - pcilib_free_register_info(self->ctx, list); - return pyList; + pcilib_register_info_t *list = pcilib_get_register_list(self->ctx, bank, PCILIB_LIST_FLAGS_DEFAULT); + + if(!list) { + set_python_exception("pcilib_get_register_list return NULL"); + return NULL; + } + + PyObject* pyList = PyList_New(0); + for(int i = 0; list[i].name; i++) + { + //serialize item attributes + PyObject* pylistItem = pcilib_convert_register_info_to_pyobject(self->ctx, list[i]); + pcilib_pylist_append(pyList, pylistItem); + } + pcilib_free_register_info(self->ctx, list); + return pyList; } PyObject* pcipywrap_get_register_info(pcipywrap *self, const char* reg,const char *bank) |