« Previous | Next » 

Revision 3951690a

ID3951690a4a29e031492090131d001e5047938631

Added by Stefan Hajnoczi over 12 years ago

qemu-common: add QEMU_ALIGN_DOWN() and QEMU_ALIGN_UP() macros

Add macros for aligning a number to a multiple, for example:

QEMU_ALIGN_DOWN(500, 2000) = 0
QEMU_ALIGN_UP(500, 2000) = 2000

Since ALIGN_UP() is a common macro name use the QEMU_* namespace prefix.
Hopefully this will protect us from included headers that leak something
with a similar name.

Signed-off-by: Stefan Hajnoczi <>
Signed-off-by: Kevin Wolf <>

Files

  • added
  • modified
  • copied
  • renamed
  • deleted

View differences