SOURCES: X11-driver-firegl-ioctl32.patch - updated for 2.6.14 / te...

pluto pluto at pld-linux.org
Thu Nov 3 14:19:50 CET 2005


Author: pluto                        Date: Thu Nov  3 13:19:50 2005 GMT
Module: SOURCES                       Tag: HEAD
---- Log message:
- updated for 2.6.14 / tested / works.

---- Files affected:
SOURCES:
   X11-driver-firegl-ioctl32.patch (1.1 -> 1.2) 

---- Diffs:

================================================================
Index: SOURCES/X11-driver-firegl-ioctl32.patch
diff -u SOURCES/X11-driver-firegl-ioctl32.patch:1.1 SOURCES/X11-driver-firegl-ioctl32.patch:1.2
--- SOURCES/X11-driver-firegl-ioctl32.patch:1.1	Fri Sep 23 23:20:42 2005
+++ SOURCES/X11-driver-firegl-ioctl32.patch	Thu Nov  3 14:19:45 2005
@@ -1,14 +1,118 @@
---- X11-driver-firegl-8.16.20/lib/modules/fglrx/build_mod/firegl_public.c.orig	2005-09-23 23:09:33.000000000 +0200
-+++ X11-driver-firegl-8.16.20/lib/modules/fglrx/build_mod/firegl_public.c	2005-09-23 23:12:55.000000000 +0200
-@@ -121,7 +121,11 @@
+http://ati.cchtml.com/show_bug.cgi?id=211
+
+--- X11-driver-firegl-8.16.20/lib/modules/fglrx/build_mod/firegl_public.c.orig	2005-11-02 20:29:43.535048712 -0800
++++ X11-driver-firegl-8.16.20/lib/modules/fglrx/build_mod/firegl_public.c	2005-11-02 20:27:19.013019400 -0800
+@@ -121,9 +121,8 @@
  #endif
  
  #ifdef __x86_64__
-+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,12)
-+#include "asm/ioctl.h"
-+#else
++#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,12)
  #include "asm/ioctl32.h"
-+#endif
- #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,2)
- #include "linux/syscalls.h"
+-#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,2)
+-#include "linux/syscalls.h"
  #endif
+ #endif
+ 
+@@ -191,6 +190,16 @@ _syscall3( int, modify_ldt, int, func, v
+ // ============================================================
+ /* globals */
+ 
++int register_ioctl32_conversion(unsigned int cmd, int (*handler)(unsigned int, unsigned int, unsigned long, struct file*));
++long realHandler_compat_ioctl(struct file *filp, unsigned int cmd, unsigned long arg);
++void unregister_ioctl32_conversion(unsigned int cmd);
++struct HandlerList {
++       unsigned int cmd;
++       void *handler;
++       struct HandlerList *next;
++};
++struct HandlerList *HandlerListHead = 0x0;
++
+ char* firegl = NULL;
+ int __ke_debuglevel = 0;
+ int __ke_moduleflags = 0;
+@@ -258,6 +267,7 @@ static struct file_operations firegl_fop
+     open:    ip_firegl_open,
+     release: ip_firegl_release,
+     ioctl:   ip_firegl_ioctl,
++    compat_ioctl: realHandler_compat_ioctl,
+     mmap:    ip_firegl_mmap,
+ };
+ 
+@@ -1475,7 +1485,7 @@ int ATI_API_CALL __ke_copy_to_user(void*
+ 
+ int ATI_API_CALL __ke_verify_area(int type, const void * addr, unsigned long size)
+ {
+-    return verify_area(type, addr, size);
++    return access_ok(type, addr, size);
+ }
+ 
+ int ATI_API_CALL __ke_get_pci_device_info(__ke_pci_dev_t* dev, __ke_pci_device_info_t *pinfo)
+@@ -2220,10 +2230,68 @@ int ATI_API_CALL __ke_register_ioctl32_c
+     return register_ioctl32_conversion(cmd, handler);
+ }
+ 
++
++ int register_ioctl32_conversion(unsigned int cmd, int (*handler)(unsigned int, unsigned int, unsigned long, struct file*))
++ {
++       sizeof(struct HandlerList);
++       struct HandlerList *newHandler = kmalloc(sizeof(struct HandlerList), 0);
++       newHandler->cmd = cmd;
++       newHandler->handler = handler;
++       newHandler->next = HandlerListHead;
++       HandlerListHead = newHandler;
++       return 0;
++ }
++ 
++ long realHandler_compat_ioctl(struct file *filp, unsigned int cmd, unsigned long arg)
++ {     
++       int fd;
++       int (*handler)(unsigned int, unsigned int, unsigned long, struct file*);
++       struct fdtable *fdt;
++       struct HandlerList *HandlerEntry = HandlerListHead;
++ 
++       while(HandlerEntry->cmd != cmd){
++               if(HandlerEntry->next == 0x0){ 
++                       return -1;
++               }
++               HandlerEntry = HandlerEntry->next;
++       }       
++       handler = HandlerEntry->handler;
++       fdt = files_fdtable(current->files);
++       for(fd=0;fd<fdt->max_fds;fd++){
++               if(fdt->fd[fd] == filp){
++                       return handler(fd, cmd, arg, filp);
++               }
++       }
++       return -1;
++}
++
++
++
+ void ATI_API_CALL __ke_unregister_ioctl32_conversion(unsigned int cmd)
+ {
+     unregister_ioctl32_conversion(cmd);
+ }
++
++ void unregister_ioctl32_conversion(unsigned int cmd)
++ {
++       struct HandlerList *ahead, *behind;
++       if(HandlerListHead == 0x0) return;
++       behind = HandlerListHead;
++       ahead = HandlerListHead->next;
++       if(behind->cmd == cmd){
++               HandlerListHead = ahead;
++               kfree(behind);
++               return;
++       }
++       while(ahead->cmd != cmd){
++               behind = ahead;
++               ahead = ahead->next;
++       }
++       behind->next = ahead->next;
++       kfree(ahead);
++       return;
++ }
++
+ #endif
+ 
+ /* agp_memory related routine for IGP */
================================================================

---- CVS-web:
    http://cvs.pld-linux.org/SOURCES/X11-driver-firegl-ioctl32.patch?r1=1.1&r2=1.2&f=u




More information about the pld-cvs-commit mailing list