qemu-e2k/include
Leonid Bloch 540b849261 include: Add a lookup table of sizes
Adding a lookup table for the powers of two, with the appropriate size
prefixes. This is needed when a size has to be stringified, in which
case something like '(1 * KiB)' would become a literal '(1 * (1L << 10))'
string. Powers of two are used very often for sizes, so such a table
will also make it easier and more intuitive to write them.

This table is generatred using the following AWK script:

BEGIN {
	suffix="KMGTPE";
	for(i=10; i<64; i++) {
		val=2**i;
		s=substr(suffix, int(i/10), 1);
		n=2**(i%10);
		pad=21-int(log(n)/log(10));
		printf("#define S_%d%siB %*d\n", n, s, pad, val);
	}
}

Signed-off-by: Leonid Bloch <lbloch@janustech.com>
Reviewed-by: Alberto Garcia <berto@igalia.com>
Reviewed-by: Kevin Wolf <kwolf@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2018-10-01 12:51:12 +02:00
..
block block: Allow changing 'detect-zeroes' on reopen 2018-10-01 12:51:12 +02:00
chardev chardev/char-fe: Fix typos 2018-08-23 13:32:50 +02:00
crypto tests: call qcrypto_init instead of gnutls_global_init 2018-07-24 17:33:39 +01:00
disas RISC-V Disassembler 2018-03-07 08:30:28 +13:00
exec ppc: Remove deprecated ppcemb target 2018-08-28 11:31:23 +10:00
fpu softfloat: Add scaling float-to-int routines 2018-08-24 13:17:30 +01:00
hw hw/qdev-core: Fix description of instance_init 2018-09-25 17:26:18 +02:00
io qio: non-default context for TLS handshake 2018-03-06 10:19:07 +00:00
libdecnumber Clean up ill-advised or unusual header guards 2016-07-12 16:20:46 +02:00
migration vmstate.h: Provide VMSTATE_UINT16_SUB_ARRAY 2018-08-14 17:17:20 +01:00
monitor monitor: Fix unsafe sharing of @cur_mon among threads 2018-07-23 14:00:03 +02:00
net net: Remove the deprecated -tftp, -bootp, -redir and -smb options 2018-08-31 09:53:03 +02:00
qapi Monitor patches for 2018-09-01 2018-09-24 15:43:33 +01:00
qemu include: Add a lookup table of sizes 2018-10-01 12:51:12 +02:00
qom qom: convert the CPU list to RCU 2018-08-23 18:46:25 +02:00
scsi pr-manager: add query-pr-managers QMP command 2018-06-28 19:05:35 +02:00
standard-headers fw_cfg: import & use linux/qemu_fw_cfg.h 2018-08-23 18:46:25 +02:00
sysemu fw_cfg: ignore suffixes in the bootdevice list dependent on machine class 2018-08-16 22:27:43 -03:00
ui dmabuf: add y0_top, pass it to spice 2018-08-24 08:40:11 +02:00
elf.h elf: Add EM_NANOMIPS value as a valid one for e_machine field 2018-08-24 17:51:59 +02:00
glib-compat.h glib: enforce the minimum required version and warn about old APIs 2018-06-29 12:22:28 +01:00
qemu-common.h qemu-options: Bail out on unsupported options instead of silently ignoring them 2018-05-09 00:13:39 +02:00
qemu-io.h qemu-io: Let command functions return error code 2018-06-11 16:18:45 +02:00
trace-tcg.h trace: get rid of generated-events.h/generated-events.c 2016-10-12 09:54:52 +02:00