diff options
author | Paolo Bonzini <pbonzini@redhat.com> | 2024-05-07 14:13:46 +0200 |
---|---|---|
committer | Paolo Bonzini <pbonzini@redhat.com> | 2024-05-10 15:45:15 +0200 |
commit | 1935b7ead18dbcbf459dbe7a8fd4253fbe1ed4d0 (patch) | |
tree | b9b4ead6229ed347134b9b74cd822a0933316953 /system | |
parent | 7a6f3343b6f140c945b62a972b36d22efa14bdba (diff) | |
download | qemu-1935b7ead18dbcbf459dbe7a8fd4253fbe1ed4d0.zip qemu-1935b7ead18dbcbf459dbe7a8fd4253fbe1ed4d0.tar.gz qemu-1935b7ead18dbcbf459dbe7a8fd4253fbe1ed4d0.tar.bz2 |
kconfig: allow compiling out QEMU device tree code per target
Introduce a new Kconfig symbol, CONFIG_DEVICE_TREE, that specifies whether
to include the common device tree code in system/device_tree.c and to
link to libfdt. For now, include it unconditionally if libfdt is
available.
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Diffstat (limited to 'system')
-rw-r--r-- | system/device_tree-stub.c | 10 | ||||
-rw-r--r-- | system/device_tree.c | 14 | ||||
-rw-r--r-- | system/meson.build | 4 |
3 files changed, 13 insertions, 15 deletions
diff --git a/system/device_tree-stub.c b/system/device_tree-stub.c new file mode 100644 index 0000000..bddda6f --- /dev/null +++ b/system/device_tree-stub.c @@ -0,0 +1,10 @@ +#include "qemu/osdep.h" +#include "qapi/error.h" +#include "qapi/qapi-commands-machine.h" + +#ifdef CONFIG_FDT +void qmp_dumpdtb(const char *filename, Error **errp) +{ + error_setg(errp, "This machine doesn't have a FDT"); +} +#endif diff --git a/system/device_tree.c b/system/device_tree.c index eb5166c..2e38259 100644 --- a/system/device_tree.c +++ b/system/device_tree.c @@ -668,20 +668,6 @@ void qmp_dumpdtb(const char *filename, Error **errp) } } -void hmp_dumpdtb(Monitor *mon, const QDict *qdict) -{ - const char *filename = qdict_get_str(qdict, "filename"); - Error *local_err = NULL; - - qmp_dumpdtb(filename, &local_err); - - if (hmp_handle_error(mon, local_err)) { - return; - } - - info_report("dtb dumped to %s", filename); -} - void qemu_fdt_randomize_seeds(void *fdt) { int noffset, poffset, len; diff --git a/system/meson.build b/system/meson.build index 25e2117..a296270 100644 --- a/system/meson.build +++ b/system/meson.build @@ -32,7 +32,9 @@ if have_tpm endif system_ss.add(when: seccomp, if_true: files('qemu-seccomp.c')) -system_ss.add(when: fdt, if_true: files('device_tree.c')) +system_ss.add(when: 'CONFIG_DEVICE_TREE', + if_true: [fdt, files('device_tree.c')], + if_false: files('device_tree-stub.c')) if host_os == 'linux' system_ss.add(files('async-teardown.c')) endif |