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