unicorn/qemu/util
Markus Armbruster eeef227560
range: Replace internal representation of Range
Range represents a range as follows. Member @start is the inclusive
lower bound, member @end is the exclusive upper bound. Zero @end is
special: if @start is also zero, the range is empty, else @end is to
be interpreted as 2^64. No other empty ranges may occur.

The range [0,2^64-1] cannot be represented. If you try to create it
with range_set_bounds1(), you get the empty range instead. If you try
to create it with range_set_bounds() or range_extend(), assertions
fail. Before range_set_bounds() existed, the open-coded creation
usually got you the empty range instead. Open deathtrap.

Moreover, the code dealing with the janus-faced @end is too clever by
half.

Dumb this down to a more pedestrian representation: members @lob and
@upb are inclusive lower and upper bounds. The empty range is encoded
as @lob = 1, @upb = 0.

Backports commit 6dd726a2bf1b800289d90a84d5fcb5ce7b78a8e1 from qemu
2018-02-25 00:44:36 -05:00
..
bitmap.c util: Clean up includes 2018-02-19 01:27:55 -05:00
bitops.c util: Clean up includes 2018-02-19 01:27:55 -05:00
crc32c.c util: Clean up includes 2018-02-19 01:27:55 -05:00
cutils.c util: move declarations out of qemu-common.h 2018-02-22 09:25:48 -05:00
error.c include/qemu/osdep.h: Don't include qapi/error.h 2018-02-21 23:08:18 -05:00
getauxval.c util: Clean up includes 2018-02-19 01:27:55 -05:00
host-utils.c util: Clean up includes 2018-02-19 01:27:55 -05:00
Makefile.objs range: Create range.c for code that should not be inline 2018-02-24 23:59:13 -05:00
mmap-alloc.c util: Clean up includes 2018-02-19 01:27:55 -05:00
module.c util: Clean up includes 2018-02-19 01:27:55 -05:00
oslib-posix.c util: align memory allocations to 2M on AArch64 2018-02-23 13:56:59 -05:00
oslib-win32.c util: move declarations out of qemu-common.h 2018-02-22 09:25:48 -05:00
qemu-error.c util: Clean up includes 2018-02-19 01:27:55 -05:00
qemu-thread-posix.c util: Clean up includes 2018-02-19 01:27:55 -05:00
qemu-thread-win32.c util: Clean up includes 2018-02-19 01:27:55 -05:00
qemu-timer-common.c util: Clean up includes 2018-02-19 01:27:55 -05:00
range.c range: Replace internal representation of Range 2018-02-25 00:44:36 -05:00