summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorSimon Glass <sjg@chromium.org>2016-07-25 18:59:13 -0600
committerSimon Glass <sjg@chromium.org>2016-09-18 21:04:39 -0600
commit0170804f60b19a2033ac39964fcd192a0c7eda42 (patch)
treeb37fd3dca5b08d6683bd740952054199a2987342 /lib
parent346179f0d3383e88f7df117b13820df70f68c74a (diff)
dtoc: Move to using bytearray
Since we want to be able to change the in-memory device tree using libfdt, use a bytearray instead of a string. This makes interfacing from Python easier. Signed-off-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'lib')
-rw-r--r--lib/libfdt/libfdt.swig8
1 files changed, 8 insertions, 0 deletions
diff --git a/lib/libfdt/libfdt.swig b/lib/libfdt/libfdt.swig
index 14f583dfbe..26d42fc5d6 100644
--- a/lib/libfdt/libfdt.swig
+++ b/lib/libfdt/libfdt.swig
@@ -75,6 +75,14 @@ struct fdt_property {
}
%}
+%typemap(in) (const void *) {
+ if (!PyByteArray_Check($input)) {
+ SWIG_exception_fail(SWIG_TypeError, "in method '" "$symname" "', argument "
+ "$argnum"" of type '" "$type""'");
+ }
+ $1 = (void *) PyByteArray_AsString($input);
+}
+
const void *fdt_offset_ptr(const void *fdt, int offset, unsigned int checklen);
int fdt_path_offset(const void *fdt, const char *path);
int fdt_first_property_offset(const void *fdt, int nodeoffset);