[IA64] add helper function rcu_lock_target_domain_by_id()

Introduce helper function, rcu_lock_target_domain_by_id().

Signed-off-by: Isaku Yamahata <[EMAIL PROTECTED]>

diff -r 4a2b1b8dc9c2 xen/arch/ia64/xen/mm.c
--- a/xen/arch/ia64/xen/mm.c    Thu Oct 02 15:23:26 2008 +0900
+++ b/xen/arch/ia64/xen/mm.c    Thu Oct 02 15:24:17 2008 +0900
@@ -3134,6 +3134,23 @@
     return (efi_mem_type(p) == EFI_CONVENTIONAL_MEMORY);
 }
 
+int
+rcu_lock_target_domain_by_id(domid_t domid, struct domain **d)
+{
+    if (domid == DOMID_SELF)
+        *d = rcu_lock_current_domain();
+    else {
+        *d = rcu_lock_domain_by_id(domid);
+        if (d == NULL)
+            return -ESRCH;
+        if (!IS_PRIV_FOR(current->domain, *d)) {
+            rcu_lock_domain(*d);
+            return -EPERM;
+        }
+    }
+
+    return 0;
+}
 
 long
 arch_memory_op(int op, XEN_GUEST_HANDLE(void) arg)
diff -r 4a2b1b8dc9c2 xen/include/asm-ia64/domain.h
--- a/xen/include/asm-ia64/domain.h     Thu Oct 02 15:23:26 2008 +0900
+++ b/xen/include/asm-ia64/domain.h     Thu Oct 02 15:24:17 2008 +0900
@@ -316,6 +316,9 @@
            unsigned long iim, unsigned long itir, unsigned long arg5,
            unsigned long arg6, unsigned long arg7, unsigned long stack);
 
+int
+rcu_lock_target_domain_by_id(domid_t domid, struct domain **d);
+
 #endif /* __ASM_DOMAIN_H__ */
 
 /*
[IA64] add helper function rcu_lock_target_domain_by_id()

Introduce helper function, rcu_lock_target_domain_by_id().

Signed-off-by: Isaku Yamahata <[EMAIL PROTECTED]>

diff -r 4a2b1b8dc9c2 xen/arch/ia64/xen/mm.c
--- a/xen/arch/ia64/xen/mm.c	Thu Oct 02 15:23:26 2008 +0900
+++ b/xen/arch/ia64/xen/mm.c	Thu Oct 02 15:24:17 2008 +0900
@@ -3134,6 +3134,23 @@
     return (efi_mem_type(p) == EFI_CONVENTIONAL_MEMORY);
 }
 
+int
+rcu_lock_target_domain_by_id(domid_t domid, struct domain **d)
+{
+    if (domid == DOMID_SELF)
+        *d = rcu_lock_current_domain();
+    else {
+        *d = rcu_lock_domain_by_id(domid);
+        if (d == NULL)
+            return -ESRCH;
+        if (!IS_PRIV_FOR(current->domain, *d)) {
+            rcu_lock_domain(*d);
+            return -EPERM;
+        }
+    }
+
+    return 0;
+}
 
 long
 arch_memory_op(int op, XEN_GUEST_HANDLE(void) arg)
diff -r 4a2b1b8dc9c2 xen/include/asm-ia64/domain.h
--- a/xen/include/asm-ia64/domain.h	Thu Oct 02 15:23:26 2008 +0900
+++ b/xen/include/asm-ia64/domain.h	Thu Oct 02 15:24:17 2008 +0900
@@ -316,6 +316,9 @@
            unsigned long iim, unsigned long itir, unsigned long arg5,
            unsigned long arg6, unsigned long arg7, unsigned long stack);
 
+int
+rcu_lock_target_domain_by_id(domid_t domid, struct domain **d);
+
 #endif /* __ASM_DOMAIN_H__ */
 
 /*
_______________________________________________
Xen-ia64-devel mailing list
Xen-ia64-devel@lists.xensource.com
http://lists.xensource.com/xen-ia64-devel

Reply via email to