# This is an experimental patch to make fglrx 8.476 compile, install and run
# under Linux kernel 2.6.25. The patch applies to the extracted fglrx
# installation archive. Note that the kernel must be patched or configured to
# export an unused symbol. Detailed installation instructions are available at
# http://www.frogge.de/pepper/patch/patch.html#fglrx
#
# (c) 19/04/2008 Dr. Martin Rogge
# E-mail: marogge at onlinehome dot de
#
# Distributed under the terms of the GPL.
# Absolutely no warranty. Use at your own risk.

--- common/lib/modules/fglrx/build_mod/firegl_public.c.orig	2008-04-10 20:20:59.000000000 +0200
+++ common/lib/modules/fglrx/build_mod/firegl_public.c	2008-04-18 00:16:03.000000000 +0200
@@ -1158,7 +1158,7 @@
 
 int ATI_API_CALL KCL_SetPageNoCache(void* virt, int pages)
 {
-    return change_page_attr(virt_to_page(virt), pages, PAGE_KERNEL_NOCACHE);
+    return set_memory_uc((unsigned long)virt, pages); // fix for 2.6.25
 }
 
 /** /brief Call global kernel task/thread scheduler */
@@ -1885,7 +1885,7 @@
  */
 KCL_TYPE_Cap ATI_API_CALL KCL_PosixSecurityCapGetEffectiveVector()
 {
-    return cap_t(current->cap_effective);
+    return (KCL_TYPE_Cap)(((current->cap_effective).cap)[0]); // fix for 2.6.25
 }
 
 /** \brief Set vector of effective security caps for the current process
@@ -1893,7 +1893,7 @@
  */
 void ATI_API_CALL KCL_PosixSecurityCapSetEffectiveVector(KCL_TYPE_Cap cap)
 {
-    cap_t(current->cap_effective) = cap;
+    ((current->cap_effective).cap)[0] = (__u32)cap; // fix for 2.6.25
 }
 
 /** \brief Get number of available RAM pages

