aboutsummaryrefslogtreecommitdiff
path: root/lib/libmuser.c
diff options
context:
space:
mode:
authorThanos Makatos <thanos.makatos@nutanix.com>2019-09-05 07:30:09 -0400
committerFelipe Franciosi <felipe@nutanix.com>2019-09-05 16:45:35 +0100
commit9a3cd486d285f507bf8d151db3218af234889d6d (patch)
tree9bec12f54c246d4b02be0953671ceca3e97bd637 /lib/libmuser.c
parentab6e09fb512a60a422b2f6dcb54566d5a92bd157 (diff)
downloadlibvfio-user-9a3cd486d285f507bf8d151db3218af234889d6d.zip
libvfio-user-9a3cd486d285f507bf8d151db3218af234889d6d.tar.gz
libvfio-user-9a3cd486d285f507bf8d151db3218af234889d6d.tar.bz2
don't hardcode region shift
Signed-off-by: Thanos Makatos <thanos.makatos@nutanix.com>
Diffstat (limited to 'lib/libmuser.c')
-rw-r--r--lib/libmuser.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/libmuser.c b/lib/libmuser.c
index f04ece5..c10348c 100644
--- a/lib/libmuser.c
+++ b/lib/libmuser.c
@@ -417,10 +417,12 @@ dev_get_sparse_mmap_cap(lm_ctx_t *lm_ctx, lm_reg_info_t *lm_reg,
return 0;
}
+#define LM_REGION_SHIFT 40
+
uint64_t
region_offset(const uint32_t region)
{
- return (uint64_t)region << 40;
+ return (uint64_t)region << LM_REGION_SHIFT;
}
static long