summaryrefslogtreecommitdiff
path: root/sysutils/xentools48/patches/patch-tools_libs_foreignmemory_netbsd.c
diff options
context:
space:
mode:
authorbouyer <bouyer>2017-03-30 09:15:09 +0000
committerbouyer <bouyer>2017-03-30 09:15:09 +0000
commit8ba64941fe41e878286fc9d7f4a2cde3620db0d6 (patch)
treeffe9ceb0e6dab6876e61244847f47e3358b34154 /sysutils/xentools48/patches/patch-tools_libs_foreignmemory_netbsd.c
parent8fb2e8be5143e98e7e31d954cea1035559976988 (diff)
downloadpkgsrc-8ba64941fe41e878286fc9d7f4a2cde3620db0d6.tar.gz
Add xenkerne48 and xentools48, version 4.8.0.
This includes stub domains support, but it should be considered experimental at this time. Stub domains hangs with serial ports, or more more than one virual disk (multiple virtual ethernet have not been tested).
Diffstat (limited to 'sysutils/xentools48/patches/patch-tools_libs_foreignmemory_netbsd.c')
-rw-r--r--sysutils/xentools48/patches/patch-tools_libs_foreignmemory_netbsd.c48
1 files changed, 48 insertions, 0 deletions
diff --git a/sysutils/xentools48/patches/patch-tools_libs_foreignmemory_netbsd.c b/sysutils/xentools48/patches/patch-tools_libs_foreignmemory_netbsd.c
new file mode 100644
index 00000000000..bb4efab264f
--- /dev/null
+++ b/sysutils/xentools48/patches/patch-tools_libs_foreignmemory_netbsd.c
@@ -0,0 +1,48 @@
+$NetBSD: patch-tools_libs_foreignmemory_netbsd.c,v 1.1 2017/03/30 09:15:10 bouyer Exp $
+
+--- tools/libs/foreignmemory/netbsd.c.orig 2017-03-24 18:51:51.000000000 +0100
++++ tools/libs/foreignmemory/netbsd.c 2017-03-24 18:55:36.000000000 +0100
+@@ -19,7 +19,9 @@
+
+ #include <unistd.h>
+ #include <fcntl.h>
++#include <errno.h>
+ #include <sys/mman.h>
++#include <sys/ioctl.h>
+
+ #include "private.h"
+
+@@ -66,13 +68,13 @@
+ return close(fd);
+ }
+
+-void *osdep_map_foreign_batch(xenforeignmem_handle *fmem, uint32_t dom,
++void *osdep_map_foreign_batch(xenforeignmemory_handle *fmem, uint32_t dom,
+ int prot, xen_pfn_t *arr, int num)
+ {
+ int fd = fmem->fd;
+ privcmd_mmapbatch_t ioctlx;
+ void *addr;
+- addr = mmap(NULL, num*XC_PAGE_SIZE, prot, MAP_ANON | MAP_SHARED, -1, 0);
++ addr = mmap(NULL, num*PAGE_SIZE, prot, MAP_ANON | MAP_SHARED, -1, 0);
+ if ( addr == MAP_FAILED ) {
+ PERROR("osdep_map_foreign_batch: mmap failed");
+ return NULL;
+@@ -86,7 +88,7 @@
+ {
+ int saved_errno = errno;
+ PERROR("osdep_map_foreign_batch: ioctl failed");
+- (void)munmap(addr, num*XC_PAGE_SIZE);
++ (void)munmap(addr, num*PAGE_SIZE);
+ errno = saved_errno;
+ return NULL;
+ }
+@@ -97,7 +99,7 @@
+ int osdep_xenforeignmemory_unmap(xenforeignmemory_handle *fmem,
+ void *addr, size_t num)
+ {
+- return munmap(addr, num*XC_PAGE_SIZE);
++ return munmap(addr, num*PAGE_SIZE);
+ }
+
+ /*