05e1952f64
The Xen virtual machine monitor allows running several virtual machines on a single physical machine. The xentools12 package contains the tools to create, destroy and control the virtual machines. The xentools12 package contains the tools for Xen v1.2.
29 lines
738 B
Text
29 lines
738 B
Text
$NetBSD: patch-ak,v 1.1 2004/05/08 18:24:00 cl Exp $
|
|
|
|
--- xc/lib/xc_private.c.orig 2004-04-18 04:29:09.000000000 +0200
|
|
+++ xc/lib/xc_private.c
|
|
@@ -8,7 +8,7 @@
|
|
|
|
int init_pfn_mapper(void)
|
|
{
|
|
- return open("/dev/mem", O_RDWR);
|
|
+ return open("/kern/xen/machmem", O_RDWR);
|
|
}
|
|
|
|
int close_pfn_mapper(int pm_handle)
|
|
@@ -25,6 +25,15 @@ void *map_pfn(int pm_handle, unsigned lo
|
|
return vaddr;
|
|
}
|
|
|
|
+void *map_pfn_ro(int pm_handle, unsigned long pfn)
|
|
+{
|
|
+ void *vaddr = mmap(NULL, PAGE_SIZE, PROT_READ,
|
|
+ MAP_SHARED, pm_handle, pfn << PAGE_SHIFT);
|
|
+ if ( vaddr == MAP_FAILED )
|
|
+ return NULL;
|
|
+ return vaddr;
|
|
+}
|
|
+
|
|
void unmap_pfn(int pm_handle, void *vaddr)
|
|
{
|
|
(void)munmap(vaddr, PAGE_SIZE);
|