public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* Re: rmap and nvidia?
@ 2002-12-16 22:22 O.Sezer
  2002-12-16 23:17 ` Eyal Lebedinsky
                   ` (2 more replies)
  0 siblings, 3 replies; 16+ messages in thread
From: O.Sezer @ 2002-12-16 22:22 UTC (permalink / raw)
  To: linux-kernel

[-- Attachment #1: Type: text/plain, Size: 93 bytes --]

Is this patch correct in any way?
(Ripped out of the 2.5 patch and modified some).

Thanks.


[-- Attachment #2: NVIDIA_kernel_rmap.patch --]
[-- Type: text/plain, Size: 2173 bytes --]

diff -urN NVIDIA_kernel-1.0-4191/nv.c NVIDIA_kernel.rmap15b/nv.c
--- NVIDIA_kernel-1.0-4191/nv.c	2002-12-09 22:27:15.000000000 +0200
+++ NVIDIA_kernel.rmap15b/nv.c	2002-12-17 00:03:12.000000000 +0200
@@ -2217,7 +2217,7 @@
 {
     pgd_t *pg_dir;
     pmd_t *pg_mid_dir;
-    pte_t *pte__, pte;
+    pte_t pte;
 
 #if defined(NVCPU_IA64)
     if (address > __IA64_UNCACHED_OFFSET)
@@ -2241,14 +2241,7 @@
     if (pmd_none(*pg_mid_dir))
         goto failed;
 
-#if defined (pte_offset_atomic)
-    pte__ = pte_offset_atomic(pg_mid_dir, address);
-    pte = *pte__;
-    pte_kunmap(pte__);
-#else
-    pte__ = NULL;
-    pte = *pte_offset(pg_mid_dir, address);
-#endif
+    PTE_OFFSET(pg_mid_dir, address, pte);
 
     if (!pte_present(pte))
         goto failed;
diff -urN NVIDIA_kernel-1.0-4191/nv-linux.h NVIDIA_kernel.rmap15b/nv-linux.h
--- NVIDIA_kernel-1.0-4191/nv-linux.h	2002-12-09 22:27:15.000000000 +0200
+++ NVIDIA_kernel.rmap15b/nv-linux.h	2002-12-17 00:02:19.000000000 +0200
@@ -146,6 +146,28 @@
 #  define VMA_PRIVATE(vma)              ((void*)((vma)->vm_pte))
 #endif
 
+#ifdef pte_offset_map		/* rmap-vm or 2.5  */
+#define PTE_OFFSET(pmd, address, pte)               \
+ {                                                  \
+     pte_t *pPTE;                                   \
+     pPTE = pte_offset_map(pmd, address);           \
+     pte = *pPTE;                                   \
+     pte_unmap(pPTE);                               \
+ }
+#else
+#ifdef pte_offset_atomic		/* aa-vm   */
+#define PTE_OFFSET(pmd, address, pte)               \
+  {                                                 \
+     pte_t *pPTE;                                   \
+     pPTE = pte_offset_atomic(pmd, address);        \
+     pte = *pPTE;                                   \
+     pte_kunmap(pPTE);                              \
+  }
+#else	/* !pte_offset_atomic */
+#define PTE_OFFSET(pmd, address, pte)   (pte = *pte_offset(pmd, address))
+#endif	/* pte_offset_atomic  */
+#endif	/* pte_offset_map     */
+
 #define NV_PAGE_ALIGN(addr)             ( ((addr) + PAGE_SIZE - 1) / PAGE_SIZE)
 #define NV_MASK_OFFSET(addr)            ( (addr) & (PAGE_SIZE - 1) )
 

^ permalink raw reply	[flat|nested] 16+ messages in thread
* Re: rmap and nvidia?
@ 2002-12-16 14:25 O.Sezer
  2002-12-16 15:42 ` William Lee Irwin III
  0 siblings, 1 reply; 16+ messages in thread
From: O.Sezer @ 2002-12-16 14:25 UTC (permalink / raw)
  To: linux-kernel

The 2.5 patches at http://www.minion.de/nvidia.html
may give some clue. They use pte_offset_map , yes,
but no corresponding pte_unmap ...


^ permalink raw reply	[flat|nested] 16+ messages in thread
* rmap and nvidia?
@ 2002-12-14  9:36 mdew
  2002-12-14  9:38 ` William Lee Irwin III
  0 siblings, 1 reply; 16+ messages in thread
From: mdew @ 2002-12-14  9:36 UTC (permalink / raw)
  To: Linux Kernel

is there a nvidia patch available to make it work with rmap?

nirvana:~/NVIDIA_kernel-1.0-3123# make
echo \#define NV_COMPILER \"`cc -v 2>&1 | tail -1`\" > nv_compiler.h
cc -c -Wall -Wimplicit -Wreturn-type -Wswitch -Wformat -Wchar-subscripts
-Wparentheses -Wpointer-arith -Wcast-qual -Wno-multichar  -O -MD
-D__KERNEL__ -DMODULE -D_LOOSE_KERNEL_NAMES -DNTRM -D_GNU_SOURCE
-DRM_HEAPMGR -D_LOOSE_KERNEL_NAMES -D__KERNEL__ -DMODULE 
-DNV_MAJOR_VERSION=1 -DNV_MINOR_VERSION=0 -DNV_PATCHLEVEL=3123 
-DNV_UNIX   -DNV_LINUX   -DNVCPU_X86       -I.
-I/lib/modules/2.4.20-xfs-rmap15b/build/include -Wno-cast-qual nv.c
nv.c: In function `nv_get_phys_address':
nv.c:2182: warning: implicit declaration of function `pte_offset'
nv.c:2182: invalid type argument of `unary *'
make: *** [nv.o] Error 1




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

end of thread, other threads:[~2002-12-17 20:18 UTC | newest]

Thread overview: 16+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2002-12-16 22:22 rmap and nvidia? O.Sezer
2002-12-16 23:17 ` Eyal Lebedinsky
2002-12-17  9:58 ` Andrew McGregor
2002-12-17 19:35 ` Andrew McGregor
2002-12-17 20:14   ` O.Sezer
  -- strict thread matches above, loose matches on Subject: below --
2002-12-16 14:25 O.Sezer
2002-12-16 15:42 ` William Lee Irwin III
2002-12-14  9:36 mdew
2002-12-14  9:38 ` William Lee Irwin III
2002-12-14  9:46   ` mdew
2002-12-14 14:26     ` Rik van Riel
2002-12-15  1:23       ` Eyal Lebedinsky
2002-12-15  1:28         ` Philip Dodd
2002-12-15  1:40           ` Eyal Lebedinsky
2002-12-16 13:32             ` Ducrot Bruno
2002-12-16 18:42               ` Andrew McGregor

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