1 From 54b230e26a1889c08507e791ab043f8a4b4ff771 Mon Sep 17 00:00:00 2001
2 From: Romain Perier <romain.perier@free-electrons.com>
3 Date: Thu, 7 Jul 2016 14:40:53 +0200
4 Subject: [PATCH] Add support for Linux 4.4
6 It fixes various things like the use of seq_printf because its API
7 changed. It also replaces the call to mtrr_add and mtrr_del by
8 arch_phys_wc_add and arch_phys_wc_del because these symbols are
9 no longer exported for Linux >= 4.3.x.
11 Signed-off-by: Romain Perier <romain.perier@free-electrons.com>
13 common/lib/modules/fglrx/build_mod/firegl_public.c | 21 +++++++++++++++++++++
14 1 file changed, 21 insertions(+)
16 diff --git a/common/lib/modules/fglrx/build_mod/firegl_public.c b/common/lib/modules/fglrx/build_mod/firegl_public.c
17 index bb67bba..b4b2d30 100755
18 --- a/common/lib/modules/fglrx/build_mod/firegl_public.c
19 +++ b/common/lib/modules/fglrx/build_mod/firegl_public.c
20 @@ -636,9 +636,16 @@ static int firegl_major_proc_read(struct seq_file *m, void* data)
22 len = snprintf(buf, request, "%d\n", major);
25 +#if LINUX_VERSION_CODE >= KERNEL_VERSION(4,3,0)
26 + seq_printf(m, "%d\n", major);
29 len = seq_printf(m, "%d\n", major);
34 KCL_DEBUG1(FN_FIREGL_PROC, "return len=%i\n",len);
37 @@ -3432,7 +3439,11 @@ int ATI_API_CALL KCL_MEM_MTRR_Support(void)
38 int ATI_API_CALL KCL_MEM_MTRR_AddRegionWc(unsigned long base, unsigned long size)
41 +#if LINUX_VERSION_CODE >= KERNEL_VERSION(4,3,0)
42 + return arch_phys_wc_add(base, size);
44 return mtrr_add(base, size, MTRR_TYPE_WRCOMB, 1);
46 #else /* !CONFIG_MTRR */
48 #endif /* !CONFIG_MTRR */
49 @@ -3441,7 +3452,12 @@ int ATI_API_CALL KCL_MEM_MTRR_AddRegionWc(unsigned long base, unsigned long size
50 int ATI_API_CALL KCL_MEM_MTRR_DeleteRegion(int reg, unsigned long base, unsigned long size)
53 +#if LINUX_VERSION_CODE >= KERNEL_VERSION(4,3,0)
54 + arch_phys_wc_del(reg);
57 return mtrr_del(reg, base, size);
59 #else /* !CONFIG_MTRR */
61 #endif /* !CONFIG_MTRR */
62 @@ -6505,8 +6521,13 @@ static int KCL_fpu_save_init(struct task_struct *tsk)
63 if (!(fpu->state->xsave.xsave_hdr.xstate_bv & XSTATE_FP))
65 _copy_xregs_to_kernel(&fpu->state.xsave);
66 +#if LINUX_VERSION_CODE >= KERNEL_VERSION(4,4,0)
67 + if (!(fpu->state.xsave.header.xfeatures & XFEATURE_MASK_FP))
69 if (!(fpu->state.xsave.header.xfeatures & XSTATE_FP))
74 } else if (static_cpu_has(X86_FEATURE_FXSR)) {
75 #if LINUX_VERSION_CODE < KERNEL_VERSION(4,2,0)