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

Loosely based on 076b35b5a5.

Suggested-by: Stefan Weil <sw@weilnetz.de>
Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Message-Id: <20180625124238.25339-2-f4bug@amsat.org>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
This commit is contained in:
Philippe Mathieu-Daudé 2018-06-25 09:41:53 -03:00 committed by Paolo Bonzini
parent 5c0ef67ac4
commit 7ecdc94c40
1 changed files with 20 additions and 0 deletions

20
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