]> xenbits.xensource.com Git - people/liuw/xen.git/commitdiff
hvmloader: use xen/errno.h rather than the host systems errno.h
authorAndrew Cooper <andrew.cooper3@citrix.com>
Mon, 7 Mar 2016 16:46:03 +0000 (17:46 +0100)
committerWei Liu <wei.liu2@citrix.com>
Tue, 15 Mar 2016 16:32:34 +0000 (16:32 +0000)
hvmloader is unhosted, and shouldn't use the system errno.h.  It already has
to use Xen's errno.h for other hypercalls.  The use of public/io/xs_wire.h
requires the use of un-prefixed errno values.

This fixes the build on stricter toolchains where requesting -fno-builtin does
reduce the include path as much as it can.

Reported-by: Doug Goldstein <cardoe@cardoe.com>
Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
Reviewed-by: Doug Goldstein <cardoe@cardoe.com>
Reviewed-by: Wei Liu <wei.liu2@citrix.com>
Acked-by: Jan Beulich <jbeulich@suse.com>
tools/firmware/hvmloader/util.h
tools/firmware/hvmloader/vnuma.c
tools/firmware/hvmloader/xenbus.c

index 132d915d879705c3e410624d10d93b7f84763d2c..31268175d83a2e2fd270222f04f5b20807eb5897 100644 (file)
@@ -9,6 +9,15 @@
 #include <xen/hvm/hvm_info_table.h>
 #include "e820.h"
 
+/* Request un-prefixed values from errno.h. */
+#define XEN_ERRNO(name, value) name = value,
+enum {
+#include <xen/errno.h>
+};
+
+/* Cause xs_wire.h to give us xsd_errors[]. */
+#define EINVAL EINVAL
+
 #define __STR(...) #__VA_ARGS__
 #define STR(...) __STR(__VA_ARGS__)
 
index 4121cc66a68c0a239fc5b68bec248fdbf4665e44..85c1a792c6dbca9f59b0d28dc26bbd466b930877 100644 (file)
@@ -28,7 +28,6 @@
 #include "util.h"
 #include "hypercall.h"
 #include "vnuma.h"
-#include <xen/errno.h>
 
 unsigned int nr_vnodes, nr_vmemranges;
 unsigned int *vcpu_to_vnode, *vdistance;
@@ -40,7 +39,7 @@ void init_vnuma_info(void)
     struct xen_vnuma_topology_info vnuma_topo = { .domid = DOMID_SELF };
 
     rc = hypercall_memory_op(XENMEM_get_vnumainfo, &vnuma_topo);
-    if ( rc != -XEN_ENOBUFS )
+    if ( rc != -ENOBUFS )
         return;
 
     ASSERT(vnuma_topo.nr_vcpus == hvm_info->nr_vcpus);
index d0ed993cca228836127b2cd89e4dc8daff55d213..448157dcb04a3c3114a38cf08854bb497b0a2982 100644 (file)
@@ -27,7 +27,6 @@
 
 #include "util.h"
 #include "hypercall.h"
-#include <errno.h>
 #include <xen/sched.h>
 #include <xen/event_channel.h>
 #include <xen/hvm/params.h>