public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* patch to NVIDIA_kernel & kernel 2.5.5
@ 2002-02-20 18:17 Martin Huenniger
  2002-02-28  8:49 ` Martin Huenniger
  0 siblings, 1 reply; 6+ messages in thread
From: Martin Huenniger @ 2002-02-20 18:17 UTC (permalink / raw)
  To: linux-kernel

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain; charset=us-ascii, Size: 6987 bytes --]

Hello

I tried to compile the latest kernel realizeing the NVdriver didn't work.     
So here is a little patch which I hope would fix the whole thing -- for me it
works fine. 

Have some fun

Martin Hünniger

----<snip>----

diff -ru NVIDIA_kernel-1.0-2314-old/nv.c NVIDIA_kernel-1.0-2314/nv.c
--- NVIDIA_kernel-1.0-2314-old/nv.c     Wed Feb 20 13:43:48 2002
+++ NVIDIA_kernel-1.0-2314/nv.c Wed Feb 20 18:17:15 2002
@@ -50,6 +50,12 @@
 #include <linux/devfs_fs_kernel.h>
 #endif
 
+/* Since 2.5.x this is needed for the coorect lookup of the page table entry */
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 5, 0)
+#include <asm/kmap_types.h>
+#include <linux/highmem.h>
+#endif
+
 #include <asm/page.h>
 #include <asm/pgtable.h>               // pte bit definitions
 #include <asm/system.h>                 // cli(), *_flags
@@ -1119,7 +1125,6 @@
 #endif
 };
 
-
 /*
 ** nv_kern_open
 **
@@ -1146,11 +1151,22 @@
 
     /* for control device, just jump to its open routine */
     /* after setting up the private data */
+    
+    /* I don't really know the correct kernel version since when it changed */ 
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 5, 0) 
     if (NV_DEVICE_IS_CONTROL_DEVICE(inode->i_rdev))
+       return nv_kern_ctl_open(inode, file);
+#else    
+    if (NV_DEVICE_IS_CONTROL_DEVICE(kdev_val(inode->i_rdev)))
         return nv_kern_ctl_open(inode, file);
-
+#endif
     /* what device are we talking about? */
+
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 5, 0)
     devnum = NV_DEVICE_NUMBER(inode->i_rdev);
+#else
+    devnum = NV_DEVICE_NUMBER(kdev_val(inode->i_rdev));
+#endif
     if (devnum >= NV_MAX_DEVICES)
     {
         rc = -ENODEV;
@@ -1257,8 +1273,14 @@
 
     /* for control device, just jump to its open routine */
     /* after setting up the private data */
+
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 5, 0)    
     if (NV_DEVICE_IS_CONTROL_DEVICE(inode->i_rdev))
+       return nv_kern_ctl_close(inode, file);
+#else
+    if(NV_DEVICE_IS_CONTROL_DEVICE(kdev_val(inode->i_rdev)))
         return nv_kern_ctl_close(inode, file);
+#endif
 
     NV_DMSG(nv, "close");
 
@@ -1383,11 +1405,21 @@
 #if defined(IA64)
         vma->vm_page_prot = pgprot_noncached(vma->vm_page_prot);
 #endif
+
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 5, 0)
         if (remap_page_range(vma->vm_start,
                              (u32) (nv->reg_physical_address) +
LINUX_VMA_OFFS(vma) - NV_MMAP_REG_OFFSET,
                              vma->vm_end - vma->vm_start,
                              vma->vm_page_prot))
             return -EAGAIN;
+#else
+        if (remap_page_range(vma,
+                            vma->vm_start,
+                             (u32) (nv->reg_physical_address) +
LINUX_VMA_OFFS(vma) - NV_MMAP_REG_OFFSET,
+                             vma->vm_end - vma->vm_start,
+                             vma->vm_page_prot))
+            return -EAGAIN;
+#endif
 
         /* mark it as IO so that we don't dump it on core dump */
         vma->vm_flags |= VM_IO;
@@ -1400,12 +1432,21 @@
 #if defined(IA64)
         vma->vm_page_prot = pgprot_noncached(vma->vm_page_prot);
 #endif
+
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 5, 0) 
         if (remap_page_range(vma->vm_start,
                              (u32) (nv->fb_physical_address) +
LINUX_VMA_OFFS(vma) - NV_MMAP_FB_OFFSET,
                              vma->vm_end - vma->vm_start,
                              vma->vm_page_prot))
             return -EAGAIN;
-
+#else
+        if (remap_page_range(vma,
+                            vma->vm_start,
+                             (u32) (nv->fb_physical_address) +
LINUX_VMA_OFFS(vma) - NV_MMAP_FB_OFFSET,
+                             vma->vm_end - vma->vm_start,
+                             vma->vm_page_prot))
+            return -EAGAIN;
+#endif
         // mark it as IO so that we don't dump it on core dump
         vma->vm_flags |= VM_IO;
     }
@@ -1435,7 +1476,10 @@
         while (pages--)
         {
             page = (unsigned long) at->page_table[i++];
+/*         
             if (remap_page_range(start, page, PAGE_SIZE, PAGE_SHARED))
+*/
+           if (remap_page_range(vma, start, page, PAGE_SIZE, PAGE_SHARED))
                return -EAGAIN;
             start += PAGE_SIZE;
             pos += PAGE_SIZE;
@@ -2298,7 +2342,11 @@
     if (pmd_none(*pg_mid_dir))
         goto failed;
 
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 5, 0)
     pg_table = pte_offset(pg_mid_dir, address);
+#else
+    pg_table = pte_offset_map(pg_mid_dir, address);
+#endif
     if (!pte_present(*pg_table))
         goto failed;
 
diff -ru NVIDIA_kernel-1.0-2314-old/os-interface.c
NVIDIA_kernel-1.0-2314/os-interface.c
--- NVIDIA_kernel-1.0-2314-old/os-interface.c   Wed Feb 20 13:44:56 2002
+++ NVIDIA_kernel-1.0-2314/os-interface.c       Wed Feb 20 18:19:01 2002
@@ -1445,10 +1445,15 @@
 
     uaddr = *priv;
 
-    /* finally, let's do it! */
-    err = remap_page_range( (size_t) uaddr, (size_t) paddr, size_bytes, 
+    /* finally, let's do it! */ 
+    
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 5, 0)
+    err = remap_page_range( (size_t) uaddr, (size_t) paddr, size_bytes,
+                           PAGE_SHARED);
+#else
+    err = remap_page_range( kaddr, (size_t) uaddr, (size_t) paddr, size_bytes, 
                             PAGE_SHARED);
-
+#endif
     if (err != 0)
     {
         return (void *) NULL;
@@ -1473,10 +1478,14 @@
 
     uaddr = *priv;
 
-    /* finally, let's do it! */
-    err = remap_page_range( (size_t) uaddr, (size_t) start, size_bytes, 
+    /* finally, let's do it! */ 
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 5, 0)
+    err = remap_page_rage( (size_t) uaddr, (size_t) start, size_bytes,
+                          PAGE_SHARED);    
+#else
+    err = remap_page_range( *priv, (size_t) uaddr, (size_t) start, size_bytes, 
                             PAGE_SHARED);
-
+#endif
     if (err != 0)
     {
         return (void *) NULL;
@@ -2027,13 +2036,25 @@
 
     agp_addr = agpinfo.aper_base + (agp_data->offset << PAGE_SHIFT);
 
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 5, 0)
     err = remap_page_range(vma->vm_start, (size_t) agp_addr, 
                            agp_data->num_pages << PAGE_SHIFT,
 #if defined(IA64)
                            vma->vm_page_prot);
 #else
                            PAGE_SHARED);
-#endif
+#endif /* IA64 */
+
+#else
+    err = remap_page_range(vma,
+                          vma->vm_start, (size_t) agp_addr, 
+                           agp_data->num_pages << PAGE_SHIFT,
+#if defined(IA64)
+                           vma->vm_page_prot);
+#else
+                           PAGE_SHARED);
+#endif /* IA64 */
+#endif /* LINUX_VERSION_CODE */
         
     if (err) {
         printk(KERN_ERR "NVRM: AGPGART: unable to remap %lu pages\n",

----<snip>----



-----------------------------------------------
E-Mail: Martin Huenniger <pirx@minet.uni-jena.de>
Date: 20-Feb-02
Time: 19:17:22
-----------------------------------------------

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: patch to NVIDIA_kernel & kernel 2.5.5
@ 2002-02-20 20:01 Nicholas Petreley
  2002-02-20 20:40 ` Martin Huenniger
  2002-02-20 22:50 ` J.A. Magallon
  0 siblings, 2 replies; 6+ messages in thread
From: Nicholas Petreley @ 2002-02-20 20:01 UTC (permalink / raw)
  To: linux-kernel

I think you may not have meant to do this part of the patch in nv.c:

+/*         
             if (remap_page_range(start, page, PAGE_SIZE, PAGE_SHARED))
+*/
+           if (remap_page_range(vma, start, page, PAGE_SIZE, PAGE_SHARED))
                return -EAGAIN;


How about this instead:

+#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 5, 0)
             if (remap_page_range(start, page, PAGE_SIZE, PAGE_SHARED))
                  return -EAGAIN;
+#else
+            if (remap_page_range(vma, start, page, PAGE_SIZE, PAGE_SHARED))
+                 return -EAGAIN;
+#endif




-- 
***********************************************************
Nicholas Petreley        http://www.VarLinux.org
nicholas@petreley.com    http://www.computerworld.com
http://www.petreley.org  http://www.linuxworld.com Eph 6:12
***********************************************************

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: patch to NVIDIA_kernel & kernel 2.5.5
  2002-02-20 20:01 Nicholas Petreley
@ 2002-02-20 20:40 ` Martin Huenniger
  2002-02-20 22:50 ` J.A. Magallon
  1 sibling, 0 replies; 6+ messages in thread
From: Martin Huenniger @ 2002-02-20 20:40 UTC (permalink / raw)
  To: Nicholas Petreley; +Cc: linux-kernel

Hello 

Oh right this is an mistake (darn!!!) But it leads only ;-) to problems when
compiled for kernel < 2.5.0

On 20-Feb-02 Nicholas Petreley wrote:
> I think you may not have meant to do this part of the patch in nv.c:
> 
> +/*         
>              if (remap_page_range(start, page, PAGE_SIZE, PAGE_SHARED))
> +*/
> +           if (remap_page_range(vma, start, page, PAGE_SIZE, PAGE_SHARED))
>                 return -EAGAIN;
> 
> 
> How about this instead:
> 
> +#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 5, 0)
>              if (remap_page_range(start, page, PAGE_SIZE, PAGE_SHARED))
>                   return -EAGAIN;
> +#else
> +            if (remap_page_range(vma, start, page, PAGE_SIZE, PAGE_SHARED))
> +                 return -EAGAIN;
> +#endif
> 
> 
> 
> 
> -- 
> ***********************************************************
> Nicholas Petreley        http://www.VarLinux.org
> nicholas@petreley.com    http://www.computerworld.com
> http://www.petreley.org  http://www.linuxworld.com Eph 6:12
> ***********************************************************
> -
> To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> Please read the FAQ at  http://www.tux.org/lkml/

-----------------------------------------------
E-Mail: Martin Huenniger <pirx@minet.uni-jena.de>
Date: 20-Feb-02
Time: 21:40:17
-----------------------------------------------

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: patch to NVIDIA_kernel & kernel 2.5.5
  2002-02-20 20:01 Nicholas Petreley
  2002-02-20 20:40 ` Martin Huenniger
