include/qemu/osdep.h: Add a macro to check for alignment

Backports commit 18a60a76147569ca9e11b0607e50ce4012fe1aaa from qemu
This commit is contained in:
Sergey Fedorov 2018-02-23 20:15:30 -05:00 committed by Lioncash
parent 170f6e0b3b
commit 47eac70cb9
No known key found for this signature in database
GPG key ID: 4E3C3CC1031BA9C7

View file

@ -144,6 +144,9 @@
/* Round number up to multiple */
#define QEMU_ALIGN_UP(n, m) QEMU_ALIGN_DOWN((n) + (m) - 1, (m))
/* Check if n is a multiple of m */
#define QEMU_IS_ALIGNED(n, m) (((n) % (m)) == 0)
#ifndef ROUND_UP
#define ROUND_UP(n,d) (((n) + (d) - 1) & -(d))
#endif