Skip to contentSkip to conversation

NetBSD: use system-provided headers

PATCH Superseded Manuel Bouyer 2 participants 2 messages Jan 29, 2021

v2 of 3 Superseded Latest is v3 →

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 NetBSD: use system-provided headers

On NetBSD use the system-provided headers for ioctl and related definitions, they are up to date and have more chances to match the kernel's idea of the ioctls and structures.
Remove now-unused NetBSD/evtchn.h and NetBSD/privcmd.h.
Don't fail install if xen/sys/*.h are not present.

---
 tools/debugger/gdbsx/xg/xg_main.c      |   4 +
 tools/include/Makefile                 |   2 +
 tools/include/xen-sys/NetBSD/evtchn.h  |  86 --------------------
 tools/include/xen-sys/NetBSD/privcmd.h | 106 -------------------------
 tools/libs/call/private.h              |   4 +
 tools/libs/ctrl/xc_private.h           |   4 +
 tools/libs/foreignmemory/private.h     |   6 ++
 7 files changed, 20 insertions(+), 192 deletions(-)
 delete mode 100644 tools/include/xen-sys/NetBSD/evtchn.h
 delete mode 100644 tools/include/xen-sys/NetBSD/privcmd.h
tools/debugger/gdbsx/xg/xg_main.c +4 -0
index 4576c762af..903d60baed 100644
@@ -49,7 +49,11 @@
 #include "xg_public.h"
 #include <xen/version.h>
 #include <xen/domctl.h>
+#ifdef __NetBSD__
+#include <xen/xenio.h>
+#else
 #include <xen/sys/privcmd.h>
+#endif
 #include <xen/foreign/x86_32.h>
 #include <xen/foreign/x86_64.h>
 
tools/include/Makefile +2 -0
index 4d4ec5f974..04902397b7 100644
@@ -68,7 +68,9 @@ install: all
 	$(INSTALL_DATA) xen/foreign/*.h $(DESTDIR)$(includedir)/xen/foreign
 	$(INSTALL_DATA) xen/hvm/*.h $(DESTDIR)$(includedir)/xen/hvm
 	$(INSTALL_DATA) xen/io/*.h $(DESTDIR)$(includedir)/xen/io
+ifneq ($(wildcard xen/sys/*.h),)
 	$(INSTALL_DATA) xen/sys/*.h $(DESTDIR)$(includedir)/xen/sys
+endif
 	$(INSTALL_DATA) xen/xsm/*.h $(DESTDIR)$(includedir)/xen/xsm
 
 .PHONY: uninstall
tools/include/xen-sys/NetBSD/evtchn.h deleted +0 -86

86 lines not on this page · raw message

tools/include/xen-sys/NetBSD/privcmd.h deleted +0 -106

106 lines not on this page · raw message

tools/libs/call/private.h +4 -0
index 7944ac5baf..96922e03d5 100644
@@ -7,7 +7,11 @@
 #include <xencall.h>
 
 #include <xen/xen.h>
+#ifdef __NetBSD__
+#include <xen/xenio.h>
+#else
 #include <xen/sys/privcmd.h>
+#endif
 
 #ifndef PAGE_SHIFT /* Mini-os, Yukk */
 #define PAGE_SHIFT           12
tools/libs/ctrl/xc_private.h +4 -0
index f0b5f83ac8..68e388f488 100644
@@ -39,7 +39,11 @@
 #include <xenforeignmemory.h>
 #include <xendevicemodel.h>
 
+#ifdef __NetBSD__
+#include <xen/xenio.h>
+#else
 #include <xen/sys/privcmd.h>
+#endif
 
 #include <xen-tools/libs.h>
 
tools/libs/foreignmemory/private.h +6 -0
index 7e734ac61e..39f8e0b869 100644
@@ -8,7 +8,13 @@
 #include <xentoolcore_internal.h>
 
 #include <xen/xen.h>
+
+#ifdef __NetBSD__
+#include <xen/xen.h>
+#include <xen/xenio.h>
+#else
 #include <xen/sys/privcmd.h>
+#endif
 
 #ifndef PAGE_SHIFT /* Mini-os, Yukk */
 #define PAGE_SHIFT           12
Signature · 1 line
2.29.2
#1 lore raw

Sorry I forgot to change the Subject. It should have been [PATCH v3]

Signature · 3 lines
Manuel Bouyer <[email protected]>
     NetBSD: 26 ans d'experience feront toujours la difference
--