Lines 130-135
Link Here
|
130 |
#endif |
130 |
#endif |
131 |
#if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 1, 0) |
131 |
#if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 1, 0) |
132 |
# include <uapi/linux/mman.h> |
132 |
# include <uapi/linux/mman.h> |
|
|
133 |
# include <uapi/linux/sched/types.h> |
133 |
#endif |
134 |
#endif |
134 |
/* For the basic additions module */ |
135 |
/* For the basic additions module */ |
135 |
#include <linux/pci.h> |
136 |
#include <linux/pci.h> |
Lines 315-330
Link Here
|
315 |
* to be a bug in one of the many patches that redhat applied. |
316 |
* to be a bug in one of the many patches that redhat applied. |
316 |
* It should be safe to do this on less buggy linux kernels too. ;-) |
317 |
* It should be safe to do this on less buggy linux kernels too. ;-) |
317 |
*/ |
318 |
*/ |
|
|
319 |
#if LINUX_VERSION_CODE < KERNEL_VERSION(5,4,0) |
318 |
# define MY_CHANGE_PAGE_ATTR(pPages, cPages, prot) \ |
320 |
# define MY_CHANGE_PAGE_ATTR(pPages, cPages, prot) \ |
319 |
do { \ |
321 |
do { \ |
320 |
if (pgprot_val(prot) != pgprot_val(PAGE_KERNEL)) \ |
322 |
if (pgprot_val(prot) != pgprot_val(PAGE_KERNEL)) \ |
321 |
change_page_attr(pPages, cPages, prot); \ |
323 |
change_page_attr(pPages, cPages, prot); \ |
322 |
change_page_attr(pPages, cPages, prot); \ |
324 |
change_page_attr(pPages, cPages, prot); \ |
323 |
} while (0) |
325 |
} while (0) |
|
|
326 |
#else |
327 |
# define MY_CHANGE_PAGE_ATTR(pPages, cPages, prot) |
328 |
#endif |
324 |
# endif /* !RT_ARCH_AMD64 */ |
329 |
# endif /* !RT_ARCH_AMD64 */ |
325 |
#endif /* !NO_REDHAT_HACKS */ |
330 |
#endif /* !NO_REDHAT_HACKS */ |
326 |
|
331 |
|
327 |
#ifndef MY_CHANGE_PAGE_ATTR |
332 |
#ifndef MY_CHANGE_PAGE_ATTR |
|
|
333 |
#if LINUX_VERSION_CODE < KERNEL_VERSION(5,4,0) |
334 |
|
328 |
# ifdef RT_ARCH_AMD64 /** @todo This is a cheap hack, but it'll get around that 'else BUG();' in __change_page_attr(). */ |
335 |
# ifdef RT_ARCH_AMD64 /** @todo This is a cheap hack, but it'll get around that 'else BUG();' in __change_page_attr(). */ |
329 |
# define MY_CHANGE_PAGE_ATTR(pPages, cPages, prot) \ |
336 |
# define MY_CHANGE_PAGE_ATTR(pPages, cPages, prot) \ |
330 |
do { \ |
337 |
do { \ |
Lines 334-342
Link Here
|
334 |
# else |
341 |
# else |
335 |
# define MY_CHANGE_PAGE_ATTR(pPages, cPages, prot) change_page_attr(pPages, cPages, prot) |
342 |
# define MY_CHANGE_PAGE_ATTR(pPages, cPages, prot) change_page_attr(pPages, cPages, prot) |
336 |
# endif |
343 |
# endif |
|
|
344 |
#else |
345 |
# define MY_CHANGE_PAGE_ATTR(pPages, cPages, prot) |
346 |
#endif |
337 |
#endif |
347 |
#endif |
338 |
|
348 |
|
339 |
#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 25) |
349 |
#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 25) && LINUX_VERSION_CODE < KERNEL_VERSION(5,4,0) |
340 |
# define MY_SET_PAGES_EXEC(pPages, cPages) set_pages_x(pPages, cPages) |
350 |
# define MY_SET_PAGES_EXEC(pPages, cPages) set_pages_x(pPages, cPages) |
341 |
# define MY_SET_PAGES_NOEXEC(pPages, cPages) set_pages_nx(pPages, cPages) |
351 |
# define MY_SET_PAGES_NOEXEC(pPages, cPages) set_pages_nx(pPages, cPages) |
342 |
#else |
352 |
#else |