@@ -20,6 +20,9 @@
#define ACCESS_ONCE(x) (*(volatile typeof(x) *)&(x))
+#define XEN_MAJOR(v) (((v) >> 16) & 0xFFFF)
+#define XEN_MINOR(v) ((v) & 0xFFFF)
+
void __noreturn panic(const char *fmt, ...) __printf(1, 2);
#define ASSERT(cond) \
@@ -121,8 +121,8 @@ void test_main(void)
{
long rc, xen_version = hypercall_xen_version(XENVER_version, NULL);
- printk("Found Xen %ld.%ld\n",
- (xen_version >> 16) & 0xffff, xen_version & 0xffff);
+ printk("Found Xen %ld.%ld\n", XEN_MAJOR(xen_version),
+ XEN_MINOR(xen_version));
xtf_set_idte(X86_VEC_AVAIL, &idte);
These are just a simple macros obtaining major, minor values as returned by xen_version hypercall. Signed-off-by: Pawel Wieczorkiewicz <wipawel@amazon.de> --- include/xtf/lib.h | 3 +++ tests/xsa-213/main.c | 4 ++-- 2 files changed, 5 insertions(+), 2 deletions(-)