Created
March 28, 2017 08:06
-
-
Save max-verem/2421a6319c88691e24e7de7b92033cc8 to your computer and use it in GitHub Desktop.
blackmagic-10.8.5a4 under Fedora 25
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- blackmagic-10.8.5a4/blackmagic_lib.c.origin 2017-02-21 01:42:18.000000000 +0200 | |
+++ blackmagic-10.8.5a4/blackmagic_lib.c 2017-03-28 10:54:51.205782144 +0300 | |
@@ -662,7 +662,16 @@ | |
write = 0; | |
down_read(¤t_task->mm->mmap_sem); | |
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 6, 0) | |
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 9, 0) | |
+ if (current_task == current) | |
+ ret = get_user_pages((unsigned long)ptr & PAGE_MASK, *nr_pages, write ? FOLL_WRITE : 0, pages, NULL); | |
+ else | |
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 10, 0) | |
+ ret = get_user_pages_remote(current_task, current_task->mm, (unsigned long)ptr & PAGE_MASK, *nr_pages, write ? FOLL_WRITE : 0, pages, NULL, NULL); | |
+#else | |
+ ret = get_user_pages_remote(current_task, current_task->mm, (unsigned long)ptr & PAGE_MASK, *nr_pages, write ? FOLL_WRITE : 0, pages, NULL); | |
+#endif | |
+#elif LINUX_VERSION_CODE >= KERNEL_VERSION(4, 6, 0) | |
if (current_task == current) | |
ret = get_user_pages((unsigned long)ptr & PAGE_MASK, *nr_pages, write, 0, pages, NULL); | |
else |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- blackmagic-io-10.8.5a4/bm_mm.c.origin 2017-02-21 01:42:18.000000000 +0200 | |
+++ blackmagic-io-10.8.5a4/bm_mm.c 2017-03-28 10:56:10.775912864 +0300 | |
@@ -103,7 +103,16 @@ | |
return false; | |
down_read(&task->mm->mmap_sem); | |
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 6, 0) | |
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 9, 0) | |
+ if (current_task == current) | |
+ ret = get_user_pages((unsigned long)address & PAGE_MASK, umem->length, write ? FOLL_WRITE : 0, umem->pages, NULL); | |
+ else | |
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 10, 0) | |
+ ret = get_user_pages_remote(task, task->mm, (unsigned long)address & PAGE_MASK, umem->length, write ? FOLL_WRITE : 0, umem->pages, NULL, NULL); | |
+#else | |
+ ret = get_user_pages_remote(task, task->mm, (unsigned long)address & PAGE_MASK, umem->length, write ? FOLL_WRITE : 0, umem->pages, NULL); | |
+#endif | |
+#elif LINUX_VERSION_CODE >= KERNEL_VERSION(4, 6, 0) | |
if (task == current) | |
ret = get_user_pages((unsigned long)address & PAGE_MASK, umem->length, write, 0, umem->pages, NULL); | |
else |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment