void-packages/srcpkgs/catalyst/files/grsec_arch.patch
2016-04-02 07:34:20 +02:00

77 lines
2.8 KiB
Diff

diff -uNr 15.12/common/lib/modules/fglrx//build_mod/firegl_public.c 15.12b/common/lib/modules/fglrx//build_mod/firegl_public.c
--- 15.12/common/lib/modules/fglrx//build_mod/firegl_public.c 2015-12-19 21:14:13.251002548 +0100
+++ 15.12b/common/lib/modules/fglrx//build_mod/firegl_public.c 2015-12-19 21:36:27.703783498 +0100
@@ -6465,11 +6465,21 @@
if(static_cpu_has(X86_FEATURE_XSAVE)) {
#if LINUX_VERSION_CODE >= KERNEL_VERSION(4,4,0)
+#ifdef CONFIG_GRKERNSEC
+ copy_xregs_to_kernel(&fpu->state->xsave);
+ if (!(fpu->state->xsave.header.xfeatures & XFEATURE_MASK_FP))
+#else
copy_xregs_to_kernel(&fpu->state.xsave);
if (!(fpu->state.xsave.header.xfeatures & XFEATURE_MASK_FP))
+#endif
#elif LINUX_VERSION_CODE >= KERNEL_VERSION(4,2,0)
+#ifdef CONFIG_GRKERNSEC
+ copy_xregs_to_kernel(&fpu->state->xsave);
+ if (!(fpu->state->xsave.header.xfeatures & XSTATE_FP))
+#else
copy_xregs_to_kernel(&fpu->state.xsave);
if (!(fpu->state.xsave.header.xfeatures & XSTATE_FP))
+#endif
#else
fpu_xsave(fpu);
if (!(fpu->state->xsave.xsave_hdr.xstate_bv & XSTATE_FP))
@@ -6486,8 +6496,12 @@
#if LINUX_VERSION_CODE < KERNEL_VERSION(4,2,0)
: [fx] "=m" (fpu->state->fsave));
#else
+#ifdef CONFIG_GRKERNSEC
+ : [fx] "=m" (fpu->state->fsave));
+#else
: [fx] "=m" (fpu->state.fsave));
#endif
+#endif
return 0;
}
diff -uNr 15.12/common/lib/modules/fglrx//build_mod/kcl_acpi.c 15.12b/common/lib/modules/fglrx//build_mod/kcl_acpi.c
--- 15.12/common/lib/modules/fglrx//build_mod/kcl_acpi.c 2015-12-19 21:14:13.247669219 +0100
+++ 15.12b/common/lib/modules/fglrx//build_mod/kcl_acpi.c 2015-12-19 21:10:27.224899708 +0100
@@ -145,7 +145,11 @@
return NOTIFY_OK;
}
+#ifdef CONFIG_GRKERNSEC
+static notifier_block_no_const firegl_acpi_lid_notifier = {
+#else
static struct notifier_block firegl_acpi_lid_notifier = {
+#endif
.notifier_call = firegl_acpi_lid_event,
};
#endif
@@ -400,7 +404,11 @@
KCL_DEBUG_ERROR ("Could not allocate enough memory for video notifier_block\n");
return -ENOMEM;
}
+#ifdef CONFIG_GRKERNSEC
+ ((notifier_block_no_const*)(*nb))->notifier_call = firegl_acpi_video_event;
+#else
((struct notifier_block*)(*nb))->notifier_call = firegl_acpi_video_event;
+#endif
return register_acpi_notifier((struct notifier_block*)(*nb));
}
@@ -413,7 +421,11 @@
KCL_DEBUG_ERROR ("Could not allocate enough memory for ac notifier_block\n");
return -ENOMEM;
}
+#ifdef CONFIG_GRKERNSEC
+ ((notifier_block_no_const*)(*nb))->notifier_call = firegl_acpi_ac_event;
+#else
((struct notifier_block*)(*nb))->notifier_call = firegl_acpi_ac_event;
+#endif
return register_acpi_notifier((struct notifier_block*)(*nb));
}