Code:
Common subdirectories: ./build_mod.back/2.6.x and ./build_mod/2.6.x
diff -uN ./build_mod.back/agp3.c ./build_mod/agp3.c
--- ./build_mod.back/agp3.c 2006-08-17 16:10:12.000000000 +0000
+++ ./build_mod/agp3.c 2007-10-18 23:19:38.000000000 +0000
@@ -55,13 +55,13 @@
*
*/
+#include <linux/utsrelease.h>
#include <linux/version.h>
#ifdef MODVERSIONS
#if LINUX_VERSION_CODE < KERNEL_VERSION(2,5,71)
#include <linux/modversions.h>
#endif
#endif
-#include <linux/config.h>
#include <linux/module.h>
#include <linux/pci.h>
#include <linux/init.h>
diff -uN ./build_mod.back/agpgart_be.c ./build_mod/agpgart_be.c
--- ./build_mod.back/agpgart_be.c 2006-08-17 16:10:12.000000000 +0000
+++ ./build_mod/agpgart_be.c 2007-10-18 23:20:23.000000000 +0000
@@ -92,6 +92,7 @@
#define EXPORT_SYMTAB
#endif /* Original AGPGART module */
+#include <linux/utsrelease.h>
#include <linux/version.h>
#ifdef MODVERSIONS
#if LINUX_VERSION_CODE < KERNEL_VERSION(2,5,71)
@@ -99,7 +100,6 @@
#endif
#endif
-#include <linux/config.h>
#include <linux/module.h>
diff -uN ./build_mod.back/drm.h ./build_mod/drm.h
--- ./build_mod.back/drm.h 2006-08-17 16:10:12.000000000 +0000
+++ ./build_mod/drm.h 2007-10-18 23:18:17.000000000 +0000
@@ -38,7 +38,6 @@
#define _DRM_H_
#if defined(__linux__)
-#include <linux/config.h>
#include <asm/ioctl.h> /* For _IO* macros */
#define DRM_IOCTL_NR(n) _IOC_NR(n)
#define DRM_IOC_VOID _IOC_NONE
diff -uN ./build_mod.back/drmP.h ./build_mod/drmP.h
--- ./build_mod.back/drmP.h 2006-08-17 16:10:13.000000000 +0000
+++ ./build_mod/drmP.h 2007-10-18 23:20:50.000000000 +0000
@@ -42,7 +42,6 @@
* can build the DRM (part of PI DRI). 4/21/2000 S + B */
#include <asm/current.h>
#endif /* __alpha__ */
-#include <linux/config.h>
#include <linux/module.h>
#include <linux/kernel.h>
#include <linux/miscdevice.h>
@@ -51,6 +50,7 @@
#include <linux/init.h>
#include <linux/file.h>
#include <linux/pci.h>
+#include <linux/utsrelease.h>
#include <linux/version.h>
#include <linux/sched.h>
#include <linux/smp_lock.h> /* For (un)lock_kernel */
diff -uN ./build_mod.back/firegl_public.c ./build_mod/firegl_public.c
--- ./build_mod.back/firegl_public.c 2006-08-17 16:10:13.000000000 +0000
+++ ./build_mod/firegl_public.c 2007-10-18 23:21:18.000000000 +0000
@@ -22,6 +22,7 @@
#endif /* !MODULE */
// ============================================================
+#include <linux/utsrelease.h>
#include <linux/version.h>
#ifdef MODVERSIONS
#if LINUX_VERSION_CODE < KERNEL_VERSION(2,5,71)
@@ -69,7 +70,6 @@
#ifdef CONFIG_MEM_MIRROR
/* Prevent linux/config.h from being included again in subsequent
* kernel headers as that would redefine CONFIG_MEM_MIRROR. */
-#include <linux/config.h>
#warning "Disabling CONFIG_MEM_MIRROR because it does not work with non-GPL modules."
#warning "This will break page tracking when the fglrx kernel module is used."
#undef CONFIG_MEM_MIRROR
@@ -86,7 +86,6 @@
#include <asm/unistd.h> /* for installing the patch wrapper */
#include <linux/module.h>
-#include <linux/config.h>
#include <linux/kernel.h>
#include <linux/fs.h>
#include <linux/proc_fs.h>
@@ -176,6 +175,70 @@
int errno;
#endif // __ia64__
+#if defined(__i386__)
+#define __syscall_return(type, res) \
+do { \
+ if ((unsigned long)(res) >= (unsigned long)(-(128 + 1))) { \
+ errno = -(res); \
+ res = -1; \
+ } \
+ return (type) (res); \
+} while (0)
+#define _syscall2(type,name,type1,arg1,type2,arg2) \
+type name(type1 arg1,type2 arg2) \
+{ \
+long __res; \
+__asm__ volatile ("push %%ebx ; movl %2,%%ebx ; int $0x80 ; pop %%ebx" \
+ : "=a" (__res) \
+ : "0" (__NR_##name),"ri" ((long)(arg1)),"c" ((long)(arg2)) \
+ : "memory"); \
+__syscall_return(type,__res); \
+}
+
+#define _syscall3(type,name,type1,arg1,type2,arg2,type3,arg3) \
+type name(type1 arg1,type2 arg2,type3 arg3) \
+{ \
+long __res; \
+__asm__ volatile ("push %%ebx ; movl %2,%%ebx ; int $0x80 ; pop %%ebx" \
+ : "=a" (__res) \
+ : "0" (__NR_##name),"ri" ((long)(arg1)),"c" ((long)(arg2)), \
+ "d" ((long)(arg3)) : "memory"); \
+__syscall_return(type,__res); \
+}
+#elif defined(__x86_64__)
+#define __syscall_clobber "r11","rcx","memory"
+#define __syscall "syscall"
+
+#define __syscall_return(type, res) \
+do { \
+ if ((unsigned long)(res) >= (unsigned long)(-127)) { \
+ errno = -(res); \
+ res = -1; \
+ } \
+ return (type) (res); \
+} while (0)
+#define _syscall2(type,name,type1,arg1,type2,arg2) \
+type name(type1 arg1,type2 arg2) \
+{ \
+long __res; \
+__asm__ volatile (__syscall \
+ : "=a" (__res) \
+ : "0" (__NR_##name),"D" ((long)(arg1)),"S" ((long)(arg2)) : __syscall_clobber ); \
+__syscall_return(type,__res); \
+}
+
+#define _syscall3(type,name,type1,arg1,type2,arg2,type3,arg3) \
+type name(type1 arg1,type2 arg2,type3 arg3) \
+{ \
+long __res; \
+__asm__ volatile (__syscall \
+ : "=a" (__res) \
+ : "0" (__NR_##name),"D" ((long)(arg1)),"S" ((long)(arg2)), \
+ "d" ((long)(arg3)) : __syscall_clobber); \
+__syscall_return(type,__res); \
+}
+#endif
+
// int mlock(const void *addr, size_t len);
_syscall2(int, mlock, const void *, addr, size_t, len )
// int munlock(const void *addr, size_t len);
@@ -1585,7 +1648,7 @@
// To enable serial port debug message dumping,just define _KE_SERIAL_DEBUG in firegl_public.h file.
// Connect two PC with a null modern serial cable. run Hyper ternimal on the remote machine.
// It's useful to debug resume if network not works properly and serial port is not recovered
-// properly when fglrx resume hook is called...
+// properly when fglrx resume hook is called...
#define SER_DATA_PORT 0x3f8
diff -uN ./build_mod.back/i7505-agp.c ./build_mod/i7505-agp.c
--- ./build_mod.back/i7505-agp.c 2006-08-17 16:10:12.000000000 +0000
+++ ./build_mod/i7505-agp.c 2007-10-18 23:21:35.000000000 +0000
@@ -28,6 +28,7 @@
* - Allocate more than order 0 pages to avoid too much linear map splitting.
*/
+#include <linux/utsrelease.h>
#include <linux/version.h>
#ifdef MODVERSIONS
#if LINUX_VERSION_CODE < KERNEL_VERSION(2,5,71)
diff -uN ./build_mod.back/make.sh ./build_mod/make.sh
--- ./build_mod.back/make.sh 2006-08-17 16:10:12.000000000 +0000
+++ ./build_mod/make.sh 2007-10-18 23:18:17.000000000 +0000
@@ -203,9 +203,9 @@
# ==============================================================
# locate and verify contents of kernel include file path
-# verify match with respective line in linux/version.h
+# verify match with respective line in linux/utsrelease.h
# sample: #define UTS_RELEASE "2.4.0-test7"
-src_file=$linuxincludes/linux/version.h
+src_file=$linuxincludes/linux/utsrelease.h
if [ ! -e $src_file ];
then
echo "kernel includes at $linuxincludes not found or incomplete" | tee -a $logfile
diff -uN ./build_mod.back/nvidia-agp.c ./build_mod/nvidia-agp.c
--- ./build_mod.back/nvidia-agp.c 2006-08-17 16:10:12.000000000 +0000
+++ ./build_mod/nvidia-agp.c 2007-10-18 23:21:54.000000000 +0000
@@ -5,6 +5,7 @@
* generci back port to 2.4 and module embedding by Alexander Stohr.
*/
+#include <linux/utsrelease.h>
#include <linux/version.h>
#ifdef MODVERSIONS
#if LINUX_VERSION_CODE < KERNEL_VERSION(2,5,71)
4. Copy the patch to /lib/modules/fglrx/build_mod