[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PULL 09/29] Move QEMU_ALIGN_*() from qemu-common.h to qemu
From: |
Paolo Bonzini |
Subject: |
[Qemu-devel] [PULL 09/29] Move QEMU_ALIGN_*() from qemu-common.h to qemu/osdep.h |
Date: |
Tue, 22 Mar 2016 15:16:49 +0100 |
From: Markus Armbruster <address@hidden>
qemu-common.h should only be included by .c files. Its file comment
explains why: "No header file should depend on qemu-common.h, as this
would easily lead to circular header dependencies."
One of the reasons for headers to include it is QEMU_ALIGN_UP() and
QEMU_ALIGN_DOWN(). Move them next to ROUND_UP() in qemu/osdep.h, to
facilitate removing these ill-advised includes later on.
Signed-off-by: Markus Armbruster <address@hidden>
Signed-off-by: Paolo Bonzini <address@hidden>
---
include/qemu-common.h | 6 ------
include/qemu/osdep.h | 6 ++++++
2 files changed, 6 insertions(+), 6 deletions(-)
diff --git a/include/qemu-common.h b/include/qemu-common.h
index fbd999c..f272752 100644
--- a/include/qemu-common.h
+++ b/include/qemu-common.h
@@ -369,12 +369,6 @@ static inline uint8_t from_bcd(uint8_t val)
return ((val >> 4) * 10) + (val & 0x0f);
}
-/* Round number down to multiple */
-#define QEMU_ALIGN_DOWN(n, m) ((n) / (m) * (m))
-
-/* Round number up to multiple */
-#define QEMU_ALIGN_UP(n, m) QEMU_ALIGN_DOWN((n) + (m) - 1, (m))
-
#include "qemu/module.h"
/*
diff --git a/include/qemu/osdep.h b/include/qemu/osdep.h
index 64b06e3..97a7fa2 100644
--- a/include/qemu/osdep.h
+++ b/include/qemu/osdep.h
@@ -149,6 +149,12 @@ extern int daemon(int, int);
#define MIN_NON_ZERO(a, b) (((a) != 0 && (a) < (b)) ? (a) : (b))
#endif
+/* Round number down to multiple */
+#define QEMU_ALIGN_DOWN(n, m) ((n) / (m) * (m))
+
+/* Round number up to multiple */
+#define QEMU_ALIGN_UP(n, m) QEMU_ALIGN_DOWN((n) + (m) - 1, (m))
+
#ifndef ROUND_UP
#define ROUND_UP(n,d) (((n) + (d) - 1) & -(d))
#endif
--
2.5.0
- [Qemu-devel] [PULL 00/29] Miscellaneous changes for 2016-03-22, Paolo Bonzini, 2016/03/22
- [Qemu-devel] [PULL 02/29] Use scripts/clean-includes to drop redundant qemu/typedefs.h, Paolo Bonzini, 2016/03/22
- [Qemu-devel] [PULL 03/29] Clean up includes some more, Paolo Bonzini, 2016/03/22
- [Qemu-devel] [PULL 08/29] Move HOST_LONG_BITS from qemu-common.h to qemu/osdep.h, Paolo Bonzini, 2016/03/22
- [Qemu-devel] [PULL 04/29] fw_cfg: Split fw_cfg_keys.h off fw_cfg.h, Paolo Bonzini, 2016/03/22
- [Qemu-devel] [PULL 07/29] hw/pci/pci.h: Don't include qemu-common.h, Paolo Bonzini, 2016/03/22
- [Qemu-devel] [PULL 09/29] Move QEMU_ALIGN_*() from qemu-common.h to qemu/osdep.h,
Paolo Bonzini <=
- [Qemu-devel] [PULL 11/29] isa: Move DMA_transfer_handler from qemu-common.h to hw/isa/isa.h, Paolo Bonzini, 2016/03/22
- [Qemu-devel] [PULL 05/29] include/qemu/iov.h: Don't include qemu-common.h, Paolo Bonzini, 2016/03/22
- [Qemu-devel] [PULL 06/29] include/hw/hw.h: Don't include qemu-common.h, Paolo Bonzini, 2016/03/22
- [Qemu-devel] [PULL 10/29] Move ParallelIOArg from qemu-common.h to sysemu/char.h, Paolo Bonzini, 2016/03/22
- [Qemu-devel] [PULL 12/29] include/crypto: Include qapi-types.h or qemu/bswap.h instead of qemu-common.h, Paolo Bonzini, 2016/03/22
- [Qemu-devel] [PULL 13/29] hw: explicitly include qemu-common.h and cpu.h, Paolo Bonzini, 2016/03/22
- [Qemu-devel] [PULL 01/29] include/qemu/osdep.h: Don't include qapi/error.h, Paolo Bonzini, 2016/03/22
- [Qemu-devel] [PULL 14/29] Replaced get_tick_per_sec() by NANOSECONDS_PER_SECOND, Paolo Bonzini, 2016/03/22
- [Qemu-devel] [PULL 16/29] tcg: pass down TranslationBlock to tcg_code_gen, Paolo Bonzini, 2016/03/22
- [Qemu-devel] [PULL 21/29] qemu-log: dfilter-ise exec, out_asm, op and opt_op, Paolo Bonzini, 2016/03/22