aboutsummaryrefslogtreecommitdiffstats
path: root/tools/libxc/xc_private.h
diff options
context:
space:
mode:
authorkfraser@localhost.localdomain <kfraser@localhost.localdomain>2006-10-23 09:52:51 +0100
committerkfraser@localhost.localdomain <kfraser@localhost.localdomain>2006-10-23 09:52:51 +0100
commita3fc4d842ee8ff9de41a234d0dfc4252ea3f19ec (patch)
tree206b826018b807ed533391714457157a1b11d888 /tools/libxc/xc_private.h
parent7aae32885d19d76db269b7231a313d3c91a1e10a (diff)
downloadxen-a3fc4d842ee8ff9de41a234d0dfc4252ea3f19ec.tar.gz
xen-a3fc4d842ee8ff9de41a234d0dfc4252ea3f19ec.tar.bz2
xen-a3fc4d842ee8ff9de41a234d0dfc4252ea3f19ec.zip
[SOLARIS] Don't mlock() hypercall buffers.
On solaris mlock requires a page aligned address and mlock doesn't ensure the pages won't minor page fault. Signed-off-by: Mark Johnson <mark.johnson@sun.com>
Diffstat (limited to 'tools/libxc/xc_private.h')
-rw-r--r--tools/libxc/xc_private.h11
1 files changed, 7 insertions, 4 deletions
diff --git a/tools/libxc/xc_private.h b/tools/libxc/xc_private.h
index 811a7eee21..73c870bdb7 100644
--- a/tools/libxc/xc_private.h
+++ b/tools/libxc/xc_private.h
@@ -66,6 +66,9 @@ do { \
errno = __saved_errno; \
} while (0)
+int lock_pages(void *addr, size_t len);
+void unlock_pages(void *addr, size_t len);
+
#define PERROR(_m, _a...) \
do { \
int __saved_errno = errno; \
@@ -104,7 +107,7 @@ static inline int do_domctl(int xc_handle, struct xen_domctl *domctl)
hypercall.op = __HYPERVISOR_domctl;
hypercall.arg[0] = (unsigned long)domctl;
- if ( mlock(domctl, sizeof(*domctl)) != 0 )
+ if ( lock_pages(domctl, sizeof(*domctl)) != 0 )
{
PERROR("Could not lock memory for Xen hypercall");
goto out1;
@@ -117,7 +120,7 @@ static inline int do_domctl(int xc_handle, struct xen_domctl *domctl)
" rebuild the user-space tool set?\n");
}
- safe_munlock(domctl, sizeof(*domctl));
+ unlock_pages(domctl, sizeof(*domctl));
out1:
return ret;
@@ -133,7 +136,7 @@ static inline int do_sysctl(int xc_handle, struct xen_sysctl *sysctl)
hypercall.op = __HYPERVISOR_sysctl;
hypercall.arg[0] = (unsigned long)sysctl;
- if ( mlock(sysctl, sizeof(*sysctl)) != 0 )
+ if ( lock_pages(sysctl, sizeof(*sysctl)) != 0 )
{
PERROR("Could not lock memory for Xen hypercall");
goto out1;
@@ -146,7 +149,7 @@ static inline int do_sysctl(int xc_handle, struct xen_sysctl *sysctl)
" rebuild the user-space tool set?\n");
}
- safe_munlock(sysctl, sizeof(*sysctl));
+ unlock_pages(sysctl, sizeof(*sysctl));
out1:
return ret;