diff options
author | kaf24@firebug.cl.cam.ac.uk <kaf24@firebug.cl.cam.ac.uk> | 2006-04-10 17:32:30 +0100 |
---|---|---|
committer | kaf24@firebug.cl.cam.ac.uk <kaf24@firebug.cl.cam.ac.uk> | 2006-04-10 17:32:30 +0100 |
commit | 7ddc2369b20e6b9e4f067585d8c7389b33b00abb (patch) | |
tree | e5f67d4e3efe54a59154433ee830d1b7cac31667 | |
parent | 201c3aa978b9874d91af95c19f8f36e112b4cccb (diff) | |
download | xen-7ddc2369b20e6b9e4f067585d8c7389b33b00abb.tar.gz xen-7ddc2369b20e6b9e4f067585d8c7389b33b00abb.tar.bz2 xen-7ddc2369b20e6b9e4f067585d8c7389b33b00abb.zip |
Fail the build if NR_hypercalls is not a power of two.
Making this requirement clearer originally suggested by
Muli Ben Yehuda.
Signed-off-by: Keir Fraser <keir@xensource.com>
-rw-r--r-- | xen/include/asm-x86/config.h | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/xen/include/asm-x86/config.h b/xen/include/asm-x86/config.h index 23aabeb2b9..35efb1ba63 100644 --- a/xen/include/asm-x86/config.h +++ b/xen/include/asm-x86/config.h @@ -65,8 +65,13 @@ #define barrier() __asm__ __volatile__("": : :"memory") +/* A power-of-two value greater than or equal to number of hypercalls. */ #define NR_hypercalls 32 +#if NR_hypercalls & (NR_hypercalls - 1) +#error "NR_hypercalls must be a power-of-two value" +#endif + #ifndef NDEBUG #define MEMORY_GUARD #ifdef __x86_64__ |