ARM: use swap_access_process_vm() for user memory access
[platform/kernel/swap-modules.git] / kprobe / swap_kprobes_deps.c
index 2e2694a..9a54bb8 100644 (file)
@@ -453,7 +453,7 @@ int init_module_dependencies(void)
 }
 
 
-#ifdef CONFIG_ARM64
+#if defined(CONFIG_ARM) || defined(CONFIG_ARM64)
 
 static int do_access_process_vm(struct task_struct *tsk, struct mm_struct *mm,
                                unsigned long addr, void *buf, int len,
@@ -537,7 +537,7 @@ int swap_access_process_vm(struct task_struct *tsk, unsigned long addr,
 }
 EXPORT_SYMBOL_GPL(swap_access_process_vm);
 
-#else /* CONFIG_ARM64 */
+#else /* defined(CONFIG_ARM) || defined(CONFIG_ARM64) */
 
 #if LINUX_VERSION_CODE <= KERNEL_VERSION(2, 6, 38) /* FIXME: must be < 32 */
 #define GUP_FLAGS_WRITE                  0x1
@@ -1364,6 +1364,7 @@ int access_process_vm_atomic(struct task_struct *tsk, unsigned long addr,
 
        /* FIXME: danger: write memory in atomic context */
        atomic = in_atomic();
+       WARN_ON(atomic);
 
        /* ignore errors, just check how much was successfully transferred */
        while (len) {
@@ -1421,7 +1422,7 @@ int access_process_vm_atomic(struct task_struct *tsk, unsigned long addr,
 }
 EXPORT_SYMBOL_GPL(access_process_vm_atomic);
 
-#endif /* CONFIG_ARM64 */
+#endif /* defined(CONFIG_ARM) || defined(CONFIG_ARM64) */
 
 /**
  * @brief Page present.