mirror of
https://github.com/yuzu-emu/unicorn.git
synced 2025-01-22 22:01:06 +00:00
Move QEMU_ALIGN_*() from qemu-common.h to qemu/osdep.h
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. Backports commit e07e540aaa08718c9ff8213067a3dcef31b3e313 from qemu
This commit is contained in:
parent
6b1ebd16e6
commit
6730bd3131
|
@ -222,12 +222,6 @@ bool tcg_enabled(struct uc_struct *uc);
|
|||
struct uc_struct;
|
||||
void cpu_exec_init_all(struct uc_struct *uc);
|
||||
|
||||
/* 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"
|
||||
|
||||
/* vector definitions */
|
||||
|
|
|
@ -137,6 +137,12 @@
|
|||
#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
|
||||
|
|
Loading…
Reference in a new issue