Commit a5499766 authored by Philippe Gerum's avatar Philippe Gerum Committed by Jan Kiszka
Browse files

cobalt/debug: switch to mmap_lock interface


Signed-off-by: Philippe Gerum's avatarPhilippe Gerum <rpm@xenomai.org>
Signed-off-by: Jan Kiszka's avatarJan Kiszka <jan.kiszka@siemens.com>
parent 4d1a5b7b
...@@ -239,7 +239,7 @@ void xndebug_trace_relax(int nr, unsigned long *backtrace, ...@@ -239,7 +239,7 @@ void xndebug_trace_relax(int nr, unsigned long *backtrace,
memset(&spot, 0, sizeof(spot)); memset(&spot, 0, sizeof(spot));
mm = get_task_mm(current); mm = get_task_mm(current);
down_read(&mm->mmap_sem); mmap_read_lock(mm);
for (n = 0, depth = 0; n < nr; n++) { for (n = 0, depth = 0; n < nr; n++) {
pc = backtrace[n]; pc = backtrace[n];
...@@ -278,7 +278,7 @@ void xndebug_trace_relax(int nr, unsigned long *backtrace, ...@@ -278,7 +278,7 @@ void xndebug_trace_relax(int nr, unsigned long *backtrace,
depth++; depth++;
} }
up_read(&mm->mmap_sem); mmap_read_unlock(mm);
mmput(mm); mmput(mm);
free_page((unsigned long)tmp); free_page((unsigned long)tmp);
......
...@@ -166,6 +166,13 @@ devm_hwmon_device_register_with_groups(struct device *dev, const char *name, ...@@ -166,6 +166,13 @@ devm_hwmon_device_register_with_groups(struct device *dev, const char *name,
#define __kernel_old_timeval timeval #define __kernel_old_timeval timeval
#endif #endif
#if LINUX_VERSION_CODE < KERNEL_VERSION(5,8,0)
#define mmap_read_lock(__mm) down_read(&mm->mmap_sem)
#define mmap_read_unlock(__mm) up_read(&mm->mmap_sem)
#define mmap_write_lock(__mm) down_write(&mm->mmap_sem)
#define mmap_write_unlock(__mm) up_write(&mm->mmap_sem)
#endif
#if LINUX_VERSION_CODE < KERNEL_VERSION(5,8,0) #if LINUX_VERSION_CODE < KERNEL_VERSION(5,8,0)
#define vmalloc_kernel(__size, __flags) __vmalloc(__size, GFP_KERNEL|__flags, PAGE_KERNEL) #define vmalloc_kernel(__size, __flags) __vmalloc(__size, GFP_KERNEL|__flags, PAGE_KERNEL)
#else #else
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment