summaryrefslogtreecommitdiff
path: root/mtcr_py
diff options
authorTzafrir Cohen <tzafrir@debian.org>2021-11-05 16:25:00 +0200
committergit-ubuntu importer <ubuntu-devel-discuss@lists.ubuntu.com>2021-11-06 04:33:13 +0000
commit21849d048cf5242368eda7bb64f4073723f3eea2 (patch)
tree19a39f1dcac9b9b3cf604b7f9f0af3b5948f94d3 /mtcr_py
parent14d2fd8bac3f1e1efb9e74ca418d20dc3a269454 (diff)
4.17.0+1-1 (patches unapplied)import/4.17.0+1-1
Imported using git-ubuntu import.
Notes
Notes: * New upstream release: - array_length.patch removed: merged upstream. - riscv.patch removed removed merged upstream. - hppa_and_m68k.patch remove: merged upstream. - mipsel.patch added (originally from hppa_and_m68k.patch). * Add malloc_delete_free.patch (Closes: #984247).
Diffstat (limited to 'mtcr_py')
-rw-r--r--mtcr_py/Makefile.am2
-rw-r--r--mtcr_py/Makefile.in36
-rw-r--r--mtcr_py/mtcr.py15
3 files changed, 36 insertions, 17 deletions
diff --git a/mtcr_py/Makefile.am b/mtcr_py/Makefile.am
index 3b52f8a..351eb81 100644
--- a/mtcr_py/Makefile.am
+++ b/mtcr_py/Makefile.am
@@ -39,7 +39,7 @@ MTCR_DIR = $(USER_DIR)/${MTCR_CONF_DIR}
mtcr_pylib_DATA = cmtcr.so mtcr.py
dist_mtcr_pylib_DATA = mtcr.py
cmtcr.so:
- $(CC) -g -Wall -pthread -shared ${CFLAGS} $(MTCR_DIR)/*.o -o cmtcr.so $(MFT_CORE_LIB)
+ $(CC) -g -Wall -pthread -shared ${CFLAGS} $(MTCR_DIR)/*.o -o cmtcr.so $(MFT_CORE_LIB_LINK)
CLEANFILES = cmtcr.so
diff --git a/mtcr_py/Makefile.in b/mtcr_py/Makefile.in
index 421f957..705a7af 100644
--- a/mtcr_py/Makefile.in
+++ b/mtcr_py/Makefile.in
@@ -1,7 +1,7 @@
-# Makefile.in generated by automake 1.13.4 from Makefile.am.
+# Makefile.in generated by automake 1.16.3 from Makefile.am.
# @configure_input@
-# Copyright (C) 1994-2013 Free Software Foundation, Inc.
+# Copyright (C) 1994-2020 Free Software Foundation, Inc.
# This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@@ -46,7 +46,17 @@
#--
VPATH = @srcdir@
-am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)'
+am__is_gnu_make = { \
+ if test -z '$(MAKELEVEL)'; then \
+ false; \
+ elif test -n '$(MAKE_HOST)'; then \
+ true; \
+ elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \
+ true; \
+ else \
+ false; \
+ fi; \
+}
am__make_running_with_option = \
case $${target_option-} in \
?) ;; \
@@ -110,13 +120,13 @@ POST_UNINSTALL = :
build_triplet = @build@
host_triplet = @host@
subdir = mtcr_py
-DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \
- $(dist_mtcr_pylib_DATA)
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
am__aclocal_m4_deps = $(top_srcdir)/m4/ax_check_compile_flag.m4 \
$(top_srcdir)/configure.ac
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
$(ACLOCAL_M4)
+DIST_COMMON = $(srcdir)/Makefile.am $(dist_mtcr_pylib_DATA) \
+ $(am__DIST_COMMON)
mkinstalldirs = $(install_sh) -d
CONFIG_HEADER = $(top_builddir)/config.h
CONFIG_CLEAN_FILES =
@@ -171,6 +181,7 @@ am__installdirs = "$(DESTDIR)$(mtcr_pylibdir)" \
"$(DESTDIR)$(mtcr_pylibdir)"
DATA = $(dist_mtcr_pylib_DATA) $(mtcr_pylib_DATA)
am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP)
+am__DIST_COMMON = $(srcdir)/Makefile.in
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
ACLOCAL = @ACLOCAL@
ADABE_DBS = @ADABE_DBS@
@@ -229,6 +240,7 @@ LIBTOOL = @LIBTOOL@
LIPO = @LIPO@
LN_S = @LN_S@
LTLIBOBJS = @LTLIBOBJS@
+LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@
MAD_IFC = @MAD_IFC@
MAKEINFO = @MAKEINFO@
MANIFEST_TOOL = @MANIFEST_TOOL@
@@ -345,14 +357,13 @@ $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps)
echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign mtcr_py/Makefile'; \
$(am__cd) $(top_srcdir) && \
$(AUTOMAKE) --foreign mtcr_py/Makefile
-.PRECIOUS: Makefile
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
@case '$?' in \
*config.status*) \
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
*) \
- echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
- cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
+ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \
+ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \
esac;
$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
@@ -418,7 +429,10 @@ ctags CTAGS:
cscope cscopelist:
-distdir: $(DISTFILES)
+distdir: $(BUILT_SOURCES)
+ $(MAKE) $(AM_MAKEFLAGS) distdir-am
+
+distdir-am: $(DISTFILES)
@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
list='$(DISTFILES)'; \
@@ -568,8 +582,10 @@ uninstall-am: uninstall-dist_mtcr_pylibDATA uninstall-mtcr_pylibDATA
ps ps-am tags-am uninstall uninstall-am \
uninstall-dist_mtcr_pylibDATA uninstall-mtcr_pylibDATA
+.PRECIOUS: Makefile
+
cmtcr.so:
- $(CC) -g -Wall -pthread -shared ${CFLAGS} $(MTCR_DIR)/*.o -o cmtcr.so $(MFT_CORE_LIB)
+ $(CC) -g -Wall -pthread -shared ${CFLAGS} $(MTCR_DIR)/*.o -o cmtcr.so $(MFT_CORE_LIB_LINK)
# Tell versions [3.59,3.63) of GNU make to not export all variables.
# Otherwise a system limit (for SysV at least) may be exceeded.
diff --git a/mtcr_py/mtcr.py b/mtcr_py/mtcr.py
index 3990375..dfcca99 100644
--- a/mtcr_py/mtcr.py
+++ b/mtcr_py/mtcr.py
@@ -47,13 +47,16 @@ def insertField(val1, start1, val2, start2, size):
class MtcrException(Exception):
pass
+class CmdIfException(Exception):
+ pass
+
##########################
CMTCR = None
try:
from ctypes import *
ctypes.CDLL._func_restype_ = ctypes.c_ulonglong
if platform.system() == "Windows" or os.name == "nt":
- CMTCR = CDLL("libmtcr-1.dll", use_errno=True)
+ CMTCR = CDLL(".\\libmtcr-1.dll", use_errno=True)
else:
try:
CMTCR = CDLL("cmtcr.so", use_errno=True)
@@ -172,9 +175,9 @@ if CMTCR:
else:
import subprocess
import string
-
+
def getstatusoutput(cmd):
- pipe = subprocess.Popen(cmd, shell=True, stdout=subprocess.PIPE, stderr=subprocess.STDOUT)
+ pipe = subprocess.Popen(cmd, shell=False, stdout=subprocess.PIPE, stderr=subprocess.STDOUT)
cout = pipe.stdout
output = cout.read()
cout.close()
@@ -201,11 +204,11 @@ else:
##########################
def read4(self, addr):
- cmd = "mcra %s 0x%x" % (self.dev, addr)
+ cmd = ["mcra", self.dev, hex(addr)]
rc, out = getstatusoutput(cmd)
if rc:
raise MtcrException("Failed to read from mst device from address 0x%x: %s" % (addr, out))
- return string.atoi(out, 16)
+ return int(out, 16)
##########################
def readField(self, addr, startBit, size):
@@ -213,7 +216,7 @@ else:
##########################
def write4(self, addr, val):
- cmd = "mcra %s 0x%x 0x%x" % (self.dev, addr, val)
+ cmd = ["mcra", self.dev, hex(addr), hex(val)]
rc, out = getstatusoutput(cmd)
if rc:
raise MtcrException("Failed to wrtie to mst device to address 0x%x: %s" % (addr, out))