diff options
author | David Sommerseth <davids@redhat.com> | 2013-07-08 19:36:35 +0200 |
---|---|---|
committer | David Sommerseth <davids@redhat.com> | 2013-07-08 19:36:35 +0200 |
commit | 4ca9576b4090fcc48868e5e362d162e1544e8660 (patch) | |
tree | 61e46edf5ba93ff4e8f4e408e833c5ecae818a14 /src/util.c | |
parent | 8528590126026d7ed2e7910bafc97f4dc5bc71f4 (diff) | |
download | python-dmidecode-4ca9576b4090fcc48868e5e362d162e1544e8660.tar.gz python-dmidecode-4ca9576b4090fcc48868e5e362d162e1544e8660.tar.xz python-dmidecode-4ca9576b4090fcc48868e5e362d162e1544e8660.zip |
Rebase against upstream dmidecode v2.11
This includes an update against the SMBIOS reference specification v2.7.0
Signed-off-by: David Sommerseth <davids@redhat.com>
Diffstat (limited to 'src/util.c')
-rw-r--r-- | src/util.c | 15 |
1 files changed, 15 insertions, 0 deletions
@@ -191,3 +191,18 @@ void *mem_chunk(Log_t *logp, size_t base, size_t len, const char *devmem) return p; } +/* Returns end - start + 1, assuming start < end */ +u64 u64_range(u64 start, u64 end) +{ + u64 res; + + res.h = end.h - start.h; + res.l = end.l - start.l; + + if (end.l < start.l) + res.h--; + if (++res.l == 0) + res.h++; + + return res; +} |