@ 2002-02-20 22:50 ` J.A. Magallon
  1 sibling, 0 replies; 6+ messages in thread
From: J.A. Magallon @ 2002-02-20 22:50 UTC (permalink / raw)
  To: Nicholas Petreley; +Cc: linux-kernel


On 20020220 Nicholas Petreley wrote:
>I think you may not have meant to do this part of the patch in nv.c:
>
>+/*         
>             if (remap_page_range(start, page, PAGE_SIZE, PAGE_SHARED))
>+*/
>+           if (remap_page_range(vma, start, page, PAGE_SIZE, PAGE_SHARED))
>                return -EAGAIN;
>
>
>How about this instead:
>
>+#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 5, 0)
>             if (remap_page_range(start, page, PAGE_SIZE, PAGE_SHARED))
>                  return -EAGAIN;
>+#else
>+            if (remap_page_range(vma, start, page, PAGE_SIZE, PAGE_SHARED))
>+                 return -EAGAIN;
>+#endif
>

and why not:

#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 5, 0)
#define NV_IS_CTRL_DEV(inode) NV_DEVICE_IS_CONTROL_DEVICE(inode->i_rdev)
#define REMAP_PR(vma, start, page, size, flags) \
		remap_page_range(start, page, size, flags)
#else
#define NV_IS_CTRL_DEV(inode) NV_DEVICE_IS_CONTROL_DEVICE(kdev_val(inode->i_rdev)
#define REMAP_PR(vma, start, page, size, flags) \
		remap_page_range(vma,start, page, size, flags)
#endif

so you just leave the code readable:

-    if (NV_DEVICE_IS_CONTROL_DEVICE(inode->i_rdev))
+    if (NV_IS_CTRL_DEV(inode))

and

-            if (remap_page_range(start, page, PAGE_SIZE, PAGE_SHARED))
+            if (REMAP_PR(vma,start, page, PAGE_SIZE, PAGE_SHARED))

instead of polluted by tons of #ifdefs....

-- 
J.A. Magallon                           #  Let the source be with you...        
mailto:jamagallon@able.es
Mandrake Linux release 8.2 (Cooker) for i586
Linux werewolf 2.4.18-rc2-jam1 #1 SMP Tue Feb 19 00:35:21 CET 2002 i686

^ permalink raw reply	[flat|nested] 6+ messages in thread

* RE: patch to NVIDIA_kernel & kernel 2.5.5
  2002-02-20 18:17 patch to NVIDIA_kernel & kernel 2.5.5 Martin Huenniger
@ 2002-02-28  8:49 ` Martin Huenniger
  2002-02-28 16:53   ` Thomas Dodd
  0 siblings, 1 reply; 6+ messages in thread
From: Martin Huenniger @ 2002-02-28  8:49 UTC (permalink / raw)
  To: Martin Huenniger; +Cc: linux-kernel

HI 

There were obviously some probmlems with the patch I hope I have fixed them now.

Have fun!

----snip----

diff -ur NVIDIA_kernel-1.0-2314.old/nv.c NVIDIA_kernel-1.0-2314/nv.c
--- NVIDIA_kernel-1.0-2314.old/nv.c     Sat Dec  1 05:11:06 2001
+++ NVIDIA_kernel-1.0-2314/nv.c Sun Feb 24 12:37:35 2002
@@ -50,6 +50,12 @@
 #include <linux/devfs_fs_kernel.h>
 #endif
 
+/* Since 2.5.x this is needed for the coorect lookup of the page table entry */
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 5, 0)
+#include <asm/kmap_types.h>
+#include <linux/highmem.h>
+#endif
+
 #include <asm/page.h>
 #include <asm/pgtable.h>               // pte bit definitions
 #include <asm/system.h>                 // cli(), *_flags
@@ -1119,7 +1125,6 @@
 #endif
 };
 
-
 /*
 ** nv_kern_open
 **
@@ -1146,11 +1151,22 @@
 
     /* for control device, just jump to its open routine */
     /* after setting up the private data */
+    
+    /* I don't really know the correct kernel version since when it changed */ 
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 5, 0) 
     if (NV_DEVICE_IS_CONTROL_DEVICE(inode->i_rdev))
+       return nv_kern_ctl_open(inode, file);
+#else    
+    if (NV_DEVICE_IS_CONTROL_DEVICE(kdev_val(inode->i_rdev)))
         return nv_kern_ctl_open(inode, file);
-
+#endif
     /* what device are we talking about? */
+
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 5, 0)
     devnum = NV_DEVICE_NUMBER(inode->i_rdev);
+#else
+    devnum = NV_DEVICE_NUMBER(kdev_val(inode->i_rdev));
+#endif
     if (devnum >= NV_MAX_DEVICES)
     {
         rc = -ENODEV;
@@ -1257,8 +1273,14 @@
 
     /* for control device, just jump to its open routine */
     /* after setting up the private data */
+
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 5, 0)    
     if (NV_DEVICE_IS_CONTROL_DEVICE(inode->i_rdev))
+       return nv_kern_ctl_close(inode, file);
+#else
+    if(NV_DEVICE_IS_CONTROL_DEVICE(kdev_val(inode->i_rdev)))
         return nv_kern_ctl_close(inode, file);
+#endif
 
     NV_DMSG(nv, "close");
 
@@ -1383,11 +1405,21 @@
 #if defined(IA64)
         vma->vm_page_prot = pgprot_noncached(vma->vm_page_prot);
 #endif
+
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 5, 0)
         if (remap_page_range(vma->vm_start,
                              (u32) (nv->reg_physical_address) +
LINUX_VMA_OFFS(vma) - NV_MMAP_REG_OFFSET,
                              vma->vm_end - vma->vm_start,
                              vma->vm_page_prot))
             return -EAGAIN;
+#else
+        if (remap_page_range(vma,
+                            vma->vm_start,
+                             (u32) (nv->reg_physical_address) +
LINUX_VMA_OFFS(vma) - NV_MMAP_REG_OFFSET,
+                             vma->vm_end - vma->vm_start,
+                             vma->vm_page_prot))
+            return -EAGAIN;
+#endif
 
         /* mark it as IO so that we don't dump it on core dump */
         vma->vm_flags |= VM_IO;
@@ -1400,12 +1432,21 @@
 #if defined(IA64)
         vma->vm_page_prot = pgprot_noncached(vma->vm_page_prot);
 #endif
+
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 5, 0) 
         if (remap_page_range(vma->vm_start,
                              (u32) (nv->fb_physical_address) +
LINUX_VMA_OFFS(vma) - NV_MMAP_FB_OFFSET,
                              vma->vm_end - vma->vm_start,
                              vma->vm_page_prot))
             return -EAGAIN;
-
+#else
+        if (remap_page_range(vma,
+                            vma->vm_start,
+                             (u32) (nv->fb_physical_address) +
LINUX_VMA_OFFS(vma) - NV_MMAP_FB_OFFSET,
+                             vma->vm_end - vma->vm_start,
+                             vma->vm_page_prot))
+            return -EAGAIN;
+#endif
         // mark it as IO so that we don't dump it on core dump
         vma->vm_flags |= VM_IO;
     }
@@ -1435,8 +1476,13 @@
         while (pages--)
         {
             page = (unsigned long) at->page_table[i++];
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 5, 0)           
             if (remap_page_range(start, page, PAGE_SIZE, PAGE_SHARED))
+               return -EAGAIN;
+#else
+           if (remap_page_range(vma, start, page, PAGE_SIZE, PAGE_SHARED))
                return -EAGAIN;
+#endif
             start += PAGE_SIZE;
             pos += PAGE_SIZE;
                }
@@ -2298,7 +2344,11 @@
     if (pmd_none(*pg_mid_dir))
         goto failed;
 
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 5, 0)
     pg_table = pte_offset(pg_mid_dir, address);
+#else
+    pg_table = pte_offset_map(pg_mid_dir, address);
+#endif
     if (!pte_present(*pg_table))
         goto failed;
 
diff -ur NVIDIA_kernel-1.0-2314.old/os-interface.c
NVIDIA_kernel-1.0-2314/os-interface.c
--- NVIDIA_kernel-1.0-2314.old/os-interface.c   Sat Dec  1 05:11:06 2001
+++ NVIDIA_kernel-1.0-2314/os-interface.c       Wed Feb 20 18:19:01 2002
@@ -1445,10 +1445,15 @@
 
     uaddr = *priv;
 
-    /* finally, let's do it! */
-    err = remap_page_range( (size_t) uaddr, (size_t) paddr, size_bytes, 
+    /* finally, let's do it! */ 
+    
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 5, 0)
+    err = remap_page_range( (size_t) uaddr, (size_t) paddr, size_bytes,
+                           PAGE_SHARED);
+#else
+    err = remap_page_range( kaddr, (size_t) uaddr, (size_t) paddr, size_bytes, 
                             PAGE_SHARED);
-
+#endif
     if (err != 0)
     {
         return (void *) NULL;
@@ -1473,10 +1478,14 @@
 
     uaddr = *priv;
 
-    /* finally, let's do it! */
-    err = remap_page_range( (size_t) uaddr, (size_t) start, size_bytes, 
+    /* finally, let's do it! */ 
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 5, 0)
+    err = remap_page_rage( (size_t) uaddr, (size_t) start, size_bytes,
+                          PAGE_SHARED);    
+#else
+    err = remap_page_range( *priv, (size_t) uaddr, (size_t) start, size_bytes, 
                             PAGE_SHARED);
-
+#endif
     if (err != 0)
     {
         return (void *) NULL;
@@ -2027,13 +2036,25 @@
 
     agp_addr = agpinfo.aper_base + (agp_data->offset << PAGE_SHIFT);
 
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 5, 0)
     err = remap_page_range(vma->vm_start, (size_t) agp_addr, 
                            agp_data->num_pages << PAGE_SHIFT,
 #if defined(IA64)
                            vma->vm_page_prot);
 #else
                            PAGE_SHARED);
-#endif
+#endif /* IA64 */
+
+#else
+    err = remap_page_range(vma,
+                          vma->vm_start, (size_t) agp_addr, 
+                           agp_data->num_pages << PAGE_SHIFT,
+#if defined(IA64)
+                           vma->vm_page_prot);
+#else
+                           PAGE_SHARED);
+#endif /* IA64 */
+#endif /* LINUX_VERSION_CODE */
         
     if (err) {
         printk(KERN_ERR "NVRM: AGPGART: unable to remap %lu pages\n",

----snip----

-----------------------------------------------
E-Mail: Martin Huenniger <pirx@minet.uni-jena.de>
Date: 28-Feb-02
Time: 09:49:14
-----------------------------------------------

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: patch to NVIDIA_kernel & kernel 2.5.5
  2002-02-28  8:49 ` Martin Huenniger
