]> git.pld-linux.org Git - packages/X11-driver-firegl.git/commitdiff
- updated for 2.6.14 / tested / works.
authorPaweł Sikora <pluto@pld-linux.org>
Thu, 3 Nov 2005 13:19:45 +0000 (13:19 +0000)
committercvs2git <feedback@pld-linux.org>
Sun, 24 Jun 2012 12:13:13 +0000 (12:13 +0000)
Changed files:
    X11-driver-firegl-ioctl32.patch -> 1.2

X11-driver-firegl-ioctl32.patch

index 562fb1c0137aa2073939240ebbf35aa928d38d05..0a5cb999d6dd84215af0008809a463b0b691784f 100644 (file)
---- 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 */
This page took 0.038741 seconds and 4 git commands to generate.