include: Add IEC binary prefixes in qemu/units.h

Loosely based on 076b35b5a56.

Backports commit 7ecdc94c40f4958a66893c0eac423c6a80f376d4 from qemu
This commit is contained in:
Philippe Mathieu-Daudé 2018-07-03 19:46:53 -04:00 committed by Lioncash
parent 8bd115214d
commit 26948b6b98
No known key found for this signature in database
GPG key ID: 4E3C3CC1031BA9C7

20
qemu/include/qemu/units.h Normal file
View file

@ -0,0 +1,20 @@
/*
* IEC binary prefixes definitions
*
* Copyright (C) 2015 Nikunj A Dadhania, IBM Corporation
* Copyright (C) 2018 Philippe Mathieu-Daudé <f4bug@amsat.org>
*
* SPDX-License-Identifier: GPL-2.0-or-later
*/
#ifndef QEMU_UNITS_H
#define QEMU_UNITS_H
#define KiB (INT64_C(1) << 10)
#define MiB (INT64_C(1) << 20)
#define GiB (INT64_C(1) << 30)
#define TiB (INT64_C(1) << 40)
#define PiB (INT64_C(1) << 50)
#define EiB (INT64_C(1) << 60)
#endif