@ 2002-02-28 16:53   ` Thomas Dodd
  0 siblings, 0 replies; 6+ messages in thread
From: Thomas Dodd @ 2002-02-28 16:53 UTC (permalink / raw)
  To: linux-kernel

Would it make more sens to us a compatibility marco
in one of NVIDIA's header files instead of
having the #if LINUX_VERSION_CODE scattered
everywhere? Or create a new header (kern_2.5_compat.h)?

Then if/when the kernel changes again just one file needs changed?

Martin Huenniger wrote:
> 
> diff -ur NVIDIA_kernel-1.0-2314.old/nv.c NVIDIA_kernel-1.0-2314/nv.c
> --- NVIDIA_kernel-1.0-2314.old/nv.c     Sat Dec  1 05:11:06 2001
> +++ NVIDIA_kernel-1.0-2314/nv.c Sun Feb 24 12:37:35 2002
> +#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 5, 0) 
>      if (NV_DEVICE_IS_CONTROL_DEVICE(inode->i_rdev))
> +       return nv_kern_ctl_open(inode, file);
> +#else    
> +    if (NV_DEVICE_IS_CONTROL_DEVICE(kdev_val(inode->i_rdev)))
>          return nv_kern_ctl_open(inode, file);


Here change NV_DEVICE_IS_CONTROL_DEVICE to add the kdev_val()
around arg 1.

> +#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 5, 0)
> +#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 5, 0)    

And 2 more times.

> +#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 5, 0)
>          if (remap_page_range(vma->vm_start,
> +#else
> +        if (remap_page_range(vma, vma->vm_start
> +#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 5, 0) 

make a macro for remap_page_range to always take
the new arg, but ignore it on older kernels.
> +#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 5, 0)
>      pg_table = pte_offset(pg_mid_dir, address);
> +#else
> +    pg_table = pte_offset_map(pg_mid_dir, address);

Macro that becomes pte_offset() or pte_offset_map()

> diff -ur NVIDIA_kernel-1.0-2314.old/os-interface.c
> NVIDIA_kernel-1.0-2314/os-interface.c
> --- NVIDIA_kernel-1.0-2314.old/os-interface.c   Sat Dec  1 05:11:06 2001
> +++ NVIDIA_kernel-1.0-2314/os-interface.c       Wed Feb 20 18:19:01 2002
> +#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 5, 0)
> +    err = remap_page_range( (size_t) uaddr, (size_t) paddr, size_bytes,
> +#else
> +    err = remap_page_range( kaddr, (size_t) uaddr, (size_t) paddr, size_bytes, 
> +#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 5, 0)
> +#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 5, 0)

use the new macro for remap_page_range 3 more times.


	-Thomas


^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2002-02-28 16:58 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2002-02-20 18:17 patch to NVIDIA_kernel & kernel 2.5.5 Martin Huenniger
2002-02-28  8:49 ` Martin Huenniger
2002-02-28 16:53   ` Thomas Dodd
  -- strict thread matches above, loose matches on Subject: below --
2002-02-20 20:01 Nicholas Petreley
2002-02-20 20:40 ` Martin Huenniger
2002-02-20 22:50 ` J.A. Magallon

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox