summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Bevitt <cyfred@gentoo.org>2004-04-13 15:51:58 +0000
committerAndrew Bevitt <cyfred@gentoo.org>2004-04-13 15:51:58 +0000
commitee7bc226977be3cbd4fc44e3373be12627b6b950 (patch)
tree5f86617266227b561cb8685240306aa6b73377de /media-video/nvidia-kernel
parentVersion bumped. Closes 46635 (Manifest recommit) (diff)
downloadgentoo-2-ee7bc226977be3cbd4fc44e3373be12627b6b950.tar.gz
gentoo-2-ee7bc226977be3cbd4fc44e3373be12627b6b950.tar.bz2
gentoo-2-ee7bc226977be3cbd4fc44e3373be12627b6b950.zip
Removing several of the old nvidia-kernel ebuilds, have left two for each profile that people appear to still use.
Diffstat (limited to 'media-video/nvidia-kernel')
-rw-r--r--media-video/nvidia-kernel/ChangeLog19
-rw-r--r--media-video/nvidia-kernel/files/NVIDIA_kernel-1.0-3123-2.5-module.diff206
-rw-r--r--media-video/nvidia-kernel/files/NVIDIA_kernel-1.0-3123-2.5-tl-pa.diff379
-rw-r--r--media-video/nvidia-kernel/files/NVIDIA_kernel-1.0-3123-2.5-tl.diff958
-rw-r--r--media-video/nvidia-kernel/files/NVIDIA_kernel-1.0-3123-2.5.54.diff25
-rw-r--r--media-video/nvidia-kernel/files/NVIDIA_kernel-1.0-3123-pa.diff351
-rw-r--r--media-video/nvidia-kernel/files/NVIDIA_kernel-1.0-4191-2.5-tl.diff1262
-rw-r--r--media-video/nvidia-kernel/files/NVIDIA_kernel-1.0-4191-2.5.54.diff36
-rw-r--r--media-video/nvidia-kernel/files/NVIDIA_kernel-1.0-4191-2.5.63.diff25
-rw-r--r--media-video/nvidia-kernel/files/digest-nvidia-kernel-1.0.2880-r11
-rw-r--r--media-video/nvidia-kernel/files/digest-nvidia-kernel-1.0.2960-r114
-rw-r--r--media-video/nvidia-kernel/files/digest-nvidia-kernel-1.0.3123-r21
-rw-r--r--media-video/nvidia-kernel/files/digest-nvidia-kernel-1.0.41801
-rw-r--r--media-video/nvidia-kernel/files/digest-nvidia-kernel-1.0.4191-r21
-rw-r--r--media-video/nvidia-kernel/files/digest-nvidia-kernel-1.0.4349-r21
-rw-r--r--media-video/nvidia-kernel/files/digest-nvidia-kernel-1.0.4496-r41
-rw-r--r--media-video/nvidia-kernel/files/digest-nvidia-kernel-1.0.53281
-rw-r--r--media-video/nvidia-kernel/files/digest-nvidia-kernel-1.0.53321
-rw-r--r--media-video/nvidia-kernel/files/digest-nvidia-kernel-1.0.53361
-rw-r--r--media-video/nvidia-kernel/files/digest-nvidia-kernel-1.0.5336-r11
-rw-r--r--media-video/nvidia-kernel/nvidia-kernel-1.0.2880-r1.ebuild70
-rw-r--r--media-video/nvidia-kernel/nvidia-kernel-1.0.2960-r1.ebuild66
-rw-r--r--media-video/nvidia-kernel/nvidia-kernel-1.0.3123-r2.ebuild103
-rw-r--r--media-video/nvidia-kernel/nvidia-kernel-1.0.4180.ebuild125
-rw-r--r--media-video/nvidia-kernel/nvidia-kernel-1.0.4191-r2.ebuild125
-rw-r--r--media-video/nvidia-kernel/nvidia-kernel-1.0.4349-r2.ebuild118
-rw-r--r--media-video/nvidia-kernel/nvidia-kernel-1.0.4496-r4.ebuild161
-rw-r--r--media-video/nvidia-kernel/nvidia-kernel-1.0.5328.ebuild161
-rw-r--r--media-video/nvidia-kernel/nvidia-kernel-1.0.5332.ebuild175
-rw-r--r--media-video/nvidia-kernel/nvidia-kernel-1.0.5336-r1.ebuild165
-rw-r--r--media-video/nvidia-kernel/nvidia-kernel-1.0.5336.ebuild159
31 files changed, 18 insertions, 4695 deletions
diff --git a/media-video/nvidia-kernel/ChangeLog b/media-video/nvidia-kernel/ChangeLog
index 5a4ba6d0e50b..74a290183d5e 100644
--- a/media-video/nvidia-kernel/ChangeLog
+++ b/media-video/nvidia-kernel/ChangeLog
@@ -1,6 +1,23 @@
# ChangeLog for media-video/nvidia-kernel
# Copyright 2002-2004 Gentoo Technologies, Inc.; Distributed under the GPL v2
-# $Header: /var/cvsroot/gentoo-x86/media-video/nvidia-kernel/ChangeLog,v 1.65 2004/04/08 00:10:51 cyfred Exp $
+# $Header: /var/cvsroot/gentoo-x86/media-video/nvidia-kernel/ChangeLog,v 1.66 2004/04/13 15:51:58 cyfred Exp $
+
+ 13 May 2004; Andrew Bevitt <cyfred@gentoo.org>;
+ nvidia-kernel-1.0.2880-r1.ebuild, nvidia-kernel-1.0.2960-r1.ebuild,
+ nvidia-kernel-1.0.3123-r2.ebuild, nvidia-kernel-1.0.4180.ebuild,
+ nvidia-kernel-1.0.4191-r2.ebuild, nvidia-kernel-1.0.4349-r2.ebuild,
+ nvidia-kernel-1.0.4496-r4.ebuild, nvidia-kernel-1.0.5328.ebuild,
+ nvidia-kernel-1.0.5332.ebuild, nvidia-kernel-1.0.5336-r1.ebuild,
+ nvidia-kernel-1.0.5336.ebuild, files/NVIDIA_kernel-1.0-3123-2.5-module.diff,
+ files/NVIDIA_kernel-1.0-3123-2.5-tl-pa.diff,
+ files/NVIDIA_kernel-1.0-3123-2.5-tl.diff,
+ files/NVIDIA_kernel-1.0-3123-2.5.54.diff,
+ files/NVIDIA_kernel-1.0-3123-pa.diff,
+ files/NVIDIA_kernel-1.0-4191-2.5-tl.diff,
+ files/NVIDIA_kernel-1.0-4191-2.5.54.diff,
+ files/NVIDIA_kernel-1.0-4191-2.5.63.diff:
+ Removing many of the old nvidia-kernel ebuilds, have left two from each
+ profile which appear to still be used by some people.
*nvidia-kernel-1.0.5332-r1 (07 May 2004)
diff --git a/media-video/nvidia-kernel/files/NVIDIA_kernel-1.0-3123-2.5-module.diff b/media-video/nvidia-kernel/files/NVIDIA_kernel-1.0-3123-2.5-module.diff
deleted file mode 100644
index 3bf3f41f91d8..000000000000
--- a/media-video/nvidia-kernel/files/NVIDIA_kernel-1.0-3123-2.5-module.diff
+++ /dev/null
@@ -1,206 +0,0 @@
-diff -Nudr NVIDIA_kernel-1.0-3123/Makefile NVIDIA_kernel-1.0-3123-fixed/Makefile
---- NVIDIA_kernel-1.0-3123/Makefile 2002-12-07 14:49:12.000000000 +0000
-+++ NVIDIA_kernel-1.0-3123-fixed/Makefile 2002-12-07 14:48:04.000000000 +0000
-@@ -2,7 +2,7 @@
- # Generated on 'builder3' on Tue Aug 27 15:56:49 PDT 2002
-
- LINUX_MODULE=Module-linux
--DEFINES=-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
-+DEFINES=-D__KERNEL__ -DMODULE -D_LOOSE_KERNEL_NAMES -DKBUILD_MODNAME="NVdriver" -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
- INCLUDES=-I.
-
- OBJECTS=nv.o os-interface.o os-registry.o
-@@ -73,6 +73,9 @@
-
- VERSION_HDR=nv_compiler.h
-
-+# required for rusty's depmod utility
-+O=.o
-+
- all: install
-
- install: package-install
-diff -Nudr NVIDIA_kernel-1.0-3123/nv.c NVIDIA_kernel-1.0-3123-fixed/nv.c
---- NVIDIA_kernel-1.0-3123/nv.c 2002-12-07 14:49:14.000000000 +0000
-+++ NVIDIA_kernel-1.0-3123-fixed/nv.c 2002-12-07 14:48:38.000000000 +0000
-@@ -116,10 +116,6 @@
- *** EXPORTS to Linux Kernel
- ***/
-
--/* linux module interface functions (called by linux kernel) */
--int init_module(void);
--void cleanup_module(void);
--
- /* nv_kern_ functions, interfaces used by linux kernel */
- void nv_kern_vma_open(struct vm_area_struct *vma);
- void nv_kern_vma_release(struct vm_area_struct *vma);
-@@ -152,6 +148,7 @@
- /* character driver entry points */
-
- static struct file_operations nv_fops = {
-+ owner: THIS_MODULE,
- poll: nv_kern_poll,
- ioctl: nv_kern_ioctl,
- mmap: nv_kern_mmap,
-@@ -906,7 +903,7 @@
- *** EXPORTS to Linux Kernel
- ***/
-
--int init_module(void)
-+static int __init nv_init_module(void)
- {
- int rc;
- int num_devices, i;
-@@ -928,7 +925,7 @@
- #endif
-
- if (rc < 0) {
-- NV_EMSG((nv_state_t *) 0, "init_module: register failed");
-+ NV_EMSG((nv_state_t *) 0, "nv_init_module: register failed");
- return rc;
- }
-
-@@ -952,7 +949,7 @@
- } while(0);
- #endif
-
-- NV_DMSG((nv_state_t *) 0, "init_module: major number %d", nv_major);
-+ NV_DMSG((nv_state_t *) 0, "nv_init_module: major number %d", nv_major);
-
- for (i = 0; i < NV_MAX_DEVICES; i++) {
- /*
-@@ -1004,7 +1001,7 @@
- return rc;
- }
-
--void cleanup_module(void)
-+static void __exit nv_exit_module(void)
- {
- int rc;
- nv_linux_state_t *nvl;
-@@ -1013,7 +1010,7 @@
- /* remove /proc/driver/nvidia */
- nvos_proc_remove();
-
-- NV_DMSG((nv_state_t *) 0, "cleanup_module");
-+ NV_DMSG((nv_state_t *) 0, "nv_exit_module");
-
- #ifdef CONFIG_PM
- /* XXX PM egads, is this the right place to do this? */
-@@ -1050,7 +1047,7 @@
- #endif
-
- if (rc < 0) {
-- NV_EMSG((nv_state_t *) 0, "cleanup_module: unregister nv failed");
-+ NV_EMSG((nv_state_t *) 0, "nv_exit_module: unregister nv failed");
- }
-
- #ifdef CONFIG_DEVFS_FS
-@@ -1064,6 +1061,8 @@
- #endif
- }
-
-+module_init(nv_init_module);
-+module_exit(nv_exit_module);
-
- /* this is only called when the vmas are duplicated.
- * this appears to only happen when the process is cloned to create
-@@ -1081,11 +1080,8 @@
- nv_alloc_t *at = (nv_alloc_t *) VMA_PRIVATE(vma);
- at->usage_count++;
- }
--
-- MOD_INC_USE_COUNT;
- }
-
--
- void
- nv_kern_vma_release(struct vm_area_struct *vma)
- {
-@@ -1107,8 +1103,6 @@
- VMA_PRIVATE(vma) = NULL;
- }
- }
--
-- MOD_DEC_USE_COUNT;
- }
-
- #if defined(NVCPU_IA64) && (LINUX_VERSION_CODE >= KERNEL_VERSION(2, 4, 9))
-@@ -1182,8 +1176,6 @@
- goto failed;
- }
-
-- MOD_INC_USE_COUNT;
--
- nvl = &nv_linux_devices[devnum];
- nv = NV_STATE_PTR(nvl);
-
-@@ -1241,7 +1233,7 @@
- * Finalize the tasklet initialization started in init_module and
- * enable bottom-half processing.
- */
-- nvl->tl.func = rm_isr_bh;
-+ nvl->tl.func = (void *) rm_isr_bh;
- nvl->tl.data = (unsigned long) nv->pdev;
- tasklet_enable(&nvl->tl);
-
-@@ -1255,7 +1247,6 @@
- return 0;
-
- failed:
-- MOD_DEC_USE_COUNT;
- if (nv)
- nv_unmap_device(nv);
- nv_unlock_ldata(nv);
-@@ -1334,8 +1325,6 @@
- NV_KFREE(file->private_data);
- file->private_data = (void *) 0;
-
-- MOD_DEC_USE_COUNT;
--
- return 0;
- }
-
-@@ -1496,9 +1485,6 @@
-
- vma->vm_file = file;
-
-- /* just increment usage count, rather than calling vma_open */
-- MOD_INC_USE_COUNT;
--
- return 0;
- }
-
-@@ -1603,12 +1589,13 @@
-
- switch (_IOC_NR(cmd))
- {
-+#ifndef KERNEL_2_5
- /* debug tool; zap the module use count so we can unload driver */
- /* even if it is confused */
- case _IOC_NR(NV_IOCTL_MODULE_RESET):
- atomic_set(&__this_module.uc.usecount, 1);
- break;
--
-+#endif
- /* enable/disable interrupts
- used by X driver to make card quiet while Xserver unnecessarily
- diddles around in its PCI config space
-@@ -1794,8 +1781,6 @@
- /* save the nv away in file->private_data */
- NV_HIDE_IN_FILEP(file, nv);
-
-- MOD_INC_USE_COUNT;
--
- NV_DMSG(nv, "open");
-
- nv->flags |= NV_FLAG_OPEN + NV_FLAG_CONTROL;
-@@ -1840,8 +1825,6 @@
- NV_KFREE(file->private_data);
- file->private_data = (void *) 0;
-
-- MOD_DEC_USE_COUNT;
--
- return 0;
- }
-
diff --git a/media-video/nvidia-kernel/files/NVIDIA_kernel-1.0-3123-2.5-tl-pa.diff b/media-video/nvidia-kernel/files/NVIDIA_kernel-1.0-3123-2.5-tl-pa.diff
deleted file mode 100644
index 4c6ab5407e7e..000000000000
--- a/media-video/nvidia-kernel/files/NVIDIA_kernel-1.0-3123-2.5-tl-pa.diff
+++ /dev/null
@@ -1,379 +0,0 @@
-diff -ru NVIDIA_kernel-1.0-3123-2.5/nv-linux.h NVIDIA_kernel-1.0-3123-2.5-pa/nv-linux.h
---- NVIDIA_kernel-1.0-3123-2.5/nv-linux.h Sat Oct 26 07:38:02 2002
-+++ NVIDIA_kernel-1.0-3123-2.5-pa/nv-linux.h Sat Oct 26 07:07:06 2002
-@@ -61,7 +61,7 @@
-
- #include <linux/pci.h> /* pci_find_class, etc */
- #include <linux/wrapper.h> /* mem_map_reserve */
--#include <linux/interrupt.h> /* tasklets, interrupt helpers */
-+#include <linux/interrupt.h> /* early kernels: bh; newer: irq */
-
- #include <asm/system.h> /* cli, sli, save_flags */
- #include <asm/io.h> /* ioremap, virt_to_phys */
-@@ -122,6 +122,7 @@
- # define MEM_MAP_READ_COUNT(map_nr) (atomic_read(&mem_map[map_nr].count))
- # define MEM_MAP_INC_COUNT(map_nr) (atomic_inc(&mem_map[map_nr].count))
- # define MEM_MAP_DEC_COUNT(map_nr) (atomic_dec(&mem_map[map_nr].count))
-+# define VMA_PRIVATE(vma) ((void*)((vma)->vm_pte))
- #else
- # define LINUX_VMA_OFFS(vma) (((vma)->vm_pgoff) << PAGE_SHIFT)
- # define GET_MODULE_SYMBOL(mod,sym) (const void *) inter_module_get(sym)
-@@ -130,6 +131,7 @@
- # define MEM_MAP_READ_COUNT(map_nr) (atomic_read(&(map_nr)->count))
- # define MEM_MAP_INC_COUNT(map_nr) (atomic_inc(&(map_nr)->count))
- # define MEM_MAP_DEC_COUNT(map_nr) (atomic_dec(&(map_nr)->count))
-+# define VMA_PRIVATE(vma) ((vma)->vm_private_data)
- #endif
-
- #ifdef KERNEL_2_5
-@@ -202,6 +204,7 @@
- typedef struct nv_alloc_s {
- struct nv_alloc_s *next;
- struct vm_area_struct *vma;
-+ unsigned int usage_count;
- unsigned int process_id;
- unsigned int thread_gid;
- unsigned int num_pages;
-diff -ru NVIDIA_kernel-1.0-3123-2.5/nv.c NVIDIA_kernel-1.0-3123-2.5-pa/nv.c
---- NVIDIA_kernel-1.0-3123-2.5/nv.c Sat Oct 26 07:20:31 2002
-+++ NVIDIA_kernel-1.0-3123-2.5-pa/nv.c Sat Oct 26 07:04:46 2002
-@@ -74,11 +74,21 @@
- static int nvos_is_nv_device(struct pci_dev *dev);
- static int nvos_set_primary_card(nv_ioctl_primary_card_t *info);
- static int nvos_probe_devices(void);
--static void * nvos_malloc(unsigned long);
--static void nvos_free(void **);
--
- static void nvos_proc_create(void);
- static void nvos_proc_remove(void);
-+static void * nvos_malloc_pages(unsigned long);
-+static void nvos_unlock_pages(void **);
-+static void nvos_free_pages(void **);
-+
-+#define nvos_unlock_and_free_pages(count, page_list) \
-+ if (page_list) { \
-+ if (count == 0) \
-+ nvos_unlock_pages(page_list); \
-+ nvos_free_pages(page_list); \
-+ }
-+
-+static nv_alloc_t *nvos_create_alloc();
-+static int nvos_free_alloc(nv_alloc_t *);
-
- /* nvl_ functions.. take a linux state device pointer */
- static nv_alloc_t *nvl_find_alloc(nv_linux_state_t *, unsigned long, nv_alloc_t **);
-@@ -364,18 +374,39 @@
- * memory on systems with high memory support enabled.
- */
-
--static void *nvos_malloc(unsigned long size)
-+/* note that there's a subtle kernel interaction with regards to bookkeeping
-+ * on these pages. So long as the pages are marked reserved, the kernel won't
-+ * touch them (alter the usage count on them). this leads to a subtle problem
-+ * with mmap. Normally, allocating the pages would set the count to 1, then
-+ * mmaping them would bump the count up to 2. The order of unmapping and freeing
-+ * the pages wouldn't matter, as they wouldn't really be considered free by the
-+ * kernel until the count dropped back to 0. Since the kernel won't touch the
-+ * count when the page is reserved, we need to be careful about this order and
-+ * unreserving the pages. if we unreserve the pages while freeing them, and the
-+ * munmap comes later, the munmap code path will attempt a second free on the
-+ * same pages. We also don't have a lot of control over which comes first,
-+ * sometimes we'll get called to free the pages first, sometimes we'll get called
-+ * to munmap them first. Oh, and we'll get vma open/close calls every time the
-+ * process is cloned, then execv'd, and munmap == vma close.
-+ * sooo, we keep our own count of the allocation usage, and don't unreserve the
-+ * pages until our count drops to 0. this should currently happen in either
-+ * vma_release or nvos_free, both of which will be followed by a kernel attempt
-+ * to free the page. Since the page fill finally be unreserved, the kernel will
-+ * reduce the count to 0 and successfully free the page for us, only once.
-+ * sigh... you have to love s&%*^y interfaces that force you to *know* too much
-+ * about kernel internals.
-+ */
-+
-+static void *nvos_malloc_pages(unsigned long pages_needed)
- {
- unsigned long *page_list = NULL;
- unsigned long *page_ptr = NULL;
-- unsigned int pages_needed;
- unsigned int page_list_size;
-
- /*
- * allocate a pointer for each physical page and an
- * integer to hold the number of pages allocated
- */
-- pages_needed = (size >> PAGE_SHIFT);
- page_list_size = (pages_needed + 1) * sizeof(unsigned long *);
-
- page_list = vmalloc(page_list_size);
-@@ -424,11 +455,15 @@
- return NULL;
- }
-
--static void nvos_free(void **page_list)
-+// unlock the pages we've locked down for dma purposes
-+static void nvos_unlock_pages(void **page_list)
- {
- unsigned long *page_ptr;
- unsigned int pages_left;
-
-+ if (page_list == NULL)
-+ return;
-+
- page_ptr = (unsigned long *) page_list;
-
- /* retrieve the number of pages allocated */
-@@ -436,11 +471,71 @@
-
- while (pages_left) {
- mem_map_unreserve(GET_MAP_NR(*page_ptr));
-+ page_ptr++;
-+ pages_left--;
-+ }
-+}
-+
-+static void nvos_free_pages(void **page_list)
-+{
-+ unsigned long *page_ptr;
-+ unsigned int pages_left;
-+
-+ if (page_list == NULL)
-+ return;
-+
-+ page_ptr = (unsigned long *) page_list;
-+
-+ /* retrieve the number of pages allocated */
-+ pages_left = *(unsigned int *) (page_list - 1);
-+
-+ while (pages_left) {
- free_page((unsigned long) phys_to_virt(*page_ptr++));
- pages_left--;
- }
-+}
-
-- vfree(page_list);
-+static
-+nv_alloc_t *nvos_create_alloc(void)
-+{
-+ nv_alloc_t *at;
-+
-+ NV_KMALLOC(at, sizeof(nv_alloc_t));
-+ if (at == NULL)
-+ return NULL;
-+
-+ memset(at, 0, sizeof(nv_alloc_t));
-+
-+ at->process_id = current->pid;
-+#if !defined (KERNEL_2_2)
-+ at->thread_gid = current->tgid;
-+#else
-+ at->thread_gid = -1;
-+#endif
-+
-+ return at;
-+}
-+
-+static
-+int nvos_free_alloc(
-+ nv_alloc_t *at
-+)
-+{
-+ if (at == NULL)
-+ return -1;
-+
-+ if (at->usage_count)
-+ return 1;
-+
-+ // we keep the page_table around after freeing the pages
-+ // for bookkeeping reasons. Free the page_table and assume
-+ // the underlying pages are already unlocked and freed.
-+ if (at->page_table)
-+ vfree(at->page_table - 1);
-+
-+ NV_KFREE(at);
-+
-+ return 0;
- }
-
- static u8 nvos_find_agp_capability(struct pci_dev *dev)
-@@ -981,6 +1076,12 @@
- void
- nv_kern_vma_open(struct vm_area_struct *vma)
- {
-+ if (VMA_PRIVATE(vma))
-+ {
-+ nv_alloc_t *at = (nv_alloc_t *) VMA_PRIVATE(vma);
-+ at->usage_count++;
-+ }
-+
- MOD_INC_USE_COUNT;
- }
-
-@@ -988,6 +1089,25 @@
- void
- nv_kern_vma_release(struct vm_area_struct *vma)
- {
-+ if (VMA_PRIVATE(vma))
-+ {
-+ nv_alloc_t *at = (nv_alloc_t *) VMA_PRIVATE(vma);
-+
-+ at->usage_count--;
-+
-+ // if usage_count is down to 0, the kernel virtual mapping was freed
-+ // but the underlying physical pages were not, due to the reserved bit
-+ // being set. We need to clear the reserved bit, then munmap will
-+ // zap the pages and free the physical pages.
-+ if (at->usage_count == 0)
-+ {
-+ if (at->page_table)
-+ nvos_unlock_pages(at->page_table);
-+ nvos_free_alloc(at);
-+ VMA_PRIVATE(vma) = NULL;
-+ }
-+ }
-+
- MOD_DEC_USE_COUNT;
- }
-
-@@ -1125,6 +1245,7 @@
- nvl->tl.data = (unsigned long) nv->pdev;
- tasklet_enable(&nvl->tl);
-
-+ memset(&nvl->wq, 0, sizeof(wait_queue_head_t));
- nv->flags |= NV_FLAG_OPEN;
- }
-
-@@ -1310,6 +1431,8 @@
- }
-
- at->vma = vma;
-+ VMA_PRIVATE(vma) = at;
-+ at->usage_count++;
-
- start = vma->vm_start;
- while (pages--)
-@@ -1344,6 +1467,8 @@
- }
-
- at->vma = vma;
-+ VMA_PRIVATE(vma) = at;
-+ at->usage_count++;
-
- if (NV_OSAGP_ENABLED(nv))
- {
-@@ -2163,20 +2288,14 @@
- int rm_status = 0;
- nv_linux_state_t *nvl = (nv_linux_state_t *) nv;
-
-- NV_KMALLOC(at, sizeof(nv_alloc_t));
-+ at = nvos_create_alloc();
- if (at == NULL)
- return RM_ERROR;
-
-- memset(at, 0, sizeof(nv_alloc_t));
--
- page_count = RM_PAGES_TO_OS_PAGES(page_count);
- at->num_pages = page_count;
--
-- at->process_id = current->pid;
-- at->thread_gid = current->tgid;
--
- at->class = class;
-- at->vma = NULL;
-+ at->usage_count++;
-
- if (at->class == NV01_ROOT)
- {
-@@ -2222,7 +2341,7 @@
- NV_ADD_AT(nvl, at);
- } else {
- /* use nvidia's nvagp support */
-- at->page_table = nvos_malloc(page_count << PAGE_SHIFT);
-+ at->page_table = nvos_malloc_pages(page_count);
- if (at->page_table == NULL)
- goto failed;
-
-@@ -2246,7 +2365,7 @@
- nv->agp_buffers++;
- } else {
- /* allocate general system memory */
-- at->page_table = nvos_malloc(page_count << PAGE_SHIFT);
-+ at->page_table = nvos_malloc_pages(page_count);
- if (at->page_table == NULL)
- goto failed;
-
-@@ -2259,10 +2378,10 @@
- failed:
- /* free any pages we may have allocated */
- if (at->page_table)
-- nvos_free(at->page_table);
-+ nvos_unlock_and_free_pages(at->usage_count, at->page_table);
-+
-+ nvos_free_alloc(at);
-
-- /* free it */
-- NV_KFREE(at);
- return -1;
- }
-
-@@ -2300,17 +2419,19 @@
- NV_REMOVE_AT_FROM_LIST(nvl, at, prev);
- nv_unlock_at(nv);
-
-+ at->usage_count--;
-+
- if (NV_OSAGP_ENABLED(nv))
- {
- rmStatus = KernFreeAGPPages(pAddress, priv_data);
- } else {
- rmStatus = rm_free_agp_pages(nv, pAddress, priv_data);
-- if (rmStatus == 0x0)
-- nvos_free(at->page_table);
-+ if (rmStatus == RM_OK)
-+ nvos_unlock_and_free_pages(at->usage_count, at->page_table);
- }
-
- /* we may hold off on disabling agp until all buffers are freed */
-- if (rmStatus == 0x0)
-+ if (rmStatus == RM_OK)
- {
- nv->agp_buffers--;
- if (!nv->agp_buffers && nv->agp_teardown)
-@@ -2325,6 +2446,8 @@
- NV_REMOVE_AT_FROM_LIST(nvl, at, prev);
- nv_unlock_at(nv);
-
-+ at->usage_count--;
-+
- if (at->class == NV01_ROOT)
- {
- int order, i;
-@@ -2342,11 +2465,13 @@
- }
- else
- {
-- nvos_free(at->page_table);
-+ nvos_unlock_and_free_pages(at->usage_count, at->page_table);
- }
- }
-
-- NV_KFREE(at);
-+ if (at->usage_count == 0)
-+ nvos_free_alloc(at);
-+
- return rmStatus;
- }
-
-diff -ru NVIDIA_kernel-1.0-3123-2.5/nv.h NVIDIA_kernel-1.0-3123-2.5-pa/nv.h
---- NVIDIA_kernel-1.0-3123-2.5/nv.h Sat Oct 26 07:21:10 2002
-+++ NVIDIA_kernel-1.0-3123-2.5-pa/nv.h Thu Oct 17 05:30:51 2002
-@@ -195,8 +195,10 @@
- U032 agp_buffers;
- U032 agp_teardown;
-
-+#ifndef KERNEL_2_5
- /* keep track of any pending bottom-halves */
- int bh_count;
-+#endif
-
- /* copy of the video bios in system memory */
- /* used by general resman code to query bios-set values */
diff --git a/media-video/nvidia-kernel/files/NVIDIA_kernel-1.0-3123-2.5-tl.diff b/media-video/nvidia-kernel/files/NVIDIA_kernel-1.0-3123-2.5-tl.diff
deleted file mode 100644
index e3246f930bc7..000000000000
--- a/media-video/nvidia-kernel/files/NVIDIA_kernel-1.0-3123-2.5-tl.diff
+++ /dev/null
@@ -1,958 +0,0 @@
-diff -ru NVIDIA_kernel-1.0-3123/Makefile NVIDIA_kernel-1.0-3123-2.5-tl/Makefile
---- NVIDIA_kernel-1.0-3123/Makefile 2002-08-28 01:36:53.000000000 +0200
-+++ NVIDIA_kernel-1.0-3123-2.5-tl/Makefile 2002-12-17 20:09:14.000000000 +0100
-@@ -8,7 +8,7 @@
- OBJECTS=nv.o os-interface.o os-registry.o
- HEADERS=os-interface.h nv-linux.h nv-misc.h nv.h nv-ids.h rmretval.h nvtypes.h nv_ref.h $(VERSION_HDR)
-
--CFLAGS=-Wall -Wimplicit -Wreturn-type -Wswitch -Wformat -Wchar-subscripts -Wparentheses -Wpointer-arith -Wcast-qual -Wno-multichar -O -MD $(DEFINES) $(INCLUDES) -Wno-cast-qual
-+CFLAGS=-Wall -Wimplicit -Wreturn-type -Wswitch -Wformat -Wchar-subscripts -Wparentheses -Wno-pointer-arith -Wcast-qual -Wno-multichar -O -MD $(DEFINES) $(INCLUDES) -Wno-cast-qual
-
- RESMAN_KERNEL_MODULE=Module-nvkernel
-
-@@ -58,8 +58,10 @@
- # allow specification of alternate include file tree on command line and extra defines
- ifdef SYSINCLUDE
- INCLUDES += -I$(SYSINCLUDE)
-+INCLUDES += -I$(SYSINCLUDE)/../arch/i386/mach-generic
- else
- INCLUDES += -I$(KERNINC)
-+INCLUDES += -I$(KERNINC)/../arch/i386/mach-generic
- endif
-
- DEFINES+=$(EXTRA_DEFINES)
-diff -ru NVIDIA_kernel-1.0-3123/nv-linux.h NVIDIA_kernel-1.0-3123-2.5-tl/nv-linux.h
---- NVIDIA_kernel-1.0-3123/nv-linux.h 2002-08-28 01:36:53.000000000 +0200
-+++ NVIDIA_kernel-1.0-3123-2.5-tl/nv-linux.h 2002-12-17 20:12:38.000000000 +0100
-@@ -28,19 +28,14 @@
- #include <linux/module.h>
- #include <linux/version.h>
-
--#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 2, 12)
--# error This driver does not support 2.2.11 or earlier kernels!
--#elif LINUX_VERSION_CODE < KERNEL_VERSION(2, 3, 0)
--# define KERNEL_2_2
-+#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 3, 0)
-+# error This driver does not support 2.2.x kernels!
- #elif LINUX_VERSION_CODE < KERNEL_VERSION(2, 4, 0)
--# error This driver does not support 2.3.x development kernels!
-+# error This driver does not support 2.3.x kernels!
- #elif LINUX_VERSION_CODE < KERNEL_VERSION(2, 5, 0)
- # define KERNEL_2_4
- #elif LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 0)
--# error This driver does not support 2.5.x development kernels!
- # define KERNEL_2_5
--#else
--# error This driver does not support 2.6.x or newer kernels!
- #endif
-
- #if defined (CONFIG_SMP) && !defined (__SMP__)
-@@ -51,7 +46,6 @@
- #include <linux/errno.h> /* error codes */
- #include <linux/stddef.h> /* NULL, offsetof */
- #include <linux/wait.h> /* wait queues */
--#include <linux/tqueue.h> /* struct tq_struct */
-
- #include <linux/slab.h> /* kmalloc, kfree, etc */
- #include <linux/vmalloc.h> /* vmalloc, vfree, etc */
-@@ -59,9 +53,15 @@
- #include <linux/poll.h> /* poll_wait */
- #include <linux/delay.h> /* mdelay, udelay */
-
-+#ifdef KERNEL_2_5
-+#include <linux/sched.h> /* suser(), capable() replacement */
-+#include <linux/smp_lock.h> /* kernel_locked */
-+#include <asm/kmap_types.h> /* page table entry lookup */
-+#endif
-+
- #include <linux/pci.h> /* pci_find_class, etc */
- #include <linux/wrapper.h> /* mem_map_reserve */
--#include <linux/interrupt.h> /* mark_bh, init_bh, remove_bh */
-+#include <linux/interrupt.h> /* tasklets, interrupt helpers */
-
- #include <asm/system.h> /* cli, sli, save_flags */
- #include <asm/io.h> /* ioremap, virt_to_phys */
-@@ -69,14 +69,9 @@
- #include <asm/page.h> /* PAGE_OFFSET */
- #include <asm/pgtable.h> /* pte bit definitions */
-
--#if !defined (KERNEL_2_2)
- #include <linux/spinlock.h>
- #include <asm/semaphore.h>
- #include <linux/highmem.h>
--#else
--#include <asm/spinlock.h>
--#include <asm/semaphore.h>
--#endif
-
- #ifdef CONFIG_PROC_FS
- #include <linux/proc_fs.h>
-@@ -118,16 +113,7 @@
- #endif
- #endif
-
--#if !defined (KERNEL_2_2)
--# define LINUX_VMA_OFFS(vma) (((vma)->vm_pgoff) << PAGE_SHIFT)
--# define GET_MODULE_SYMBOL(mod,sym) (const void *) inter_module_get(sym)
--# define PUT_MODULE_SYMBOL(sym) inter_module_put((char *) sym)
--# define GET_MAP_NR(phys_page) virt_to_page(__va(phys_page))
--# define MEM_MAP_READ_COUNT(map_nr) (atomic_read(&(map_nr)->count))
--# define MEM_MAP_INC_COUNT(map_nr) (atomic_inc(&(map_nr)->count))
--# define MEM_MAP_DEC_COUNT(map_nr) (atomic_dec(&(map_nr)->count))
--# define GET_EVENT_QUEUE(nv) ((struct __wait_queue_head *) ((nv)->event_queue))
--#else
-+#ifdef KERNEL_2_2
- # define in_irq() (local_irq_count[smp_processor_id()])
- # define LINUX_VMA_OFFS(vma) ((vma)->vm_offset)
- # define GET_MODULE_SYMBOL(mod, sym) (void*) get_module_symbol((mod), (sym))
-@@ -136,9 +122,58 @@
- # define MEM_MAP_READ_COUNT(map_nr) (atomic_read(&mem_map[map_nr].count))
- # define MEM_MAP_INC_COUNT(map_nr) (atomic_inc(&mem_map[map_nr].count))
- # define MEM_MAP_DEC_COUNT(map_nr) (atomic_dec(&mem_map[map_nr].count))
--# define GET_EVENT_QUEUE(nv) ((struct wait_queue **) &((nv)->event_queue))
-+#else
-+# define LINUX_VMA_OFFS(vma) (((vma)->vm_pgoff) << PAGE_SHIFT)
-+# define GET_MODULE_SYMBOL(mod,sym) (const void *) inter_module_get(sym)
-+# define PUT_MODULE_SYMBOL(sym) inter_module_put((char *) sym)
-+# define GET_MAP_NR(phys_page) virt_to_page(__va(phys_page))
-+# define MEM_MAP_READ_COUNT(map_nr) (atomic_read(&(map_nr)->count))
-+# define MEM_MAP_INC_COUNT(map_nr) (atomic_inc(&(map_nr)->count))
-+# define MEM_MAP_DEC_COUNT(map_nr) (atomic_dec(&(map_nr)->count))
- #endif
-
-+#ifdef KERNEL_2_5
-+# define NV_DEVICE_NUMBER(_minor) ((kdev_val(_minor)) & 0x0f)
-+# define NV_IS_CONTROL_DEVICE(_minor) (((kdev_val(_minor)) & 0xff) == 0xff)
-+# define SUSER() capable(CAP_SYS_ADMIN)
-+# define REMAP_PAGE_RANGE(a...) remap_page_range(vma, ## a)
-+# define CLI() local_irq_disable()
-+# define SAVE_FLAGS(x) local_save_flags(x)
-+# define RESTORE_FLAGS(x) local_irq_restore(x)
-+# define MAY_SLEEP() (!in_interrupt() && !in_atomic())
-+#else
-+# define NV_DEVICE_NUMBER(_minor) ((_minor) & 0x0f)
-+# define NV_IS_CONTROL_DEVICE(_minor) (((_minor) & 0xff) == 0xff)
-+# define SUSER() suser()
-+# define REMAP_PAGE_RANGE(a...) remap_page_range(## a)
-+# define CLI() cli()
-+# define SAVE_FLAGS(x) save_flags(x)
-+# define RESTORE_FLAGS(x) restore_flags(x)
-+# define MAY_SLEEP() (!in_interrupt())
-+#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) )
-
-@@ -193,14 +228,11 @@
-
- nv_alloc_t *alloc_queue;
-
-- // bottom half interrupt handler info; per device
-- struct tq_struct *bh;
--
- U032 vblank_notifier;
- U032 waiting_for_vblank;
-
-- /* queue for for NV's OS events */
-- void *event_queue;
-+ struct tasklet_struct tl;
-+ wait_queue_head_t wq;
-
- /* per-device locking mechanism for access to core rm */
- spinlock_t rm_lock;
-diff -ru NVIDIA_kernel-1.0-3123/nv.c NVIDIA_kernel-1.0-3123-2.5-tl/nv.c
---- NVIDIA_kernel-1.0-3123/nv.c 2002-08-28 01:36:52.000000000 +0200
-+++ NVIDIA_kernel-1.0-3123-2.5-tl/nv.c 2002-12-17 20:09:14.000000000 +0100
-@@ -36,7 +36,6 @@
- // keep track of opened clients and their process id so they
- // can be free'd up on abnormal close
- nv_client_t nv_clients[NV_MAX_CLIENTS];
--struct tq_struct nv_bottom_halves[NV_MAX_CLIENTS];
-
-
- #ifdef CONFIG_DEVFS_FS
-@@ -45,16 +44,6 @@
- #endif
-
- /*
-- * pick apart our minor device number
-- * low 3 bits is NV device
-- * if 255, then its the control device
-- */
--
--#define NV_DEVICE_NUMBER(_minor) ((_minor) & 0x0f)
--#define NV_DEVICE_IS_CONTROL_DEVICE(_minor) \
-- (((_minor) & 0xFF) == 0xFF)
--
--/*
- * Hardware access macros for the kernel driver only
- * The resource manager part of the driver uses different values here
- */
-@@ -537,12 +526,7 @@
- nv_linux_state_t *nvl;
- nv_linux_state_t *nv_max_devices;
-
--#if defined (KERNEL_2_2)
-- proc[DRIVER] = create_proc_entry("driver", flags, &proc_root);
--#else
- proc[DRIVER] = proc_root_driver;
--#endif
--
- proc[NVIDIA] = create_proc_entry("nvidia", flags, proc[DRIVER]);
- proc[AGP] = create_proc_entry("agp", flags, proc[NVIDIA]);
- proc[CARDS] = create_proc_entry("cards", flags, proc[NVIDIA]);
-@@ -595,14 +579,9 @@
- static void nvos_proc_remove(void)
- {
- #ifdef CONFIG_PROC_FS
--#if defined (KERNEL_2_2)
-- remove_proc_entry("driver", &proc_root);
-- remove_proc_entry("nv", &proc_root);
--#else
- remove_proc_entry("nvidia", proc_root_driver);
- remove_proc_entry("nv", &proc_root);
- #endif
--#endif
- }
-
- /*
-@@ -834,9 +813,8 @@
-
- int init_module(void)
- {
-- nv_linux_state_t *nvl;
- int rc;
-- int num_devices;
-+ int num_devices, i;
-
- memset(nv_linux_devices, 0, sizeof(nv_linux_devices));
- num_devices = nvos_probe_devices();
-@@ -848,7 +826,7 @@
-
- printk("nvidia: loading %s\n", pNVRM_ID);
-
--#ifdef CONFIG_DEVFS_FS
-+#if defined (CONFIG_DEVFS_FS) && !defined (KERNEL_2_5)
- rc = devfs_register_chrdev(nv_major, "nvidia", &nv_fops);
- #else
- rc = register_chrdev(nv_major, "nvidia", &nv_fops);
-@@ -863,7 +841,6 @@
- memset(nv_dev_handle, 0, sizeof(devfs_handle_t) * NV_MAX_DEVICES);
- do {
- char name[10];
-- int i;
-
- nv_ctl_handle = devfs_register(NULL, "nvidiactl",
- DEVFS_FL_DEFAULT, nv_major, 255,
-@@ -882,21 +859,27 @@
-
- NV_DMSG((nv_state_t *) 0, "init_module: major number %d", nv_major);
-
-- // init all the bottom half structures
-- for (nvl = nv_linux_devices; nvl < nv_linux_devices + NV_MAX_DEVICES; nvl++)
-- {
-- nvl->bh = &nv_bottom_halves[nvl - nv_linux_devices];
-- nvl->bh->routine = rm_isr_bh;
-- nvl->bh->data = (void *) 0;
-- nvl->bh->sync = 0;
-+ for (i = 0; i < NV_MAX_DEVICES; i++) {
-+ /*
-+ * We keep one tasklet per card to avoid latency issues with more
-+ * than one device, no two instances of a single tasklet are ever
-+ * executed concurrently.
-+ */
-+ atomic_set(&nv_linux_devices[i].tl.count, 1);
-+
-+ /*
-+ * Initialize the event queue for this device. This only needs to
-+ * happen once for every device.
-+ */
-+ init_waitqueue_head(&nv_linux_devices[i].wq);
- }
-
- // init the control device
- {
- nv_state_t *nv_ctl = NV_STATE_PTR(&nv_ctl_device);
-- nv_ctl_device.event_queue = NULL;
- nv_ctl->os_state = &nv_ctl_device;
- nv_lock_init_locks(nv_ctl);
-+ init_waitqueue_head(&nv_ctl_device.wq);
- }
-
- #ifdef CONFIG_PM
-@@ -918,7 +901,7 @@
- return 0;
-
- failed:
--#ifdef CONFIG_DEVFS_FS
-+#if defined (CONFIG_DEVFS_FS) && !defined (KERNEL_2_5)
- devfs_unregister_chrdev(nv_major, "nvidia");
- #else
- unregister_chrdev(nv_major, "nvidia");
-@@ -965,7 +948,7 @@
- }
- }
-
--#ifdef CONFIG_DEVFS_FS
-+#if defined (CONFIG_DEVFS_FS) && !defined (KERNEL_2_5)
- rc = devfs_unregister_chrdev(nv_major, "nvidia");
- #else
- rc = unregister_chrdev(nv_major, "nvidia");
-@@ -1068,7 +1051,7 @@
-
- /* for control device, just jump to its open routine */
- /* after setting up the private data */
-- if (NV_DEVICE_IS_CONTROL_DEVICE(inode->i_rdev))
-+ if (NV_IS_CONTROL_DEVICE(inode->i_rdev))
- return nv_kern_ctl_open(inode, file);
-
- /* what device are we talking about? */
-@@ -1134,16 +1117,13 @@
- goto failed;
- }
-
--#if !defined (KERNEL_2_2)
-- NV_KMALLOC(nvl->event_queue, sizeof(struct __wait_queue_head));
-- if (nvl->event_queue == NULL)
-- goto failed;
-- memset(nvl->event_queue, 0, sizeof(struct __wait_queue_head));
--
-- init_waitqueue_head(GET_EVENT_QUEUE(nvl));
--#else
-- nvl->event_queue = NULL;
--#endif
-+ /*
-+ * Finalize the tasklet initialization started in init_module and
-+ * enable bottom-half processing.
-+ */
-+ nvl->tl.func = rm_isr_bh;
-+ nvl->tl.data = (unsigned long) nv->pdev;
-+ tasklet_enable(&nvl->tl);
-
- nv->flags |= NV_FLAG_OPEN;
- }
-@@ -1178,7 +1158,7 @@
-
- /* for control device, just jump to its open routine */
- /* after setting up the private data */
-- if (NV_DEVICE_IS_CONTROL_DEVICE(inode->i_rdev))
-+ if (NV_IS_CONTROL_DEVICE(inode->i_rdev))
- return nv_kern_ctl_close(inode, file);
-
- NV_DMSG(nv, "close");
-@@ -1188,33 +1168,22 @@
- nv_lock_ldata(nv);
- if (--nv->usage_count == 0)
- {
-- int counter = 0;
--
-- /* turn off interrupts.
-- ** be careful to make sure any pending bottom half gets run
-- ** or disabled before calling rm_shutdown_adapter() since
-- ** it will free up the pdev. This is hard to see on single
-- ** cpu systems, but easy on dual cpu :-)
-- */
-- // nv_interrupts_disable(nv);
-+ /*
-+ * The usage count for this device has dropped to zero, it can be
-+ * safely shut down; the first step is to disable interrupts.
-+ */
- rm_disable_adapter(nv);
-
-- /* give it a moment to allow any bottom half to run */
--
--#define MAX_BH_TASKS 10
-- while ((nv->bh_count) && (counter < MAX_BH_TASKS))
-- {
-- current->state = TASK_INTERRUPTIBLE;
-- schedule_timeout(HZ/50);
-- counter++;
-- }
-+ /*
-+ * Disable this device's tasklet to make sure that no bottom-half
-+ * will run with an undefined device state.
-+ */
-+ tasklet_disable(&nvl->tl);
-
- /* free the irq, which may block until any pending interrupts */
- /* are done being processed. */
- free_irq(nv->interrupt_line, (void *) nv);
-
-- nvl->bh->data = (void *) 0;
--
- rm_shutdown_adapter(nv);
-
- (void) nv_unmap_device(nv);
-@@ -1234,12 +1203,6 @@
- }
- }
-
--#if !defined (KERNEL_2_2)
-- /* this only needs to be freed on 2.4 and later kernels */
-- NV_KFREE(nvl->event_queue);
-- nvl->event_queue = NULL;
--#endif
--
- /* leave INIT flag alone so we don't reinit every time */
- nv->flags &= ~(NV_FLAG_OPEN | NV_FLAG_WAITING);
- }
-@@ -1299,7 +1262,8 @@
- #if defined(NVCPU_IA64)
- vma->vm_page_prot = pgprot_noncached(vma->vm_page_prot);
- #endif
-- if (remap_page_range(vma->vm_start,
-+
-+ if (REMAP_PAGE_RANGE(vma->vm_start,
- (u32)(nv->regs.address) + LINUX_VMA_OFFS(vma) - NV_MMAP_REG_OFFSET,
- vma->vm_end - vma->vm_start,
- vma->vm_page_prot))
-@@ -1316,7 +1280,8 @@
- #if defined(NVCPU_IA64)
- vma->vm_page_prot = pgprot_noncached(vma->vm_page_prot);
- #endif
-- if (remap_page_range(vma->vm_start,
-+
-+ if (REMAP_PAGE_RANGE(vma->vm_start,
- (u32)(nv->fb.address) + LINUX_VMA_OFFS(vma) - NV_MMAP_FB_OFFSET,
- vma->vm_end - vma->vm_start,
- vma->vm_page_prot))
-@@ -1350,8 +1315,10 @@
- while (pages--)
- {
- page = (unsigned long) at->page_table[i++];
-- if (remap_page_range(start, page, PAGE_SIZE, PAGE_SHARED))
-+
-+ if (REMAP_PAGE_RANGE(start, page, PAGE_SIZE, PAGE_SHARED))
- return -EAGAIN;
-+
- start += PAGE_SIZE;
- pos += PAGE_SIZE;
- }
-@@ -1388,7 +1355,7 @@
- }
- else
- {
-- rm_map_agp_pages(nv, (void **) &vma->vm_start,
-+ rm_map_agp_pages(nv, (void **) &vma,
- at->class, at->priv_data);
-
- /* assumes we're not supporting IA64 AGP ourselves */
-@@ -1431,7 +1398,7 @@
- return nv_kern_ctl_poll (file, wait);
-
- // add us to the list
-- poll_wait(file, GET_EVENT_QUEUE(nvl), wait);
-+ poll_wait(file, &nvl->wq, wait);
-
- nv_lock_ldata(nv);
-
-@@ -1625,10 +1592,10 @@
- if (need_to_run_bottom_half)
- {
- nv_lock_bh(nv);
-+
- nv->bh_count++;
-- nvl->bh->data = nv->pdev;
-- queue_task(nvl->bh, &tq_immediate);
-- mark_bh(IMMEDIATE_BH);
-+ tasklet_schedule(&nvl->tl);
-+
- nv_unlock_bh(nv);
- }
- }
-@@ -1706,24 +1673,6 @@
-
- NV_DMSG(nv, "open");
-
-- /* if this is the first time the control device has been opened,
-- * allocate the wait queue
-- */
--
-- if (! nvl->event_queue) {
--
--#if !defined (KERNEL_2_2)
-- NV_KMALLOC(nvl->event_queue, sizeof(struct __wait_queue_head));
-- if (nvl->event_queue == NULL)
-- return -ENOMEM;
-- memset(nvl->event_queue, 0, sizeof(struct __wait_queue_head));
--
-- init_waitqueue_head(GET_EVENT_QUEUE(nvl));
--#else
-- nvl->event_queue = NULL;
--#endif
-- }
--
- nv->flags |= NV_FLAG_OPEN + NV_FLAG_CONTROL;
-
- /* turn off the hotkey occurred bit */
-@@ -1750,14 +1699,11 @@
- NV_DMSG(nv, "close");
-
- nv_lock_ldata(nv);
-- if (--nv->usage_count == 0)
-- {
--#if !defined (KERNEL_2_2)
-- nv_linux_state_t *nvl = NV_GET_NVL_FROM_NV_STATE(nv);
-- /* this only needs to be freed on 2.4 and later kernels */
-- NV_KFREE(nvl->event_queue);
-- nvl->event_queue = 0;
--#endif
-+ if (--nv->usage_count == 0) {
-+ /*
-+ * The control device has been released; with no physical devices
-+ * backing it, we only need to reset the flags;
-+ */
- nv->flags = 0;
- }
- nv_unlock_ldata(nv);
-@@ -1795,7 +1741,7 @@
- if (file->f_flags & O_NONBLOCK)
- return -EAGAIN;
-
-- poll_wait(file, GET_EVENT_QUEUE(nvl), wait);
-+ poll_wait(file, &nvl->wq, wait);
-
- nv_lock_ldata(nv);
-
-@@ -1825,7 +1771,7 @@
- nv_ctl_device.nv_state.flags |= NV_FLAG_HOTKEY_OCCURRED;
- nv_unlock_ldata(&(nv_ctl_device.nv_state));
-
-- wake_up_interruptible(GET_EVENT_QUEUE(&nv_ctl_device));
-+ wake_up_interruptible(&nv_ctl_device.wq);
- }
-
- struct host_bridge_t {
-@@ -2145,7 +2091,7 @@
- {
- pgd_t *pg_dir;
- pmd_t *pg_mid_dir;
-- pte_t *pte__, pte;
-+ pte_t pte;
-
- /* XXX do we really need this? */
- if (address > VMALLOC_START)
-@@ -2173,14 +2119,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;
-@@ -2234,11 +2173,7 @@
- at->num_pages = page_count;
-
- at->process_id = current->pid;
--#if !defined (KERNEL_2_2)
- at->thread_gid = current->tgid;
--#else
-- at->thread_gid = -1;
--#endif
-
- at->class = class;
- at->vma = NULL;
-@@ -2762,7 +2697,7 @@
-
- nvfp->any_fired_notifiers++;
-
-- wake_up_interruptible(GET_EVENT_QUEUE(nvl));
-+ wake_up_interruptible(&nvl->wq);
- }
-
- /*
-@@ -2779,7 +2714,7 @@
- if (nvl->waiting_for_vblank)
- nvl->vblank_notifier++;
-
-- wake_up_interruptible(GET_EVENT_QUEUE(nvl));
-+ wake_up_interruptible(&nvl->wq);
- }
-
-
-@@ -2827,12 +2762,8 @@
- if ( (NV_AGP_DISABLED(nv)) && (config & NVOS_AGP_CONFIG_NVAGP) )
- {
- /* make sure the user does not have agpgart loaded */
--#if !defined (KERNEL_2_2)
- if (inter_module_get("drm_agp")) {
- inter_module_put("drm_agp");
--#else
-- if (GET_MODULE_SYMBOL(0, __MODULE_STRING(agp_enable))) {
--#endif
- printk("NVRM: not using NVAGP, AGPGART is loaded!!\n");
- } else
- status = rm_init_agp(nv);
-diff -ru NVIDIA_kernel-1.0-3123/os-interface.c NVIDIA_kernel-1.0-3123-2.5-tl/os-interface.c
---- NVIDIA_kernel-1.0-3123/os-interface.c 2002-08-28 01:36:52.000000000 +0200
-+++ NVIDIA_kernel-1.0-3123-2.5-tl/os-interface.c 2002-12-17 20:09:14.000000000 +0100
-@@ -27,7 +27,7 @@
-
- BOOL os_is_administrator(PHWINFO pDev)
- {
-- return suser();
-+ return SUSER();
- }
-
- U032 os_get_page_size(VOID)
-@@ -169,6 +169,11 @@
- U032 size
- )
- {
-+ /*
-+ * XXX This needs to be !MAY_SLEEP() rather than in_interrupt(); this
-+ * requires that quite a bit of locking be rearranged, however, which
-+ * is why I'll leave this alone for now.
-+ */
- if (in_interrupt()) {
- if (size <= KMALLOC_LIMIT) {
- /*
-@@ -347,7 +352,7 @@
- if (in_irq() && MilliSeconds > NV_MAX_ISR_MDELAY)
- return RM_ERROR;
-
-- if (in_interrupt())
-+ if (!MAY_SLEEP())
- {
- mdelay(MilliSeconds);
- return RM_OK;
-@@ -937,14 +942,14 @@
-
- ULONG os_cli(ULONG flags)
- {
-- save_flags(flags);
-- cli();
-+ SAVE_FLAGS(flags);
-+ CLI();
- return flags;
- }
-
- ULONG os_sti(ULONG flags)
- {
-- restore_flags(flags);
-+ RESTORE_FLAGS(flags);
- return flags;
- }
-
-@@ -1064,27 +1069,10 @@
- {
- void *vaddr;
-
-- if (in_interrupt())
-- {
-- nv_printf("trying to map 0x%x to kernel space in interrupt!\n", start);
-- os_dbg_breakpoint();
-- return NULL;
-- }
--
-- {
--#if defined (KERNEL_2_2)
-- unsigned long map_nr = MAP_NR(__va(start));
-- if (map_nr < max_mapnr) {
-- vaddr = __va(start);
-- } else
--#endif
-- {
-- if (mode == NV_MEMORY_DEFAULT) {
-- vaddr = ioremap(start, size_bytes);
-- } else {
-- vaddr = ioremap_nocache(start, size_bytes);
-- }
-- }
-+ if (mode == NV_MEMORY_DEFAULT) {
-+ vaddr = ioremap(start, size_bytes);
-+ } else {
-+ vaddr = ioremap_nocache(start, size_bytes);
- }
-
- #ifdef DEBUG
-@@ -1106,16 +1094,7 @@
- U032 size_bytes
- )
- {
--#if defined (KERNEL_2_2)
-- if (MAP_NR(addr) < max_mapnr) {
-- // if we didn't want the memory cached, this isn't necessary
-- // but we shouldn't be in a timing critical piece of code.
-- asm volatile("wbinvd":::"memory");
-- } else
--#endif
-- {
-- iounmap(addr);
-- }
-+ iounmap(addr);
- }
-
- VOID* os_map_user_space(
-@@ -1125,31 +1104,7 @@
- U032 mode
- )
- {
-- int err;
-- void *paddr = NULL, *uaddr = NULL;
--
-- if ( (size_t) kaddr > VMALLOC_START) {
-- nv_ioctl_memory_vtop_t parms;
-- parms.buffer = (NvP64)(NV_UINTPTR_T) kaddr;
-- parms.byte_length = 1;
-- parms.physical_addresses = (NvP64)(NV_UINTPTR_T) &paddr;
-- nv_vtop(&parms, 0);
-- } else {
-- paddr = (void *) virt_to_phys(kaddr);
-- }
--
-- uaddr = *priv;
--
-- /* finally, let's do it! */
-- err = remap_page_range( (size_t) uaddr, (size_t) paddr, size_bytes,
-- PAGE_SHARED);
--
-- if (err != 0)
-- {
-- return (void *) NULL;
-- }
--
-- return uaddr;
-+ return NULL;
- }
-
- VOID os_unmap_user_space(
-@@ -1157,7 +1112,7 @@
- VOID *priv
- )
- {
-- // I don't think I need to do anything here...
-+ return;
- }
-
- VOID* os_map_io_space(
-@@ -1168,24 +1123,18 @@
- U032 mode
- )
- {
-- int err;
-- void *uaddr = NULL;
-+ struct vm_area_struct *vma;
-
-- if (!user)
-+ if (user == 0 || priv == NULL || *priv == NULL)
- return NULL;
-
-- uaddr = *priv;
-+ vma = (struct vm_area_struct *) *priv;
-
-- /* finally, let's do it! */
-- err = remap_page_range( (size_t) uaddr, (size_t) start, size_bytes,
-- PAGE_SHARED);
--
-- if (err != 0)
-- {
-- return (void *) NULL;
-- }
-+ if (REMAP_PAGE_RANGE(vma->vm_start,
-+ start & PAGE_MASK, size_bytes, PAGE_SHARED))
-+ return NULL;
-
-- return uaddr;
-+ return (void *)(NV_UINTPTR_T) vma->vm_start;
- }
-
- VOID os_unmap_io_space(
-@@ -1240,7 +1189,11 @@
- typedef struct {
- int (*backend_acquire)(void);
- void (*backend_release)(void);
-+#ifdef KERNEL_2_5
-+ int (*copy_info)(agp_kern_info *);
-+#else
- void (*copy_info)(agp_kern_info *);
-+#endif
- agp_memory * (*allocate_memory)(size_t, unsigned int);
- void (*free_memory)(agp_memory *);
- int (*bind_memory)(agp_memory *, off_t);
-@@ -1251,39 +1204,16 @@
- agp_operations_struct agp_ops;
- agp_kern_info agpinfo;
- agp_gart gart;
--#if !defined (KERNEL_2_2)
- const drm_agp_t *drm_agp_p;
--#endif
--
--#if defined (KERNEL_2_2)
-- #define GET_AGPGART_SYMBOL(sym, sym_string) \
-- sym = (void*) GET_MODULE_SYMBOL(0, sym_string); \
-- if (sym == NULL) \
-- { \
-- printk("NVRM: AGPGART: unable to retrieve symbol %s\n", sym_string); \
-- return 1; \
-- }
--
-- #define AGP_BACKEND_ACQUIRE_SYM __MODULE_STRING(agp_backend_acquire)
-- #define AGP_BACKEND_RELEASE_SYM __MODULE_STRING(agp_backend_release)
-- #define AGP_COPY_INFO_SYM __MODULE_STRING(agp_copy_info)
-- #define AGP_ALLOCATE_MEMORY_SYM __MODULE_STRING(agp_allocate_memory)
-- #define AGP_FREE_MEMORY_SYM __MODULE_STRING(agp_free_memory)
-- #define AGP_BIND_MEMORY_SYM __MODULE_STRING(agp_bind_memory)
-- #define AGP_UNBIND_MEMORY_SYM __MODULE_STRING(agp_unbind_memory)
-- #define AGP_ENABLE_SYM __MODULE_STRING(agp_enable)
--#endif
-
- BOOL KernInitAGP(VOID **ap_phys_base, VOID **ap_mapped_base, U032 *apsize)
- {
- U032 agp_rate;
- U032 agp_sba;
- U032 agp_fw;
-- char* chipset;
-
- memset( (void *) &gart, 0, sizeof(agp_gart));
-
--#if !defined (KERNEL_2_2)
- if (!(drm_agp_p = inter_module_get_request("drm_agp", "agpgart"))) {
- printk(KERN_ERR "NVRM: AGPGART: unable to retrieve symbol table\n");
- return 1;
-@@ -1298,24 +1228,6 @@
- agp_ops.unbind_memory = drm_agp_p->unbind_memory;
- agp_ops.enable = drm_agp_p->enable;
-
--#else
-- #if defined(CONFIG_KMOD)
-- if ( request_module("agpgart") ) {
-- printk(KERN_INFO "NVRM: AGPGART: not loading agpgart.o\n");
-- return 1;
-- }
-- #endif
--
-- GET_AGPGART_SYMBOL(agp_ops.backend_acquire, AGP_BACKEND_ACQUIRE_SYM);
-- GET_AGPGART_SYMBOL(agp_ops.backend_release, AGP_BACKEND_RELEASE_SYM);
-- GET_AGPGART_SYMBOL(agp_ops.copy_info, AGP_COPY_INFO_SYM);
-- GET_AGPGART_SYMBOL(agp_ops.allocate_memory, AGP_ALLOCATE_MEMORY_SYM);
-- GET_AGPGART_SYMBOL(agp_ops.free_memory, AGP_FREE_MEMORY_SYM);
-- GET_AGPGART_SYMBOL(agp_ops.bind_memory, AGP_BIND_MEMORY_SYM);
-- GET_AGPGART_SYMBOL(agp_ops.unbind_memory, AGP_UNBIND_MEMORY_SYM);
-- GET_AGPGART_SYMBOL(agp_ops.enable, AGP_ENABLE_SYM);
--#endif
--
- /* NOTE: from here down, return an error code of '-1'
- * that indicates that agpgart is loaded, but we failed to use it
- * in some way. This is so we don't try to use nvagp and lock up
-@@ -1338,44 +1250,15 @@
- if (os_read_registry_dword(NULL, "NVreg", "EnableAGPFW", &agp_fw) == RM_ERROR)
- agp_fw = 1;
- agp_fw &= 0x00000001;
--
-- (*(agp_ops.copy_info))(&agpinfo);
-
-- switch ( agpinfo.chipset ) {
-- case INTEL_GENERIC: chipset = "Intel"; break;
-- case INTEL_LX: chipset = "Intel 440LX"; break;
-- case INTEL_BX: chipset = "Intel 440BX"; break;
-- case INTEL_GX: chipset = "Intel 440GX"; break;
-- case INTEL_I810: chipset = "Intel i810"; break;
-- case INTEL_I840: chipset = "Intel i840"; break;
--#if !defined (KERNEL_2_2)
-- case INTEL_I815: chipset = "Intel i815"; break;
--#if !defined(__rh_config_h__)
-- case INTEL_I850: chipset = "Intel i850"; break;
--#endif
--#endif
--#if defined(NVCPU_IA64)
-- case INTEL_460GX: chipset = "Intel 460GX"; break;
--#endif
-- case VIA_GENERIC: chipset = "VIA"; break;
-- case VIA_VP3: chipset = "VIA VP3"; break;
-- case VIA_MVP3: chipset = "VIA MVP3"; break;
-- case VIA_MVP4: chipset = "VIA MVP4"; break;
--#if !defined (KERNEL_2_2)
-- case VIA_APOLLO_KX133: chipset = "VIA Apollo KX133"; break;
-- case VIA_APOLLO_KT133: chipset = "VIA Apollo KT133"; break;
--#endif
-- case VIA_APOLLO_PRO: chipset = "VIA Apollo Pro"; break;
-- case SIS_GENERIC: chipset = "SiS"; break;
-- case AMD_GENERIC: chipset = "AMD"; break;
-- case AMD_IRONGATE: chipset = "AMD Irongate"; break;
-- case ALI_M1541: chipset = "ALi M1541"; break;
-- case ALI_GENERIC: chipset = "ALi"; break;
-- case NOT_SUPPORTED: chipset = "unsupported"; break;
-- default: chipset = "unknown";
-+#ifdef KERNEL_2_5
-+ if (agp_ops.copy_info(&agpinfo) != 0) {
-+ printk("nvidia: chipset not supported by agpgart.o\n");
-+ agp_ops.backend_release();
- }
--
-- printk(KERN_INFO "NVRM: AGPGART: %s chipset\n", chipset);
-+#else
-+ (*(agp_ops.copy_info))(&agpinfo);
-+#endif
-
- #ifdef CONFIG_MTRR
- if ((gart.mtrr = mtrr_add(agpinfo.aper_base,
-@@ -1452,10 +1335,7 @@
- }
-
- (*(agp_ops.backend_release))();
--
--#if !defined (KERNEL_2_2)
- inter_module_put("drm_agp");
--#endif
-
- printk(KERN_INFO "NVRM: AGPGART: backend released\n");
- return 0;
-@@ -1593,13 +1473,9 @@
-
- agp_addr = agpinfo.aper_base + (agp_data->offset << PAGE_SHIFT);
-
-- err = remap_page_range(vma->vm_start, (size_t) agp_addr,
-+ err = REMAP_PAGE_RANGE(vma->vm_start, (size_t) agp_addr,
- agp_data->num_pages << PAGE_SHIFT,
--#if defined(NVCPU_IA64)
- vma->vm_page_prot);
--#else
-- PAGE_SHARED);
--#endif
-
- if (err) {
- printk(KERN_ERR "NVRM: AGPGART: unable to remap %lu pages\n",
-@@ -1782,12 +1658,10 @@
- if (sgi_funcs.add_barrier == NULL)
- {
- #if defined(TESTING_SWAP)
--#if !defined (KERNEL_2_2)
- inter_module_register(ADD_BARRIER_FUNC, THIS_MODULE, sgitest_add_barrier);
- inter_module_register(REMOVE_BARRIER_FUNC, THIS_MODULE, sgitest_remove_barrier);
- inter_module_register(SWAP_READY_FUNC, THIS_MODULE, sgitest_swap_ready);
- #endif
--#endif
- sgi_funcs.add_barrier = GET_MODULE_SYMBOL(0, ADD_BARRIER_FUNC);
- sgi_funcs.remove_barrier = GET_MODULE_SYMBOL(0, REMOVE_BARRIER_FUNC);
- sgi_funcs.swap_ready = GET_MODULE_SYMBOL(0, SWAP_READY_FUNC);
diff --git a/media-video/nvidia-kernel/files/NVIDIA_kernel-1.0-3123-2.5.54.diff b/media-video/nvidia-kernel/files/NVIDIA_kernel-1.0-3123-2.5.54.diff
deleted file mode 100644
index 5f595246a0c0..000000000000
--- a/media-video/nvidia-kernel/files/NVIDIA_kernel-1.0-3123-2.5.54.diff
+++ /dev/null
@@ -1,25 +0,0 @@
-diff -ru NVIDIA_kernel-1.0-3123/Makefile NVIDIA_kernel-1.0-3123-2.5.54/Makefile
---- NVIDIA_kernel-1.0-3123/Makefile Wed Jan 8 07:29:46 2003
-+++ NVIDIA_kernel-1.0-3123-2.5.54/Makefile Wed Jan 8 07:31:35 2003
-@@ -58,10 +58,10 @@
- # allow specification of alternate include file tree on command line and extra defines
- ifdef SYSINCLUDE
- INCLUDES += -I$(SYSINCLUDE)
--INCLUDES += -I$(SYSINCLUDE)/../arch/i386/mach-generic
-+INCLUDES += -I$(SYSINCLUDE)/asm/mach-default
- else
- INCLUDES += -I$(KERNINC)
--INCLUDES += -I$(KERNINC)/../arch/i386/mach-generic
-+INCLUDES += -I$(KERNINC)/asm/mach-default
- endif
-
- DEFINES+=$(EXTRA_DEFINES)
-@@ -120,7 +120,7 @@
- fi
-
- NVdriver: gcc-check $(LINUX_MODULE) $(RESMAN_KERNEL_MODULE)
-- ld -r -o $@ $(LINUX_MODULE) $(RESMAN_KERNEL_MODULE)
-+ ld -d -r -o $@ $(LINUX_MODULE) $(RESMAN_KERNEL_MODULE)
- size $@
-
- $(VERSION_HDR):
diff --git a/media-video/nvidia-kernel/files/NVIDIA_kernel-1.0-3123-pa.diff b/media-video/nvidia-kernel/files/NVIDIA_kernel-1.0-3123-pa.diff
deleted file mode 100644
index 3d4cc9ab12d1..000000000000
--- a/media-video/nvidia-kernel/files/NVIDIA_kernel-1.0-3123-pa.diff
+++ /dev/null
@@ -1,351 +0,0 @@
-diff -Naur NVIDIA_kernel-1.0-3123/nv-linux.h NVIDIA_kernel-1.0-3123-pa/nv-linux.h
---- NVIDIA_kernel-1.0-3123/nv-linux.h 2002-09-16 14:08:14.000000000 -0500
-+++ NVIDIA_kernel-1.0-3123-pa/nv-linux.h 2002-09-16 14:37:31.000000000 -0500
-@@ -127,6 +127,7 @@
- # define MEM_MAP_INC_COUNT(map_nr) (atomic_inc(&(map_nr)->count))
- # define MEM_MAP_DEC_COUNT(map_nr) (atomic_dec(&(map_nr)->count))
- # define GET_EVENT_QUEUE(nv) ((struct __wait_queue_head *) ((nv)->event_queue))
-+# define VMA_PRIVATE(vma) ((vma)->vm_private_data)
- #else
- # define in_irq() (local_irq_count[smp_processor_id()])
- # define LINUX_VMA_OFFS(vma) ((vma)->vm_offset)
-@@ -137,6 +138,7 @@
- # define MEM_MAP_INC_COUNT(map_nr) (atomic_inc(&mem_map[map_nr].count))
- # define MEM_MAP_DEC_COUNT(map_nr) (atomic_dec(&mem_map[map_nr].count))
- # define GET_EVENT_QUEUE(nv) ((struct wait_queue **) &((nv)->event_queue))
-+# define VMA_PRIVATE(vma) ((void*)((vma)->vm_pte))
- #endif
-
- #define NV_PAGE_ALIGN(addr) ( ((addr) + PAGE_SIZE - 1) / PAGE_SIZE)
-@@ -173,6 +175,7 @@
- typedef struct nv_alloc_s {
- struct nv_alloc_s *next;
- struct vm_area_struct *vma;
-+ unsigned int usage_count;
- unsigned int process_id;
- unsigned int thread_gid;
- unsigned int num_pages;
-diff -Naur NVIDIA_kernel-1.0-3123/nv.c NVIDIA_kernel-1.0-3123-pa/nv.c
---- NVIDIA_kernel-1.0-3123/nv.c 2002-09-16 14:08:12.000000000 -0500
-+++ NVIDIA_kernel-1.0-3123-pa/nv.c 2002-09-16 14:37:34.000000000 -0500
-@@ -85,11 +85,21 @@
- static int nvos_is_nv_device(struct pci_dev *dev);
- static int nvos_set_primary_card(nv_ioctl_primary_card_t *info);
- static int nvos_probe_devices(void);
--static void * nvos_malloc(unsigned long);
--static void nvos_free(void **);
--
- static void nvos_proc_create(void);
- static void nvos_proc_remove(void);
-+static void * nvos_malloc_pages(unsigned long);
-+static void nvos_unlock_pages(void **);
-+static void nvos_free_pages(void **);
-+
-+#define nvos_unlock_and_free_pages(count, page_list) \
-+ if (page_list) { \
-+ if (count == 0) \
-+ nvos_unlock_pages(page_list); \
-+ nvos_free_pages(page_list); \
-+ }
-+
-+static nv_alloc_t *nvos_create_alloc();
-+static int nvos_free_alloc(nv_alloc_t *);
-
- /* nvl_ functions.. take a linux state device pointer */
- static nv_alloc_t *nvl_find_alloc(nv_linux_state_t *, unsigned long, nv_alloc_t **);
-@@ -375,18 +385,39 @@
- * memory on systems with high memory support enabled.
- */
-
--static void *nvos_malloc(unsigned long size)
-+/* note that there's a subtle kernel interaction with regards to bookkeeping
-+ * on these pages. So long as the pages are marked reserved, the kernel won't
-+ * touch them (alter the usage count on them). this leads to a subtle problem
-+ * with mmap. Normally, allocating the pages would set the count to 1, then
-+ * mmaping them would bump the count up to 2. The order of unmapping and freeing
-+ * the pages wouldn't matter, as they wouldn't really be considered free by the
-+ * kernel until the count dropped back to 0. Since the kernel won't touch the
-+ * count when the page is reserved, we need to be careful about this order and
-+ * unreserving the pages. if we unreserve the pages while freeing them, and the
-+ * munmap comes later, the munmap code path will attempt a second free on the
-+ * same pages. We also don't have a lot of control over which comes first,
-+ * sometimes we'll get called to free the pages first, sometimes we'll get called
-+ * to munmap them first. Oh, and we'll get vma open/close calls every time the
-+ * process is cloned, then execv'd, and munmap == vma close.
-+ * sooo, we keep our own count of the allocation usage, and don't unreserve the
-+ * pages until our count drops to 0. this should currently happen in either
-+ * vma_release or nvos_free, both of which will be followed by a kernel attempt
-+ * to free the page. Since the page fill finally be unreserved, the kernel will
-+ * reduce the count to 0 and successfully free the page for us, only once.
-+ * sigh... you have to love s&%*^y interfaces that force you to *know* too much
-+ * about kernel internals.
-+ */
-+
-+static void *nvos_malloc_pages(unsigned long pages_needed)
- {
- unsigned long *page_list = NULL;
- unsigned long *page_ptr = NULL;
-- unsigned int pages_needed;
- unsigned int page_list_size;
-
- /*
- * allocate a pointer for each physical page and an
- * integer to hold the number of pages allocated
- */
-- pages_needed = (size >> PAGE_SHIFT);
- page_list_size = (pages_needed + 1) * sizeof(unsigned long *);
-
- page_list = vmalloc(page_list_size);
-@@ -435,11 +466,15 @@
- return NULL;
- }
-
--static void nvos_free(void **page_list)
-+// unlock the pages we've locked down for dma purposes
-+static void nvos_unlock_pages(void **page_list)
- {
- unsigned long *page_ptr;
- unsigned int pages_left;
-
-+ if (page_list == NULL)
-+ return;
-+
- page_ptr = (unsigned long *) page_list;
-
- /* retrieve the number of pages allocated */
-@@ -447,11 +482,70 @@
-
- while (pages_left) {
- mem_map_unreserve(GET_MAP_NR(*page_ptr));
-+ pages_left--;
-+ }
-+}
-+
-+static void nvos_free_pages(void **page_list)
-+{
-+ unsigned long *page_ptr;
-+ unsigned int pages_left;
-+
-+ if (page_list == NULL)
-+ return;
-+
-+ page_ptr = (unsigned long *) page_list;
-+
-+ /* retrieve the number of pages allocated */
-+ pages_left = *(unsigned int *) (page_list - 1);
-+
-+ while (pages_left) {
- free_page((unsigned long) phys_to_virt(*page_ptr++));
- pages_left--;
- }
-+}
-
-- vfree(page_list);
-+static
-+nv_alloc_t *nvos_create_alloc(void)
-+{
-+ nv_alloc_t *at;
-+
-+ NV_KMALLOC(at, sizeof(nv_alloc_t));
-+ if (at == NULL)
-+ return NULL;
-+
-+ memset(at, 0, sizeof(nv_alloc_t));
-+
-+ at->process_id = current->pid;
-+#if !defined (KERNEL_2_2)
-+ at->thread_gid = current->tgid;
-+#else
-+ at->thread_gid = -1;
-+#endif
-+
-+ return at;
-+}
-+
-+static
-+int nvos_free_alloc(
-+ nv_alloc_t *at
-+)
-+{
-+ if (at == NULL)
-+ return -1;
-+
-+ if (at->usage_count)
-+ return 1;
-+
-+ // we keep the page_table around after freeing the pages
-+ // for bookkeeping reasons. Free the page_table and assume
-+ // the underlying pages are already unlocked and freed.
-+ if (at->page_table)
-+ vfree(at->page_table - 1);
-+
-+ NV_KFREE(at);
-+
-+ return 0;
- }
-
- static u8 nvos_find_agp_capability(struct pci_dev *dev)
-@@ -998,6 +1092,12 @@
- void
- nv_kern_vma_open(struct vm_area_struct *vma)
- {
-+ if (VMA_PRIVATE(vma))
-+ {
-+ nv_alloc_t *at = (nv_alloc_t *) VMA_PRIVATE(vma);
-+ at->usage_count++;
-+ }
-+
- MOD_INC_USE_COUNT;
- }
-
-@@ -1005,6 +1105,25 @@
- void
- nv_kern_vma_release(struct vm_area_struct *vma)
- {
-+ if (VMA_PRIVATE(vma))
-+ {
-+ nv_alloc_t *at = (nv_alloc_t *) VMA_PRIVATE(vma);
-+
-+ at->usage_count--;
-+
-+ // if usage_count is down to 0, the kernel virtual mapping was freed
-+ // but the underlying physical pages were not, due to the reserved bit
-+ // being set. We need to clear the reserved bit, then munmap will
-+ // zap the pages and free the physical pages.
-+ if (at->usage_count == 0)
-+ {
-+ if (at->page_table)
-+ nvos_unlock_pages(at->page_table);
-+ nvos_free_alloc(at);
-+ VMA_PRIVATE(vma) = NULL;
-+ }
-+ }
-+
- MOD_DEC_USE_COUNT;
- }
-
-@@ -1345,6 +1464,8 @@
- }
-
- at->vma = vma;
-+ VMA_PRIVATE(vma) = at;
-+ at->usage_count++;
-
- start = vma->vm_start;
- while (pages--)
-@@ -1377,6 +1498,8 @@
- }
-
- at->vma = vma;
-+ VMA_PRIVATE(vma) = at;
-+ at->usage_count++;
-
- if (NV_OSAGP_ENABLED(nv))
- {
-@@ -2224,24 +2347,14 @@
- int rm_status = 0;
- nv_linux_state_t *nvl = (nv_linux_state_t *) nv;
-
-- NV_KMALLOC(at, sizeof(nv_alloc_t));
-+ at = nvos_create_alloc();
- if (at == NULL)
- return RM_ERROR;
-
-- memset(at, 0, sizeof(nv_alloc_t));
--
- page_count = RM_PAGES_TO_OS_PAGES(page_count);
- at->num_pages = page_count;
--
-- at->process_id = current->pid;
--#if !defined (KERNEL_2_2)
-- at->thread_gid = current->tgid;
--#else
-- at->thread_gid = -1;
--#endif
--
- at->class = class;
-- at->vma = NULL;
-+ at->usage_count++;
-
- if (at->class == NV01_ROOT)
- {
-@@ -2287,7 +2400,7 @@
- NV_ADD_AT(nvl, at);
- } else {
- /* use nvidia's nvagp support */
-- at->page_table = nvos_malloc(page_count << PAGE_SHIFT);
-+ at->page_table = nvos_malloc_pages(page_count);
- if (at->page_table == NULL)
- goto failed;
-
-@@ -2311,7 +2424,7 @@
- nv->agp_buffers++;
- } else {
- /* allocate general system memory */
-- at->page_table = nvos_malloc(page_count << PAGE_SHIFT);
-+ at->page_table = nvos_malloc_pages(page_count);
- if (at->page_table == NULL)
- goto failed;
-
-@@ -2324,10 +2437,10 @@
- failed:
- /* free any pages we may have allocated */
- if (at->page_table)
-- nvos_free(at->page_table);
-+ nvos_unlock_and_free_pages(at->usage_count, at->page_table);
-+
-+ nvos_free_alloc(at);
-
-- /* free it */
-- NV_KFREE(at);
- return -1;
- }
-
-@@ -2365,17 +2478,19 @@
- NV_REMOVE_AT_FROM_LIST(nvl, at, prev);
- nv_unlock_at(nv);
-
-+ at->usage_count--;
-+
- if (NV_OSAGP_ENABLED(nv))
- {
- rmStatus = KernFreeAGPPages(pAddress, priv_data);
- } else {
- rmStatus = rm_free_agp_pages(nv, pAddress, priv_data);
-- if (rmStatus == 0x0)
-- nvos_free(at->page_table);
-+ if (rmStatus == RM_OK)
-+ nvos_unlock_and_free_pages(at->usage_count, at->page_table);
- }
-
- /* we may hold off on disabling agp until all buffers are freed */
-- if (rmStatus == 0x0)
-+ if (rmStatus == RM_OK)
- {
- nv->agp_buffers--;
- if (!nv->agp_buffers && nv->agp_teardown)
-@@ -2390,6 +2505,8 @@
- NV_REMOVE_AT_FROM_LIST(nvl, at, prev);
- nv_unlock_at(nv);
-
-+ at->usage_count--;
-+
- if (at->class == NV01_ROOT)
- {
- int order, i;
-@@ -2407,11 +2524,13 @@
- }
- else
- {
-- nvos_free(at->page_table);
-+ nvos_unlock_and_free_pages(at->usage_count, at->page_table);
- }
- }
-
-- NV_KFREE(at);
-+ if (at->usage_count == 0)
-+ nvos_free_alloc(at);
-+
- return rmStatus;
- }
-
diff --git a/media-video/nvidia-kernel/files/NVIDIA_kernel-1.0-4191-2.5-tl.diff b/media-video/nvidia-kernel/files/NVIDIA_kernel-1.0-4191-2.5-tl.diff
deleted file mode 100644
index 5996d77859fe..000000000000
--- a/media-video/nvidia-kernel/files/NVIDIA_kernel-1.0-4191-2.5-tl.diff
+++ /dev/null
@@ -1,1262 +0,0 @@
-diff -ru NVIDIA_kernel-1.0-4191/Makefile NVIDIA_kernel-1.0-4191-2.5-tl/Makefile
---- NVIDIA_kernel-1.0-4191/Makefile Mon Dec 9 12:27:15 2002
-+++ NVIDIA_kernel-1.0-4191-2.5-tl/Makefile Fri Dec 27 05:36:52 2002
-@@ -2,7 +2,7 @@
- # Generated on 'builder3.nvidia.com' on Mon Dec 9 11:49:03 PST 2002
-
- LINUX_MODULE=nv-linux.o
--DEFINES=-D__KERNEL__ -DMODULE -D_LOOSE_KERNEL_NAMES -DNTRM -D_GNU_SOURCE -D_LOOSE_KERNEL_NAMES -D__KERNEL__ -DMODULE -DNV_MAJOR_VERSION=1 -DNV_MINOR_VERSION=0 -DNV_PATCHLEVEL=4191 -DNV_UNIX -DNV_LINUX -DNV_INT64_OK -DNVCPU_X86
-+DEFINES=-D__KERNEL__ -DMODULE -D_LOOSE_KERNEL_NAMES -DKBUILD_MODNAME="nvidia" -DNTRM -D_GNU_SOURCE -D_LOOSE_KERNEL_NAMES -D__KERNEL__ -DMODULE -DNV_MAJOR_VERSION=1 -DNV_MINOR_VERSION=0 -DNV_PATCHLEVEL=4191 -DNV_UNIX -DNV_LINUX -DNV_INT64_OK -DNVCPU_X86
- INCLUDES=-I.
-
- OBJECTS=nv.o os-agp.o os-interface.o os-registry.o
-@@ -22,8 +22,10 @@
- # this is slightly more brain-dead, but works..
- ifeq ($(shell if test -d $(KERNDIR)/build; then echo yes; fi),yes)
- KERNINC=$(KERNDIR)/build/include
-+MACHINC=$(KERNDIR)/build/arch/i386/mach-generic
- else
- KERNINC=/usr/src/linux/include
-+MACHINC=/usr/src/linux/arch/i386/mach-generic
- endif
-
- ifeq ($(shell if test -d $(KERNDIR)/kernel; then echo yes; fi),yes)
-@@ -58,8 +60,10 @@
- # allow specification of alternate include file tree on command line and extra defines
- ifdef SYSINCLUDE
- INCLUDES += -I$(SYSINCLUDE)
-+INCLUDES += -I$(SYSINCLUDE)/../arch/i386/mach-generic
- else
- INCLUDES += -I$(KERNINC)
-+INCLUDES += -I$(MACHINC)
- endif
-
- DEFINES+=$(EXTRA_DEFINES)
-diff -ru NVIDIA_kernel-1.0-4191/nv-linux.h NVIDIA_kernel-1.0-4191-2.5-tl/nv-linux.h
---- NVIDIA_kernel-1.0-4191/nv-linux.h Mon Dec 9 12:27:15 2002
-+++ NVIDIA_kernel-1.0-4191-2.5-tl/nv-linux.h Fri Dec 27 03:56:49 2002
-@@ -28,19 +28,16 @@
- #include <linux/module.h>
- #include <linux/version.h>
-
--#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 2, 12)
--# error This driver does not support 2.2.11 or earlier kernels!
--#elif LINUX_VERSION_CODE < KERNEL_VERSION(2, 3, 0)
--# define KERNEL_2_2
-+#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 3, 0)
-+# error This driver does not support 2.2.x kernels!
- #elif LINUX_VERSION_CODE < KERNEL_VERSION(2, 4, 0)
--# error This driver does not support 2.3.x development kernels!
-+# error This driver does not support 2.3.x kernels!
- #elif LINUX_VERSION_CODE < KERNEL_VERSION(2, 5, 0)
- # define KERNEL_2_4
- #elif LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 0)
--# error This driver does not support 2.5.x development kernels!
- # define KERNEL_2_5
- #else
--# error This driver does not support 2.6.x or newer kernels!
-+# error This driver does not support your kernel!
- #endif
-
- #if defined (__ia64)
-@@ -58,7 +55,6 @@
- #include <linux/list.h> /* circular linked list */
- #include <linux/stddef.h> /* NULL, offsetof */
- #include <linux/wait.h> /* wait queues */
--#include <linux/tqueue.h> /* struct tq_struct */
-
- #include <linux/slab.h> /* kmalloc, kfree, etc */
- #include <linux/vmalloc.h> /* vmalloc, vfree, etc */
-@@ -66,9 +62,15 @@
- #include <linux/poll.h> /* poll_wait */
- #include <linux/delay.h> /* mdelay, udelay */
-
-+#ifdef KERNEL_2_5
-+#include <linux/sched.h> /* suser(), capable() replacement */
-+#include <linux/smp_lock.h> /* kernel_locked */
-+#include <asm/kmap_types.h> /* page table entry lookup */
-+#endif
-+
- #include <linux/pci.h> /* pci_find_class, etc */
- #include <linux/wrapper.h> /* mem_map_reserve */
--#include <linux/interrupt.h> /* mark_bh, init_bh, remove_bh */
-+#include <linux/interrupt.h> /* tasklets, interrupt helpers */
- #include <linux/timer.h>
-
- #include <asm/system.h> /* cli, sli, save_flags */
-@@ -77,14 +79,9 @@
- #include <asm/page.h> /* PAGE_OFFSET */
- #include <asm/pgtable.h> /* pte bit definitions */
-
--#if !defined (KERNEL_2_2)
- #include <linux/spinlock.h>
- #include <asm/semaphore.h>
- #include <linux/highmem.h>
--#else
--#include <asm/spinlock.h>
--#include <asm/semaphore.h>
--#endif
-
- #ifdef CONFIG_PROC_FS
- #include <linux/proc_fs.h>
-@@ -123,28 +120,58 @@
- for (pos = (head)->next; pos != (head); pos = (pos)->next)
- #endif
-
--#if !defined (KERNEL_2_2)
--# define LINUX_VMA_OFFS(vma) (((vma)->vm_pgoff) << PAGE_SHIFT)
--# define GET_MODULE_SYMBOL(mod,sym) (const void *) inter_module_get(sym)
--# define PUT_MODULE_SYMBOL(sym) inter_module_put((char *) sym)
--# define GET_MAP_NR(phys_page) virt_to_page(__va(phys_page))
--# define MEM_MAP_READ_COUNT(map_nr) (atomic_read(&(map_nr)->count))
--# define MEM_MAP_INC_COUNT(map_nr) (atomic_inc(&(map_nr)->count))
--# define MEM_MAP_DEC_COUNT(map_nr) (atomic_dec(&(map_nr)->count))
--# define GET_EVENT_QUEUE(nv) ((struct __wait_queue_head *) ((nv)->event_queue))
--# define VMA_PRIVATE(vma) ((vma)->vm_private_data)
--#else
--# define in_irq() (local_irq_count[smp_processor_id()])
--# define LINUX_VMA_OFFS(vma) ((vma)->vm_offset)
--# define GET_MODULE_SYMBOL(mod, sym) (void*) get_module_symbol((mod), (sym))
--# define PUT_MODULE_SYMBOL(sym)
--# define GET_MAP_NR(phys_page) MAP_NR(__va(phys_page))
--# define MEM_MAP_READ_COUNT(map_nr) (atomic_read(&mem_map[map_nr].count))
--# define MEM_MAP_INC_COUNT(map_nr) (atomic_inc(&mem_map[map_nr].count))
--# define MEM_MAP_DEC_COUNT(map_nr) (atomic_dec(&mem_map[map_nr].count))
--# define GET_EVENT_QUEUE(nv) ((struct wait_queue **) &((nv)->event_queue))
--# define VMA_PRIVATE(vma) ((void*)((vma)->vm_pte))
--#endif
-+#define LINUX_VMA_OFFS(vma) (((vma)->vm_pgoff) << PAGE_SHIFT)
-+#define GET_MODULE_SYMBOL(mod,sym) (const void *) inter_module_get(sym)
-+#define PUT_MODULE_SYMBOL(sym) inter_module_put((char *) sym)
-+#define GET_MAP_NR(phys_page) virt_to_page(__va(phys_page))
-+#define MEM_MAP_READ_COUNT(map_nr) (atomic_read(&(map_nr)->count))
-+#define MEM_MAP_INC_COUNT(map_nr) (atomic_inc(&(map_nr)->count))
-+#define MEM_MAP_DEC_COUNT(map_nr) (atomic_dec(&(map_nr)->count))
-+#define VMA_PRIVATE(vma) ((vma)->vm_private_data)
-+
-+#ifdef KERNEL_2_5
-+# define NV_DEVICE_NUMBER(_minor) ((kdev_val(_minor)) & 0x0f)
-+# define NV_IS_CONTROL_DEVICE(_minor) (((kdev_val(_minor)) & 0xff) == 0xff)
-+# define SUSER() capable(CAP_SYS_ADMIN)
-+# define REMAP_PAGE_RANGE(a...) remap_page_range(vma, ## a)
-+# define CLI() local_irq_disable()
-+# define SAVE_FLAGS(x) local_save_flags(x)
-+# define RESTORE_FLAGS(x) local_irq_restore(x)
-+# define MAY_SLEEP() (!in_interrupt() && !in_atomic())
-+# define SMP_NUM_CPUS num_online_cpus()
-+#else
-+# define NV_DEVICE_NUMBER(_minor) ((_minor) & 0x0f)
-+# define NV_IS_CONTROL_DEVICE(_minor) (((_minor) & 0xff) == 0xff)
-+# define SUSER() suser()
-+# define REMAP_PAGE_RANGE(a...) remap_page_range(## a)
-+# define CLI() cli()
-+# define SAVE_FLAGS(x) save_flags(x)
-+# define RESTORE_FLAGS(x) restore_flags(x)
-+# define MAY_SLEEP() (!in_interrupt())
-+# define SMP_NUM_CPUS smp_num_cpus
-+#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) )
-@@ -208,7 +235,8 @@
- static inline int NV_IRQL_IS_RAISED()
- {
- unsigned long int eflags;
-- __save_flags(eflags);
-+ /* FIXME: no __save_flags directive under 2.5 */
-+ SAVE_FLAGS(eflags);
- return !(eflags & NV_CPU_INTERRUPT_FLAGS_BIT);
- }
-
-@@ -265,16 +293,15 @@
-
- nv_alloc_t *alloc_queue;
-
-- // bottom half interrupt handler info; per device
-- /* keep track of any pending bottom-halves */
-- struct tq_struct *bh;
-+ /* tasklets */
-+ struct tasklet_struct tl;
-+ wait_queue_head_t wq;
-+
-+ /* bh counter */
- atomic_t bh_count;
-
- U032 vblank_notifier;
- U032 waiting_for_vblank;
--
-- /* queue for for NV's OS events */
-- void *event_queue;
-
- /* get a timer callback every second */
- struct timer_list rc_timer;
-diff -ru NVIDIA_kernel-1.0-4191/nv.c NVIDIA_kernel-1.0-4191-2.5-tl/nv.c
---- NVIDIA_kernel-1.0-4191/nv.c Mon Dec 9 12:27:15 2002
-+++ NVIDIA_kernel-1.0-4191-2.5-tl/nv.c Fri Dec 27 04:56:44 2002
-@@ -36,24 +36,12 @@
- // keep track of opened clients and their process id so they
- // can be free'd up on abnormal close
- nv_client_t nv_clients[NV_MAX_CLIENTS];
--struct tq_struct nv_bottom_halves[NV_MAX_CLIENTS];
--
-
- #ifdef CONFIG_DEVFS_FS
- devfs_handle_t nv_dev_handle[NV_MAX_DEVICES];
- devfs_handle_t nv_ctl_handle;
- #endif
-
--/*
-- * pick apart our minor device number
-- * low 3 bits is NV device
-- * if 255, then its the control device
-- */
--
--#define NV_DEVICE_NUMBER(_minor) ((_minor) & 0x0f)
--#define NV_DEVICE_IS_CONTROL_DEVICE(_minor) \
-- (((_minor) & 0xFF) == 0xFF)
--
- // #define NV_DBG_MEM 1
- #undef NV_DBG_MEM
-
-@@ -104,10 +92,6 @@
- *** EXPORTS to Linux Kernel
- ***/
-
--/* linux module interface functions (called by linux kernel) */
--int init_module(void);
--void cleanup_module(void);
--
- /* nv_kern_ functions, interfaces used by linux kernel */
- void nv_kern_vma_open(struct vm_area_struct *vma);
- void nv_kern_vma_release(struct vm_area_struct *vma);
-@@ -142,6 +126,9 @@
- /* character driver entry points */
-
- static struct file_operations nv_fops = {
-+#ifdef KERNEL_2_5
-+ owner: THIS_MODULE,
-+#endif
- poll: nv_kern_poll,
- ioctl: nv_kern_ioctl,
- mmap: nv_kern_mmap,
-@@ -565,12 +552,7 @@
- nv_linux_state_t *nvl;
- nv_linux_state_t *nv_max_devices;
-
--#if defined (KERNEL_2_2)
-- proc[DRIVER] = create_proc_entry("driver", flags, &proc_root);
--#else
- proc[DRIVER] = proc_root_driver;
--#endif
--
- proc[NVIDIA] = create_proc_entry("nvidia", flags, proc[DRIVER]);
- proc[AGP] = create_proc_entry("agp", flags, proc[NVIDIA]);
- proc[CARDS] = create_proc_entry("cards", flags, proc[NVIDIA]);
-@@ -623,14 +605,9 @@
- static void nvos_proc_remove(void)
- {
- #ifdef CONFIG_PROC_FS
--#if defined (KERNEL_2_2)
-- remove_proc_entry("driver", &proc_root);
-- remove_proc_entry("nv", &proc_root);
--#else
- remove_proc_entry("nvidia", proc_root_driver);
- remove_proc_entry("nv", &proc_root);
- #endif
--#endif
- }
-
- /*
-@@ -717,12 +694,10 @@
- /***
- *** EXPORTS to Linux Kernel
- ***/
--
--int init_module(void)
-+static int __init nvidia_module_init(void)
- {
-- nv_linux_state_t *nvl;
- int rc;
-- int num_devices;
-+ int num_devices, i;
-
- memset(nv_linux_devices, 0, sizeof(nv_linux_devices));
- num_devices = nvos_probe_devices();
-@@ -734,14 +709,14 @@
-
- nv_printf(NV_DBG_ERRORS, "nvidia: loading %s\n", pNVRM_ID);
-
--#ifdef CONFIG_DEVFS_FS
-+#if defined (CONFIG_DEVFS_FS) && !defined (KERNEL_2_5)
- rc = devfs_register_chrdev(nv_major, "nvidia", &nv_fops);
- #else
- rc = register_chrdev(nv_major, "nvidia", &nv_fops);
- #endif
-
- if (rc < 0) {
-- nv_printf(NV_DBG_ERRORS, "init_module: register failed\n");
-+ nv_printf(NV_DBG_ERRORS, "nvidia_module_init: register failed\n");
- return rc;
- }
-
-@@ -749,7 +724,6 @@
- memset(nv_dev_handle, 0, sizeof(devfs_handle_t) * NV_MAX_DEVICES);
- do {
- char name[10];
-- int i;
-
- nv_ctl_handle = devfs_register(NULL, "nvidiactl",
- DEVFS_FL_DEFAULT, nv_major, 255,
-@@ -766,23 +740,30 @@
- } while(0);
- #endif
-
-- nv_printf(NV_DBG_INFO, "init_module: major number %d\n", nv_major);
-+ nv_printf(NV_DBG_INFO, "nvidia_module_init: major number %d\n", nv_major);
-
-- // init all the bottom half structures
-- for (nvl = nv_linux_devices; nvl < nv_linux_devices + NV_MAX_DEVICES; nvl++)
-- {
-- nvl->bh = &nv_bottom_halves[nvl - nv_linux_devices];
-- nvl->bh->routine = nv_kern_bh;
-- nvl->bh->data = (void *) nvl;
-- nvl->bh->sync = 0;
-+ /* instantiate tasklets */
-+ for (i = 0; i < NV_MAX_DEVICES; i++) {
-+ /*
-+ * We keep one tasklet per card to avoid latency issues with more
-+ * than one device, no two instances of a single tasklet are ever
-+ * executed concurrently.
-+ */
-+ atomic_set(&nv_linux_devices[i].tl.count, 1);
-+
-+ /*
-+ * Initialize the event queue for this device. This only needs to
-+ * happen once for every device.
-+ */
-+ init_waitqueue_head(&nv_linux_devices[i].wq);
- }
-
- // init the nvidia control device
- {
- nv_state_t *nv_ctl = NV_STATE_PTR(&nv_ctl_device);
-- nv_ctl_device.event_queue = NULL;
- nv_ctl->os_state = (void *) &nv_ctl_device;
- nv_lock_init_locks(nv_ctl);
-+ init_waitqueue_head(&nv_ctl_device.wq);
- }
-
- #ifdef CONFIG_PM
-@@ -810,7 +791,7 @@
- return 0;
-
- failed:
--#ifdef CONFIG_DEVFS_FS
-+#if defined (CONFIG_DEVFS_FS) && !defined (KERNEL_2_5)
- devfs_unregister_chrdev(nv_major, "nvidia");
- #else
- unregister_chrdev(nv_major, "nvidia");
-@@ -818,7 +799,7 @@
- return rc;
- }
-
--void cleanup_module(void)
-+static void __exit nvidia_module_exit(void)
- {
- int rc;
- nv_linux_state_t *nvl;
-@@ -827,7 +808,7 @@
- /* remove /proc/driver/nvidia */
- nvos_proc_remove();
-
-- nv_printf(NV_DBG_INFO, "cleanup_module\n");
-+ nv_printf(NV_DBG_INFO, "nvidia_module_exit\n");
-
- #ifdef CONFIG_PM
- /* XXX PM egads, is this the right place to do this? */
-@@ -850,20 +831,20 @@
- continue;
-
- nv_printf(NV_DBG_ERRORS,
-- "still have vm que at cleanup_module(): 0x%x to 0x%x\n",
-+ "still have vm que at nvidia_module_exit(): 0x%x to 0x%x\n",
- nvl->alloc_queue->vma->vm_start,
- nvl->alloc_queue->vma->vm_end);
- }
- }
-
--#ifdef CONFIG_DEVFS_FS
-+#if defined (CONFIG_DEVFS_FS) && !defined (KERNEL_2_5)
- rc = devfs_unregister_chrdev(nv_major, "nvidia");
- #else
- rc = unregister_chrdev(nv_major, "nvidia");
- #endif
-
- if (rc < 0) {
-- nv_printf(NV_DBG_ERRORS, "cleanup_module: unregister nv failed\n");
-+ nv_printf(NV_DBG_ERRORS, "nvidia_module_exit: unregister nv failed\n");
- }
-
- #ifdef CONFIG_DEVFS_FS
-@@ -877,6 +858,8 @@
- #endif
- }
-
-+module_init(nvidia_module_init);
-+module_exit(nvidia_module_exit);
-
- /* this is only called when the vmas are duplicated.
- * this appears to only happen when the process is cloned to create
-@@ -903,7 +886,9 @@
- nvos_list_page_count(at->page_table, at->num_pages);
- }
-
-+#ifndef KERNEL_2_5
- MOD_INC_USE_COUNT;
-+#endif
- }
-
-
-@@ -937,18 +922,12 @@
- }
- }
-
-+#ifndef KERNEL_2_5
- MOD_DEC_USE_COUNT;
-+#endif
- }
-
-
--/* at this point, this code just plain won't work with 2.2 kernels.
-- * additionally, only ia64 & the 460GX need a nopage handler, and 2.2 doesn't
-- * work on ia64 anyways. It's expected that at some point other agp chipsets
-- * will work similar to the 460GX (AGP 3.0 spec), so pre-emptively make sure
-- * this works on our standard ia32 driver.
-- */
--#if !defined(KERNEL_2_2)
--
- /* AGP allocations under the 460GX are not mapped to the aperture
- * addresses by the CPU. This nopage handler will fault on CPU
- * accesses to AGP memory and map the address to the correct page.
-@@ -1022,14 +1001,11 @@
-
- return page_ptr;
- }
--#endif
-
- struct vm_operations_struct nv_vm_ops = {
- nv_kern_vma_open,
- nv_kern_vma_release, /* "close" */
--#if !defined(KERNEL_2_2)
- nv_kern_vma_nopage,
--#endif
- };
-
-
-@@ -1060,7 +1036,7 @@
-
- /* for control device, just jump to its open routine */
- /* after setting up the private data */
-- if (NV_DEVICE_IS_CONTROL_DEVICE(inode->i_rdev))
-+ if (NV_IS_CONTROL_DEVICE(inode->i_rdev))
- return nv_kern_ctl_open(inode, file);
-
- /* what device are we talking about? */
-@@ -1071,8 +1047,9 @@
- goto failed;
- }
-
--
-+#ifndef KERNEL_2_5
- MOD_INC_USE_COUNT;
-+#endif
-
- nvl = &nv_linux_devices[devnum];
- nv = NV_STATE_PTR(nvl);
-@@ -1120,17 +1097,14 @@
- rc = -EIO;
- goto failed;
- }
--
--#if !defined (KERNEL_2_2)
-- NV_KMALLOC(nvl->event_queue, sizeof(struct __wait_queue_head));
-- if (nvl->event_queue == NULL)
-- goto failed;
-- memset(nvl->event_queue, 0, sizeof(struct __wait_queue_head));
--
-- init_waitqueue_head(GET_EVENT_QUEUE(nvl));
--#else
-- nvl->event_queue = NULL;
--#endif
-+
-+ /*
-+ * Finalise the tasklet initialisation started in nvidia_module_init and
-+ * enable bottom-half processing.
-+ */
-+ nvl->tl.func = (void *) rm_isr_bh;
-+ nvl->tl.data = (unsigned long) nv->pdev;
-+ tasklet_enable(&nvl->tl);
-
- nv->flags |= NV_FLAG_OPEN;
- }
-@@ -1141,7 +1115,9 @@
- return rc;
-
- failed:
-+#ifndef KERNEL_2_5
- MOD_DEC_USE_COUNT;
-+#endif
- nv_unlock_ldata(nv);
- return rc;
- }
-@@ -1163,7 +1139,7 @@
-
- /* for control device, just jump to its open routine */
- /* after setting up the private data */
-- if (NV_DEVICE_IS_CONTROL_DEVICE(inode->i_rdev))
-+ if (NV_IS_CONTROL_DEVICE(inode->i_rdev))
- return nv_kern_ctl_close(inode, file);
-
- nv_printf(NV_DBG_INFO, "nv_kern_close on device %d\n", NV_DEVICE_NUMBER(inode->i_rdev));
-@@ -1173,28 +1149,22 @@
- nv_lock_ldata(nv);
- if (--nv->usage_count == 0)
- {
-- int counter = 0;
--
-- /* turn off interrupts.
-- ** be careful to make sure any pending bottom half gets run
-- ** or disabled before calling rm_shutdown_adapter() since
-- ** it will free up the pdev. This is hard to see on single
-- ** cpu systems, but easy on dual cpu :-)
-- */
-+ /*
-+ * The usage count for this device has dropped to zero, it can be
-+ * safely shut down; the first step is to disable interrupts.
-+ */
- rm_disable_adapter(nv);
-
-- /* give it a moment to allow any bottom half to run */
--
--#define MAX_BH_TASKS 10
-- while (NV_ATOMIC_READ(nvl->bh_count) && (counter < MAX_BH_TASKS))
-- {
-- current->state = TASK_INTERRUPTIBLE;
-- schedule_timeout(HZ/50);
-- counter++;
-- }
--
-- /* free the irq, which may block until any pending interrupts */
-- /* are done being processed. */
-+ /*
-+ * Disable this device's tasklet to make sure that no bottom-half
-+ * will run with an undefined device state.
-+ */
-+ tasklet_disable(&nvl->tl);
-+
-+ /*
-+ * Free the irq, which may block until any pending interrupts
-+ * are done being processed.
-+ */
- free_irq(nv->interrupt_line, (void *) nv);
-
- rm_shutdown_adapter(nv);
-@@ -1214,12 +1184,6 @@
- }
- }
-
--#if !defined (KERNEL_2_2)
-- /* this only needs to be freed on 2.4 and later kernels */
-- NV_KFREE(nvl->event_queue);
-- nvl->event_queue = NULL;
--#endif
--
- /* leave INIT flag alone so we don't reinit every time */
- nv->flags &= ~(NV_FLAG_OPEN | NV_FLAG_WAITING);
- }
-@@ -1228,9 +1192,12 @@
- /* free up our per file private data */
- if (file->private_data)
- NV_KFREE(file->private_data);
-+
- file->private_data = (void *) 0;
-
-+#ifndef KERNEL_2_5
- MOD_DEC_USE_COUNT;
-+#endif
-
- return 0;
- }
-@@ -1267,7 +1234,6 @@
- * figure out the range and map it in
- */
-
--
- /* NV reg space */
- if (IS_REG_OFFSET(nv, LINUX_VMA_OFFS(vma), vma->vm_end - vma->vm_start))
- {
-@@ -1276,7 +1242,8 @@
- pages = nv->regs->size / PAGE_SIZE;
-
- vma->vm_page_prot = pgprot_noncached(vma->vm_page_prot);
-- if (remap_page_range(vma->vm_start,
-+
-+ if (REMAP_PAGE_RANGE(vma->vm_start,
- LINUX_VMA_OFFS(vma),
- vma->vm_end - vma->vm_start,
- vma->vm_page_prot))
-@@ -1295,7 +1262,8 @@
- pages = nv->fb->size / PAGE_SIZE;
-
- vma->vm_page_prot = pgprot_noncached(vma->vm_page_prot);
-- if (remap_page_range(vma->vm_start,
-+
-+ if (REMAP_PAGE_RANGE(vma->vm_start,
- LINUX_VMA_OFFS(vma),
- vma->vm_end - vma->vm_start,
- vma->vm_page_prot))
-@@ -1340,9 +1308,7 @@
- }
- else
- {
-- rm_map_agp_pages(nv, (void **) &vma->vm_start,
-- at->class, at->priv_data);
--
-+ rm_map_agp_pages(nv, (void **) &vma, at->class, at->priv_data);
- }
- nvos_list_page_count(at->page_table, at->num_pages);
- nv_unlock_at(nv);
-@@ -1384,7 +1350,7 @@
- while (pages--)
- {
- page = (unsigned long) at->page_table[i++];
-- if (remap_page_range(start, page, PAGE_SIZE, PAGE_SHARED))
-+ if (REMAP_PAGE_RANGE(start, page, PAGE_SIZE, PAGE_SHARED))
- return -EAGAIN;
- start += PAGE_SIZE;
- pos += PAGE_SIZE;
-@@ -1398,8 +1364,10 @@
-
- vma->vm_file = file;
-
-+#ifndef KERNEL_2_5
- /* just increment usage count, rather than calling vma_open */
- MOD_INC_USE_COUNT;
-+#endif
-
- return 0;
- }
-@@ -1425,8 +1393,7 @@
- return nv_kern_ctl_poll (file, wait);
-
- // add us to the list
-- poll_wait(file, GET_EVENT_QUEUE(nvl), wait);
--
-+ poll_wait(file, &nvl->wq, wait);
- nv_lock_ldata(nv);
-
- // wake the user on any file-specific event, or a general vblank
-@@ -1505,11 +1472,15 @@
-
- switch (_IOC_NR(cmd))
- {
-+#ifdef KERNEL_2_5
-+ /* use rusty's "forced unload" kernel module option */
-+#else
- /* debug tool; zap the module use count so we can unload driver */
- /* even if it is confused */
- case _IOC_NR(NV_IOCTL_MODULE_RESET):
- atomic_set(&__this_module.uc.usecount, 1);
- break;
-+#endif
-
- /* pass out info about the card */
- case _IOC_NR(NV_IOCTL_CARD_INFO):
-@@ -1651,8 +1622,7 @@
- if (need_to_run_bottom_half)
- {
- NV_ATOMIC_INC(nvl->bh_count);
-- queue_task(nvl->bh, &tq_immediate);
-- mark_bh(IMMEDIATE_BH);
-+ tasklet_schedule(&nvl->tl);
- }
- }
-
-@@ -1740,36 +1710,18 @@
-
- nv_lock_ldata(nv);
-
--
- nv->device_number = NV_CONTROL_DEVICE_NUMBER;
-
- /* save the nv away in file->private_data */
- NV_HIDE_IN_FILEP(file, nv);
-
-+#ifndef KERNEL_2_5
- MOD_INC_USE_COUNT;
--
-- /* if this is the first time the control device has been opened,
-- * allocate the wait queue
-- */
--
-- if (! nvl->event_queue) {
--
--#if !defined (KERNEL_2_2)
-- NV_KMALLOC(nvl->event_queue, sizeof(struct __wait_queue_head));
-- if (nvl->event_queue == NULL)
-- return -ENOMEM;
-- memset(nvl->event_queue, 0, sizeof(struct __wait_queue_head));
--
-- init_waitqueue_head(GET_EVENT_QUEUE(nvl));
--#else
-- nvl->event_queue = NULL;
- #endif
-- }
--
-+
- nv->flags |= NV_FLAG_OPEN + NV_FLAG_CONTROL;
-
- /* turn off the hotkey occurred bit */
--
- nv->flags &= ~NV_FLAG_HOTKEY_OCCURRED;
-
- nv->usage_count++;
-@@ -1792,16 +1744,10 @@
- nv_printf(NV_DBG_INFO, "nv_kern_ctl_close\n");
-
- nv_lock_ldata(nv);
-+
- if (--nv->usage_count == 0)
-- {
--#if !defined (KERNEL_2_2)
-- nv_linux_state_t *nvl = NV_GET_NVL_FROM_NV_STATE(nv);
-- /* this only needs to be freed on 2.4 and later kernels */
-- NV_KFREE(nvl->event_queue);
-- nvl->event_queue = 0;
--#endif
- nv->flags = 0;
-- }
-+
- nv_unlock_ldata(nv);
-
- rm_free_unused_clients(nv, current->pid, (void *) file);
-@@ -1809,9 +1755,12 @@
- /* free up our per file private data */
- if (file->private_data)
- NV_KFREE(file->private_data);
-+
- file->private_data = (void *) 0;
-
-+#ifndef KERNEL_2_5
- MOD_DEC_USE_COUNT;
-+#endif
-
- return 0;
- }
-@@ -1837,7 +1786,7 @@
- if (file->f_flags & O_NONBLOCK)
- return -EAGAIN;
-
-- poll_wait(file, GET_EVENT_QUEUE(nvl), wait);
-+ poll_wait(file, &nvl->wq, wait);
-
- nv_lock_ldata(nv);
-
-@@ -1867,7 +1816,7 @@
- nv_ctl_device.nv_state.flags |= NV_FLAG_HOTKEY_OCCURRED;
- nv_unlock_ldata(&(nv_ctl_device.nv_state));
-
-- wake_up_interruptible(GET_EVENT_QUEUE(&nv_ctl_device));
-+ wake_up_interruptible(&nv_ctl_device.wq);
- }
-
- struct host_bridge_t {
-@@ -2217,7 +2166,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 +2190,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;
-@@ -2589,7 +2531,7 @@
-
- nvfp->any_fired_notifiers++;
-
-- wake_up_interruptible(GET_EVENT_QUEUE(nvl));
-+ wake_up_interruptible(&nvl->wq);
- }
-
- /*
-@@ -2606,7 +2548,7 @@
- if (nvl->waiting_for_vblank)
- nvl->vblank_notifier++;
-
-- wake_up_interruptible(GET_EVENT_QUEUE(nvl));
-+ wake_up_interruptible(&nvl->wq);
- }
-
-
-@@ -2657,12 +2599,8 @@
- if ( (NV_AGP_DISABLED(nv)) && (config & NVOS_AGP_CONFIG_NVAGP) )
- {
- /* make sure the user does not have agpgart loaded */
--#if !defined (KERNEL_2_2)
- if (inter_module_get("drm_agp")) {
- inter_module_put("drm_agp");
--#else
-- if (GET_MODULE_SYMBOL(0, __MODULE_STRING(agp_enable))) {
--#endif
- nv_printf(NV_DBG_WARNINGS, "NVRM: not using NVAGP, AGPGART is loaded!!\n");
- } else
- status = rm_init_agp(nv);
-diff -ru NVIDIA_kernel-1.0-4191/os-agp.c NVIDIA_kernel-1.0-4191-2.5-tl/os-agp.c
---- NVIDIA_kernel-1.0-4191/os-agp.c Mon Dec 9 12:27:15 2002
-+++ NVIDIA_kernel-1.0-4191-2.5-tl/os-agp.c Fri Dec 27 03:56:49 2002
-@@ -48,7 +48,11 @@
- typedef struct {
- int (*backend_acquire)(void);
- void (*backend_release)(void);
-+#ifdef KERNEL_2_5
-+ int (*copy_info)(agp_kern_info *);
-+#else
- void (*copy_info)(agp_kern_info *);
-+#endif
- agp_memory * (*allocate_memory)(size_t, unsigned int);
- void (*free_memory)(agp_memory *);
- int (*bind_memory)(agp_memory *, off_t);
-@@ -59,30 +63,7 @@
- agp_operations_struct agp_ops;
- agp_kern_info agpinfo;
- agp_gart gart;
--#if !defined (KERNEL_2_2)
- const drm_agp_t *drm_agp_p;
--#endif
--
--#if defined (KERNEL_2_2)
-- #define GET_AGPGART_SYMBOL(sym, sym_string) \
-- sym = (void*) GET_MODULE_SYMBOL(0, sym_string); \
-- if (sym == NULL) \
-- { \
-- nv_printf(NV_DBG_ERRORS, \
-- "NVRM: AGPGART: unable to retrieve symbol %s\n", \
-- sym_string); \
-- return 1; \
-- }
--
-- #define AGP_BACKEND_ACQUIRE_SYM __MODULE_STRING(agp_backend_acquire)
-- #define AGP_BACKEND_RELEASE_SYM __MODULE_STRING(agp_backend_release)
-- #define AGP_COPY_INFO_SYM __MODULE_STRING(agp_copy_info)
-- #define AGP_ALLOCATE_MEMORY_SYM __MODULE_STRING(agp_allocate_memory)
-- #define AGP_FREE_MEMORY_SYM __MODULE_STRING(agp_free_memory)
-- #define AGP_BIND_MEMORY_SYM __MODULE_STRING(agp_bind_memory)
-- #define AGP_UNBIND_MEMORY_SYM __MODULE_STRING(agp_unbind_memory)
-- #define AGP_ENABLE_SYM __MODULE_STRING(agp_enable)
--#endif
-
- #if defined(CONFIG_MTRR)
- #define MTRR_DEL(gart) if ((gart).mtrr > 0) mtrr_del((gart).mtrr, 0, 0);
-@@ -92,6 +73,7 @@
-
- #endif /* AGPGART */
-
-+#ifndef AGPGART
- BOOL KernInitAGP(
- nv_state_t *nv,
- VOID **ap_phys_base,
-@@ -99,19 +81,24 @@
- U032 *apsize
- )
- {
--#ifndef AGPGART
- return 1;
-+}
- #else
-+BOOL KernInitAGP(
-+ nv_state_t *nv,
-+ VOID **ap_phys_base,
-+ VOID **ap_mapped_base,
-+ U032 *apsize
-+)
-+{
- U032 agp_rate;
- U032 agp_sba;
- U032 agp_fw;
-- char* chipset;
- VOID *bitmap;
- U032 bitmap_size;
-
- memset( (void *) &gart, 0, sizeof(agp_gart));
-
--#if !defined (KERNEL_2_2)
- if (!(drm_agp_p = inter_module_get_request("drm_agp", "agpgart")))
- {
- nv_printf(NV_DBG_ERRORS,
-@@ -133,25 +120,10 @@
- // harmless (backend_acquire would have already failed and caused us to
- // bail), so cast the function pointer to avoid compiler warnings.
- // we may need to revisit this in the future.
-- agp_ops.copy_info = (void (*)(agp_kern_info *)) drm_agp_p->copy_info;
--
-+#ifdef KERNEL_2_5
-+ agp_ops.copy_info = (int (*)(agp_kern_info *)) drm_agp_p->copy_info;
- #else
--#if defined(CONFIG_KMOD)
-- if ( request_module("agpgart") )
-- {
-- nv_printf(NV_DBG_ERRORS, "NVRM: AGPGART: not loading agpgart.o\n");
-- return 1;
-- }
--#endif
--
-- GET_AGPGART_SYMBOL(agp_ops.backend_acquire, AGP_BACKEND_ACQUIRE_SYM);
-- GET_AGPGART_SYMBOL(agp_ops.backend_release, AGP_BACKEND_RELEASE_SYM);
-- GET_AGPGART_SYMBOL(agp_ops.copy_info, AGP_COPY_INFO_SYM);
-- GET_AGPGART_SYMBOL(agp_ops.allocate_memory, AGP_ALLOCATE_MEMORY_SYM);
-- GET_AGPGART_SYMBOL(agp_ops.free_memory, AGP_FREE_MEMORY_SYM);
-- GET_AGPGART_SYMBOL(agp_ops.bind_memory, AGP_BIND_MEMORY_SYM);
-- GET_AGPGART_SYMBOL(agp_ops.unbind_memory, AGP_UNBIND_MEMORY_SYM);
-- GET_AGPGART_SYMBOL(agp_ops.enable, AGP_ENABLE_SYM);
-+ agp_ops.copy_info = (void (*)(agp_kern_info *)) drm_agp_p->copy_info;
- #endif
-
- /* NOTE: from here down, return an error code of '-1'
-@@ -177,45 +149,15 @@
- if (rm_read_registry_dword(nv, "NVreg", "EnableAGPFW", &agp_fw) == RM_ERROR)
- agp_fw = 1;
- agp_fw &= 0x00000001;
--
-- (*(agp_ops.copy_info))(&agpinfo);
-
-- switch ( agpinfo.chipset )
-- {
-- case INTEL_GENERIC: chipset = "Intel"; break;
-- case INTEL_LX: chipset = "Intel 440LX"; break;
-- case INTEL_BX: chipset = "Intel 440BX"; break;
-- case INTEL_GX: chipset = "Intel 440GX"; break;
-- case INTEL_I810: chipset = "Intel i810"; break;
-- case INTEL_I840: chipset = "Intel i840"; break;
--#if !defined (KERNEL_2_2)
-- case INTEL_I815: chipset = "Intel i815"; break;
--#if !defined(__rh_config_h__)
-- case INTEL_I850: chipset = "Intel i850"; break;
--#endif
--#endif
--#if defined(NVCPU_IA64)
-- case INTEL_460GX: chipset = "Intel 460GX"; break;
--#endif
-- case VIA_GENERIC: chipset = "VIA"; break;
-- case VIA_VP3: chipset = "VIA VP3"; break;
-- case VIA_MVP3: chipset = "VIA MVP3"; break;
-- case VIA_MVP4: chipset = "VIA MVP4"; break;
--#if !defined (KERNEL_2_2)
-- case VIA_APOLLO_KX133: chipset = "VIA Apollo KX133"; break;
-- case VIA_APOLLO_KT133: chipset = "VIA Apollo KT133"; break;
--#endif
-- case VIA_APOLLO_PRO: chipset = "VIA Apollo Pro"; break;
-- case SIS_GENERIC: chipset = "SiS"; break;
-- case AMD_GENERIC: chipset = "AMD"; break;
-- case AMD_IRONGATE: chipset = "AMD Irongate"; break;
-- case ALI_M1541: chipset = "ALi M1541"; break;
-- case ALI_GENERIC: chipset = "ALi"; break;
-- case NOT_SUPPORTED: chipset = "unsupported"; break;
-- default: chipset = "unknown";
-+#ifdef KERNEL_2_5
-+ if (agp_ops.copy_info(&agpinfo) != 0) {
-+ printk("nvidia: chipset not supported by agpgart.o\n");
-+ agp_ops.backend_release();
- }
--
-- nv_printf(NV_DBG_SETUP, "NVRM: AGPGART: %s chipset\n", chipset);
-+#else
-+ (*(agp_ops.copy_info))(&agpinfo);
-+#endif
-
- #ifdef CONFIG_MTRR
- if ((gart.mtrr = mtrr_add(agpinfo.aper_base,
-@@ -306,8 +248,8 @@
- gart.ready = 1;
-
- return 0;
--#endif /* AGPGART */
- }
-+#endif /* AGPGART */
-
- BOOL KernTeardownAGP(
- nv_state_t *nv
-@@ -334,9 +276,7 @@
-
- (*(agp_ops.backend_release))();
-
--#if !defined (KERNEL_2_2)
- inter_module_put("drm_agp");
--#endif
-
- if (rm_clear_agp_bitmap(nv, &bitmap))
- {
-@@ -450,13 +390,9 @@
-
- agp_addr = agpinfo.aper_base + (agp_data->offset << PAGE_SHIFT);
-
-- err = remap_page_range(vma->vm_start, (size_t) agp_addr,
-+ err = REMAP_PAGE_RANGE(vma->vm_start, (size_t) agp_addr,
- agp_data->num_pages << PAGE_SHIFT,
--#if defined(NVCPU_IA64)
- vma->vm_page_prot);
--#else
-- PAGE_SHARED);
--#endif
-
- if (err)
- {
-@@ -480,9 +416,6 @@
- #endif /* AGPGART */
- }
-
--
--#if !defined(KERNEL_2_2)
--
- RM_STATUS
- KernMapAGPNopage(
- VOID *address,
-@@ -529,9 +462,6 @@
- #endif
- }
-
--#endif /* !defined(KERNEL_2_2) */
--
--
- RM_STATUS KernFreeAGPPages(
- nv_state_t *nv,
- VOID **pAddress,
-@@ -567,5 +497,3 @@
- return RM_ERROR;
- #endif
- }
--
--
-diff -ru NVIDIA_kernel-1.0-4191/os-interface.c NVIDIA_kernel-1.0-4191-2.5-tl/os-interface.c
---- NVIDIA_kernel-1.0-4191/os-interface.c Mon Dec 9 12:27:15 2002
-+++ NVIDIA_kernel-1.0-4191-2.5-tl/os-interface.c Fri Dec 27 04:56:41 2002
-@@ -31,7 +31,7 @@
- PHWINFO pDev
- )
- {
-- return suser();
-+ return SUSER();
- }
-
- U032 os_get_page_size(VOID)
-@@ -184,6 +184,11 @@
- U032 size
- )
- {
-+ /*
-+ * XXX This needs to be !MAY_SLEEP() rather than in_interrupt(); this
-+ * requires that quite a bit of locking be rearranged, however, which
-+ * is why I'll leave this alone for now.
-+ */
- if (in_interrupt()) {
- if (size <= KMALLOC_LIMIT) {
- /*
-@@ -365,7 +370,7 @@
- if (in_irq() && MilliSeconds > NV_MAX_ISR_MDELAY)
- return RM_ERROR;
-
-- if (in_interrupt())
-+ if (!MAY_SLEEP())
- {
- mdelay(MilliSeconds);
- return RM_OK;
-@@ -669,14 +674,14 @@
-
- ULONG os_cli(ULONG flags)
- {
-- save_flags(flags);
-- cli();
-+ SAVE_FLAGS(flags);
-+ CLI();
- return flags;
- }
-
- ULONG os_sti(ULONG flags)
- {
-- restore_flags(flags);
-+ RESTORE_FLAGS(flags);
- return flags;
- }
-
-@@ -796,29 +801,12 @@
- {
- void *vaddr;
-
-- if (in_interrupt())
-- {
-- nv_printf(NV_DBG_ERRORS, "trying to map 0x%x to kernel space in interrupt!\n", start);
-- os_dbg_breakpoint();
-- return NULL;
-- }
--
- if (mode == NV_MEMORY_DEFAULT) {
- vaddr = ioremap(start, size_bytes);
- } else {
- vaddr = ioremap_nocache(start, size_bytes);
- }
-
--#if defined (KERNEL_2_2)
-- if ((vaddr == NULL)) // && (mode == NV_MEMORY_DEFAULT))
-- {
-- unsigned long map_nr = MAP_NR(__va(start));
-- if (map_nr < max_mapnr) {
-- vaddr = __va(start);
-- }
-- }
--#endif
--
- #ifdef DEBUG
- if (mode == NV_MEMORY_WRITECOMBINED) {
- nv_printf(NV_DBG_ERRORS,
-@@ -839,16 +827,7 @@
- U032 size_bytes
- )
- {
--#if defined (KERNEL_2_2)
-- if (MAP_NR(addr) < max_mapnr) {
-- // if we didn't want the memory cached, this isn't necessary
-- // but we shouldn't be in a timing critical piece of code.
-- asm volatile("wbinvd":::"memory");
-- } else
--#endif
-- {
-- iounmap(addr);
-- }
-+ iounmap(addr);
- }
-
- VOID* os_map_user_space(
-@@ -858,24 +837,7 @@
- U032 mode
- )
- {
-- int err;
-- unsigned long paddr;
-- void *uaddr = NULL;
--
-- paddr = nv_get_phys_address((unsigned long)kaddr);
--
-- uaddr = *priv;
--
-- /* finally, let's do it! */
-- err = remap_page_range( (size_t) uaddr, paddr, size_bytes,
-- PAGE_SHARED);
--
-- if (err != 0)
-- {
-- return (void *) NULL;
-- }
--
-- return uaddr;
-+ return NULL;
- }
-
- VOID os_unmap_user_space(
-@@ -883,7 +845,7 @@
- VOID *priv
- )
- {
-- // I don't think I need to do anything here...
-+ return;
- }
-
- VOID* os_map_io_space(
-@@ -894,24 +856,17 @@
- U032 mode
- )
- {
-- int err;
-- void *uaddr = NULL;
-+ struct vm_area_struct *vma;
-
-- if (!user)
-+ if (user == 0 || priv == NULL || *priv == NULL)
- return NULL;
-
-- uaddr = *priv;
-+ vma = (struct vm_area_struct *) *priv;
-
-- /* finally, let's do it! */
-- err = remap_page_range( (size_t) uaddr, (size_t) start, size_bytes,
-- PAGE_SHARED);
--
-- if (err != 0)
-- {
-- return (void *) NULL;
-- }
-+ if (REMAP_PAGE_RANGE(vma->vm_start, start & PAGE_MASK, size_bytes, PAGE_SHARED))
-+ return NULL;
-
-- return uaddr;
-+ return (void *)(NV_UINTPTR_T) vma->vm_start;
- }
-
- VOID os_unmap_io_space(
-@@ -973,7 +928,7 @@
-
- U032 os_get_cpu_count()
- {
-- return smp_num_cpus;
-+ return SMP_NUM_CPUS;
- }
-
-
-@@ -1036,11 +991,9 @@
- if (sgi_funcs.add_barrier == NULL)
- {
- #if defined(TESTING_SWAP)
--#if !defined (KERNEL_2_2)
- inter_module_register(ADD_BARRIER_FUNC, THIS_MODULE, sgitest_add_barrier);
- inter_module_register(REMOVE_BARRIER_FUNC, THIS_MODULE, sgitest_remove_barrier);
- inter_module_register(SWAP_READY_FUNC, THIS_MODULE, sgitest_swap_ready);
--#endif
- #endif
- sgi_funcs.add_barrier = GET_MODULE_SYMBOL(0, ADD_BARRIER_FUNC);
- sgi_funcs.remove_barrier = GET_MODULE_SYMBOL(0, REMOVE_BARRIER_FUNC);
diff --git a/media-video/nvidia-kernel/files/NVIDIA_kernel-1.0-4191-2.5.54.diff b/media-video/nvidia-kernel/files/NVIDIA_kernel-1.0-4191-2.5.54.diff
deleted file mode 100644
index d3f5c6ba3712..000000000000
--- a/media-video/nvidia-kernel/files/NVIDIA_kernel-1.0-4191-2.5.54.diff
+++ /dev/null
@@ -1,36 +0,0 @@
-diff -ru NVIDIA_kernel-1.0-4191-2.5-tl/Makefile NVIDIA_kernel-1.0-4191-2.5.54/Makefile
---- NVIDIA_kernel-1.0-4191-2.5-tl/Makefile Fri Dec 27 05:36:52 2002
-+++ NVIDIA_kernel-1.0-4191-2.5.54/Makefile Fri Jan 3 16:35:20 2003
-@@ -22,10 +22,8 @@
- # this is slightly more brain-dead, but works..
- ifeq ($(shell if test -d $(KERNDIR)/build; then echo yes; fi),yes)
- KERNINC=$(KERNDIR)/build/include
--MACHINC=$(KERNDIR)/build/arch/i386/mach-generic
- else
- KERNINC=/usr/src/linux/include
--MACHINC=/usr/src/linux/arch/i386/mach-generic
- endif
-
- ifeq ($(shell if test -d $(KERNDIR)/kernel; then echo yes; fi),yes)
-@@ -60,10 +58,10 @@
- # allow specification of alternate include file tree on command line and extra defines
- ifdef SYSINCLUDE
- INCLUDES += -I$(SYSINCLUDE)
--INCLUDES += -I$(SYSINCLUDE)/../arch/i386/mach-generic
-+INCLUDES += -I$(SYSINCLUDE)/asm/mach-default
- else
- INCLUDES += -I$(KERNINC)
--INCLUDES += -I$(MACHINC)
-+INCLUDES += -I$(KERNINC)/asm/mach-default
- endif
-
- DEFINES+=$(EXTRA_DEFINES)
-@@ -139,7 +137,7 @@
- fi
-
- nvidia.o: gcc-check $(LINUX_MODULE) $(RESMAN_KERNEL_MODULE)
-- ld -r -o $@ $(LINUX_MODULE) $(RESMAN_KERNEL_MODULE)
-+ ld -d -r -o $@ $(LINUX_MODULE) $(RESMAN_KERNEL_MODULE)
- size $@
-
- $(VERSION_HDR):
diff --git a/media-video/nvidia-kernel/files/NVIDIA_kernel-1.0-4191-2.5.63.diff b/media-video/nvidia-kernel/files/NVIDIA_kernel-1.0-4191-2.5.63.diff
deleted file mode 100644
index 8ef0dd408c1b..000000000000
--- a/media-video/nvidia-kernel/files/NVIDIA_kernel-1.0-4191-2.5.63.diff
+++ /dev/null
@@ -1,25 +0,0 @@
-diff -Nudr -U3 NVIDIA_kernel-1.0-4191/nv-linux.h NVIDIA_kernel-1.0-4191-fixed/nv-linux.h
---- NVIDIA_kernel-1.0-4191/nv-linux.h 2003-03-11 08:01:11.000000000 +0000
-+++ NVIDIA_kernel-1.0-4191-fixed/nv-linux.h 2003-03-11 07:59:58.000000000 +0000
-@@ -20,10 +20,6 @@
- # define MODVERSIONS
- #endif
-
--#if defined (MODVERSIONS)
--#include <linux/modversions.h>
--#endif
--
- #include <linux/kernel.h>
- #include <linux/module.h>
- #include <linux/version.h>
-@@ -50,6 +46,10 @@
- #define __SMP__
- #endif
-
-+#if defined (MODVERSIONS) && !defined (KERNEL_2_5)
-+#include <linux/modversions.h>
-+#endif
-+
- #include <linux/types.h> /* pic_t, size_t, __u32, etc */
- #include <linux/errno.h> /* error codes */
- #include <linux/list.h> /* circular linked list */
diff --git a/media-video/nvidia-kernel/files/digest-nvidia-kernel-1.0.2880-r1 b/media-video/nvidia-kernel/files/digest-nvidia-kernel-1.0.2880-r1
deleted file mode 100644
index 6f0f9ed85425..000000000000
--- a/media-video/nvidia-kernel/files/digest-nvidia-kernel-1.0.2880-r1
+++ /dev/null
@@ -1 +0,0 @@
-MD5 20fdf77ca76a13987da691eb4d7fe7c9 NVIDIA_kernel-1.0-2880.tar.gz 406780
diff --git a/media-video/nvidia-kernel/files/digest-nvidia-kernel-1.0.2960-r1 b/media-video/nvidia-kernel/files/digest-nvidia-kernel-1.0.2960-r1
deleted file mode 100644
index 439242024dcf..000000000000
--- a/media-video/nvidia-kernel/files/digest-nvidia-kernel-1.0.2960-r1
+++ /dev/null
@@ -1,14 +0,0 @@
-MD5 059b3ddf8944dce6c9184d11d15abd71 /files/NVIDIA_kernel-1.0-3123-2.5-tl.diff 31614
-MD5 57f69061f52fd98e20c7d62882af2757 /files/NVIDIA_kernel-1.0-4191-2.5.54.diff 1228
-MD5 441b29e8f10b6620c4dd4fc01528f172 /files/NVIDIA_kernel-1.0-3123-2.5-module.diff 5569
-MD5 6d8e159e5bdeb520091874050594b706 /files/NVIDIA_kernel-1.0-4191-2.5.63.diff 814
-MD5 089e6829e7e8497a603ba9dc9563a722 /files/nvidia 30
-MD5 7f987ae6384103d87f323d834bba87a1 /files/NVIDIA_kernel-1.0-4191-2.5-tl.diff 39065
-MD5 10b4f13c2bcadeb688057dd9c80e60e7 /files/NVIDIA_kernel-1.0-4349-2.5.diff 70087
-MD5 4057597a09dd795c93ce8088d6f023bb /files/NVIDIA_kernel-1.0-3123-2.5-tl-pa.diff 11858
-MD5 2533aa51a645ec25c96a389110230298 /files/NVIDIA_kernel-1.0-3123-2.5.54.diff 858
-MD5 f38a4afc671446ad293a46b0046c0aec /files/NVIDIA_kernel-1.0-3123-pa.diff 10825
-MD5 b6a9c4bdd3961980af4a70f57485d708 /files/nvidia-1.1 441
-MD5 c2b76deee2403fc2b92ef4af7294ac27 /files/1.0.4349/NVIDIA_kernel-1.0-4349-2.5-20030401.diff 69423
-MD5 5177ed76121fb4bc1aa220c62319d196 /nvidia-kernel-1.0.2960-r1.ebuild 2081
-MD5 372a72010e8a1659454330cc7f5a490f NVIDIA_kernel-1.0-2960.tar.gz 416410
diff --git a/media-video/nvidia-kernel/files/digest-nvidia-kernel-1.0.3123-r2 b/media-video/nvidia-kernel/files/digest-nvidia-kernel-1.0.3123-r2
deleted file mode 100644
index b183624bce27..000000000000
--- a/media-video/nvidia-kernel/files/digest-nvidia-kernel-1.0.3123-r2
+++ /dev/null
@@ -1 +0,0 @@
-MD5 9496c1b260985eaea59d3760b1e42eb4 NVIDIA_kernel-1.0-3123.tar.gz 428232
diff --git a/media-video/nvidia-kernel/files/digest-nvidia-kernel-1.0.4180 b/media-video/nvidia-kernel/files/digest-nvidia-kernel-1.0.4180
deleted file mode 100644
index a495b2dd0646..000000000000
--- a/media-video/nvidia-kernel/files/digest-nvidia-kernel-1.0.4180
+++ /dev/null
@@ -1 +0,0 @@
-MD5 5f75fd0504fc0a8a2666c5a2c43e3a97 NVIDIA_kernel-1.0-4180.tar.gz 642956
diff --git a/media-video/nvidia-kernel/files/digest-nvidia-kernel-1.0.4191-r2 b/media-video/nvidia-kernel/files/digest-nvidia-kernel-1.0.4191-r2
deleted file mode 100644
index 37e8dd61fb58..000000000000
--- a/media-video/nvidia-kernel/files/digest-nvidia-kernel-1.0.4191-r2
+++ /dev/null
@@ -1 +0,0 @@
-MD5 47967b5bd30fedabaaa2ffa6751792ce NVIDIA_kernel-1.0-4191.tar.gz 612129
diff --git a/media-video/nvidia-kernel/files/digest-nvidia-kernel-1.0.4349-r2 b/media-video/nvidia-kernel/files/digest-nvidia-kernel-1.0.4349-r2
deleted file mode 100644
index 401c5ee20c8a..000000000000
--- a/media-video/nvidia-kernel/files/digest-nvidia-kernel-1.0.4349-r2
+++ /dev/null
@@ -1 +0,0 @@
-MD5 d55a295e440209594d7ccdc3c56023c4 NVIDIA_kernel-1.0-4349.tar.gz 664328
diff --git a/media-video/nvidia-kernel/files/digest-nvidia-kernel-1.0.4496-r4 b/media-video/nvidia-kernel/files/digest-nvidia-kernel-1.0.4496-r4
deleted file mode 100644
index 8c3545c240d1..000000000000
--- a/media-video/nvidia-kernel/files/digest-nvidia-kernel-1.0.4496-r4
+++ /dev/null
@@ -1 +0,0 @@
-MD5 34543e7bf271ff90e1a536aacd32efbd NVIDIA-Linux-x86-1.0-4496-pkg2.run 8196793
diff --git a/media-video/nvidia-kernel/files/digest-nvidia-kernel-1.0.5328 b/media-video/nvidia-kernel/files/digest-nvidia-kernel-1.0.5328
deleted file mode 100644
index 32ab3b45d935..000000000000
--- a/media-video/nvidia-kernel/files/digest-nvidia-kernel-1.0.5328
+++ /dev/null
@@ -1 +0,0 @@
-MD5 b2ae3a449837430d5f10a2ebf3d9f7d4 NVIDIA-Linux-x86-1.0-5328-pkg1.run 6855080
diff --git a/media-video/nvidia-kernel/files/digest-nvidia-kernel-1.0.5332 b/media-video/nvidia-kernel/files/digest-nvidia-kernel-1.0.5332
deleted file mode 100644
index 943071e25292..000000000000
--- a/media-video/nvidia-kernel/files/digest-nvidia-kernel-1.0.5332
+++ /dev/null
@@ -1 +0,0 @@
-MD5 eede761ab428ff0d27e5f67e8c555972 NVIDIA-Linux-x86_64-1.0-5332-pkg0.run 5597826
diff --git a/media-video/nvidia-kernel/files/digest-nvidia-kernel-1.0.5336 b/media-video/nvidia-kernel/files/digest-nvidia-kernel-1.0.5336
deleted file mode 100644
index 56ddf0d273b7..000000000000
--- a/media-video/nvidia-kernel/files/digest-nvidia-kernel-1.0.5336
+++ /dev/null
@@ -1 +0,0 @@
-MD5 6d7361347ebbef5dfdbe6bdcb560fda8 NVIDIA-Linux-x86-1.0-5336-pkg1.run 6821193
diff --git a/media-video/nvidia-kernel/files/digest-nvidia-kernel-1.0.5336-r1 b/media-video/nvidia-kernel/files/digest-nvidia-kernel-1.0.5336-r1
deleted file mode 100644
index 56ddf0d273b7..000000000000
--- a/media-video/nvidia-kernel/files/digest-nvidia-kernel-1.0.5336-r1
+++ /dev/null
@@ -1 +0,0 @@
-MD5 6d7361347ebbef5dfdbe6bdcb560fda8 NVIDIA-Linux-x86-1.0-5336-pkg1.run 6821193
diff --git a/media-video/nvidia-kernel/nvidia-kernel-1.0.2880-r1.ebuild b/media-video/nvidia-kernel/nvidia-kernel-1.0.2880-r1.ebuild
deleted file mode 100644
index 13d8f8157712..000000000000
--- a/media-video/nvidia-kernel/nvidia-kernel-1.0.2880-r1.ebuild
+++ /dev/null
@@ -1,70 +0,0 @@
-# Copyright 1999-2004 Gentoo Technologies, Inc.
-# Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/media-video/nvidia-kernel/nvidia-kernel-1.0.2880-r1.ebuild,v 1.18 2004/01/29 09:55:36 vapier Exp $
-
-inherit eutils
-
-NV_V=${PV/1.0./1.0-}
-NV_PACKAGE=NVIDIA_kernel-${NV_V}
-S="${WORKDIR}/${NV_PACKAGE}"
-DESCRIPTION="Linux kernel module for the NVIDIA's X driver"
-HOMEPAGE="http://www.nvidia.com/"
-SRC_URI="ftp://download.nvidia.com/XFree86_40/${NV_V}/${NV_PACKAGE}.tar.gz
- http://download.nvidia.com/XFree86_40/${NV_V}/${NV_PACKAGE}.tar.gz"
-
-# The slot needs to be set to $KV to prevent unmerges of modules for other kernels.
-LICENSE="NVIDIA"
-SLOT="${KV}"
-KEYWORDS="-* x86"
-RESTRICT="nostrip"
-
-DEPEND="virtual/linux-sources"
-export _POSIX2_VERSION="199209"
-
-src_compile() {
- # Portage should determine the version of the kernel sources
- check_KV
- make KERNDIR="/usr/src/linux" \
- clean NVdriver || die
-}
-
-src_install () {
- # The driver goes into the standard modules location
- insinto "/lib/modules/${KV}/kernel/video"
- doins NVdriver
-
- # Add the aliases
- insinto /etc/modules.d
- doins "${FILESDIR}"/nvidia
-
- # Docs
- dodoc ${S}/README
-
- # The device creation script
- into /
- newsbin ${S}/makedevices.sh NVmakedevices.sh
-}
-
-pkg_postinst() {
- if [ "${ROOT}" = "/" ]
- then
- # Get any stale module unloaded
- [ -x /sbin/rmmod ] && /sbin/rmmod NVdriver
- # Update module dependency
- [ -x /usr/sbin/update-modules ] && /usr/sbin/update-modules
- # Load the module again
- [ -x /sbin/modprobe ] && /sbin/modprobe NVdriver
- if [ ! -e /dev/.devfsd ] && [ -x /sbin/NVmakedevices.sh ]
- then
- /sbin/NVmakedevices.sh >/dev/null 2>&1
- fi
- fi
-
- einfo
- einfo "If you are not using devfs, you might want to create nvidia"
- einfo "device nodes by running /sbin/NVmakedevices.sh"
- einfo
- einfo "To load the module automatically at boot up, add"
- einfo "\"NVdriver\" to your /etc/modules.autoload:"
- einfo
-}
diff --git a/media-video/nvidia-kernel/nvidia-kernel-1.0.2960-r1.ebuild b/media-video/nvidia-kernel/nvidia-kernel-1.0.2960-r1.ebuild
deleted file mode 100644
index b8bc4f981b66..000000000000
--- a/media-video/nvidia-kernel/nvidia-kernel-1.0.2960-r1.ebuild
+++ /dev/null
@@ -1,66 +0,0 @@
-# Copyright 1999-2004 Gentoo Technologies, Inc.
-# Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/media-video/nvidia-kernel/nvidia-kernel-1.0.2960-r1.ebuild,v 1.9 2004/01/29 09:55:36 vapier Exp $
-
-inherit eutils
-
-NV_V=${PV/1.0./1.0-}
-NV_PACKAGE=NVIDIA_kernel-${NV_V}
-S="${WORKDIR}/${NV_PACKAGE}"
-DESCRIPTION="Linux kernel module for the NVIDIA's X driver"
-HOMEPAGE="http://www.nvidia.com/"
-SRC_URI="ftp://download.nvidia.com/XFree86_40/${NV_V}/${NV_PACKAGE}.tar.gz
- http://download.nvidia.com/XFree86_40/${NV_V}/${NV_PACKAGE}.tar.gz"
-
-# The slot needs to be set to $KV to prevent unmerges of modules for other kernels.
-LICENSE="NVIDIA"
-SLOT="${KV}"
-KEYWORDS="-* x86"
-RESTRICT="nostrip"
-
-DEPEND="virtual/linux-sources"
-export _POSIX2_VERSION="199209"
-
-src_compile() {
- # Portage should determine the version of the kernel sources
- check_KV
- #IGNORE_CC_MISMATCH disables a sanity check that's needed when gcc has been
- #updated but the running kernel is still compiled with an older gcc. This is
- #needed for chrooted building, where the sanity check detects the gcc of the
- #kernel outside the chroot rather than within.
- make IGNORE_CC_MISMATCH="yes" KERNDIR="/usr/src/linux" \
- clean NVdriver || die
-}
-
-src_install () {
- # The driver goes into the standard modules location
- insinto "/lib/modules/${KV}/video"
- doins NVdriver
-
- # Add the aliases
- insinto /etc/modules.d
- doins "${FILESDIR}"/nvidia
-
- # Docs
- dodoc ${S}/README
-
- # The device creation script
- into /
- newsbin ${S}/makedevices.sh NVmakedevices.sh
-}
-
-pkg_postinst() {
- if [ "${ROOT}" = "/" ]
- then
- # Update module dependency
- [ -x /usr/sbin/update-modules ] && /usr/sbin/update-modules
- if [ ! -e /dev/.devfsd ] && [ -x /sbin/NVmakedevices.sh ]
- then
- /sbin/NVmakedevices.sh >/dev/null 2>&1
- fi
- fi
-
- einfo "If you are not using devfs, loading the module automatically at"
- einfo "boot up, you need to add \"NVdriver\" to your /etc/modules.autoload."
- einfo
-}
diff --git a/media-video/nvidia-kernel/nvidia-kernel-1.0.3123-r2.ebuild b/media-video/nvidia-kernel/nvidia-kernel-1.0.3123-r2.ebuild
deleted file mode 100644
index 0a3b3e7e85f1..000000000000
--- a/media-video/nvidia-kernel/nvidia-kernel-1.0.3123-r2.ebuild
+++ /dev/null
@@ -1,103 +0,0 @@
-# Copyright 1999-2004 Gentoo Technologies, Inc.
-# Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/media-video/nvidia-kernel/nvidia-kernel-1.0.3123-r2.ebuild,v 1.9 2004/01/29 09:55:36 vapier Exp $
-
-inherit eutils
-
-NV_V="${PV/1.0./1.0-}"
-NV_PACKAGE="NVIDIA_kernel-${NV_V}"
-S="${WORKDIR}/${NV_PACKAGE}"
-DESCRIPTION="Linux kernel module for the NVIDIA's X driver"
-HOMEPAGE="http://www.nvidia.com/"
-SRC_URI="http://download.nvidia.com/XFree86_40/${NV_V}/${NV_PACKAGE}.tar.gz"
-
-# The slot needs to be set to $KV to prevent unmerges of modules for other kernels.
-LICENSE="NVIDIA"
-SLOT="${KV}"
-KEYWORDS="-* x86"
-RESTRICT="nostrip"
-
-DEPEND="virtual/linux-sources"
-export _POSIX2_VERSION="199209"
-
-src_unpack() {
- unpack ${A}
-
- # Next section applies patches for linux-2.5 kernel, or if
- # linux-2.4, the page_alloc.c patch courtesy of NVIDIA Corporation.
- # All these are from:
- #
- # http://www.minion.de/nvidia/
- #
- # Many thanks to Christian Zander <zander@minion.de> for bringing
- # these to us, and being so helpful to select which to use.
- # This should close bug #9704.
-
- local KV_major="`uname -r | cut -d. -f1`"
- local KV_minor="`uname -r | cut -d. -f2`"
- local KV_micro="`uname -r | cut -d. -f3 | sed -e 's:[^0-9].*::'`"
-
- cd ${S}
- if [ "${KV_major}" -eq 2 -a "${KV_minor}" -eq 5 ]
- then
- EPATCH_SINGLE_MSG="Applying tasklet patch for kernel 2.5..." \
- epatch ${FILESDIR}/${NV_PACKAGE}-2.5-tl.diff
- EPATCH_SINGLE_MSG="Applying page_alloc.c patch..." \
- epatch ${FILESDIR}/${NV_PACKAGE}-2.5-tl-pa.diff
- EPATCH_SINGLE_MSG="Applying module patch for 2.5..." \
- epatch ${FILESDIR}/${NV_PACKAGE}-2.5-module.diff
-
- if [ "${KV_micro}" -gt 53 ]
- then
- EPATCH_SINGLE_MSG="Applying module patch for 2.5.54 or later..." \
- epatch ${FILESDIR}/${NV_PACKAGE}-2.5.54.diff
- fi
- else
- EPATCH_SINGLE_MSG="Applying page_alloc.c patch..." \
- epatch ${FILESDIR}/${NV_PACKAGE}-pa.diff
- fi
-}
-
-src_compile() {
- # Portage should determine the version of the kernel sources
- check_KV
- #IGNORE_CC_MISMATCH disables a sanity check that's needed when gcc has been
- #updated but the running kernel is still compiled with an older gcc. This is
- #needed for chrooted building, where the sanity check detects the gcc of the
- #kernel outside the chroot rather than within.
- make IGNORE_CC_MISMATCH="yes" KERNDIR="/usr/src/linux" \
- clean NVdriver || die
-}
-
-src_install() {
- # The driver goes into the standard modules location
- insinto /lib/modules/${KV}/video
- doins NVdriver
-
- # Add the aliases
- insinto /etc/modules.d
- doins ${FILESDIR}/nvidia
-
- # Docs
- dodoc ${S}/README
-
- # The device creation script
- into /
- newsbin ${S}/makedevices.sh NVmakedevices.sh
-}
-
-pkg_postinst() {
- if [ "${ROOT}" = "/" ]
- then
- # Update module dependency
- [ -x /usr/sbin/update-modules ] && /usr/sbin/update-modules
- if [ ! -e /dev/.devfsd ] && [ -x /sbin/NVmakedevices.sh ]
- then
- /sbin/NVmakedevices.sh >/dev/null 2>&1
- fi
- fi
-
- einfo "If you are not using devfs, loading the module automatically at"
- einfo "boot up, you need to add \"NVdriver\" to your /etc/modules.autoload."
- einfo
-}
diff --git a/media-video/nvidia-kernel/nvidia-kernel-1.0.4180.ebuild b/media-video/nvidia-kernel/nvidia-kernel-1.0.4180.ebuild
deleted file mode 100644
index 33e3d4613625..000000000000
--- a/media-video/nvidia-kernel/nvidia-kernel-1.0.4180.ebuild
+++ /dev/null
@@ -1,125 +0,0 @@
-# Copyright 1999-2004 Gentoo Technologies, Inc.
-# Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/media-video/nvidia-kernel/nvidia-kernel-1.0.4180.ebuild,v 1.5 2004/01/29 09:55:36 vapier Exp $
-
-inherit eutils
-
-NV_V="${PV/1.0./1.0-}"
-NV_PACKAGE="NVIDIA_kernel-${NV_V}"
-S="${WORKDIR}/${NV_PACKAGE}"
-DESCRIPTION="Linux kernel module for the NVIDIA's X driver"
-HOMEPAGE="http://www.nvidia.com/"
-SRC_URI="http://download.nvidia.com/XFree86_40/${NV_V}/${NV_PACKAGE}.tar.gz"
-
-# The slot needs to be set to $KV to prevent unmerges of modules for other kernels.
-LICENSE="NVIDIA"
-SLOT="${KV}"
-KEYWORDS="-* amd64"
-RESTRICT="nostrip"
-
-DEPEND="virtual/linux-sources"
-export _POSIX2_VERSION="199209"
-
-pkg_setup() {
- if [ ! -f /proc/mtrr ]
- then
- eerror "This version needs MTRR support for most chipsets!"
- eerror "Please enable MTRR support in your kernel config, found at:"
- eerror
- eerror " Processor type and features -> [*] MTRR (Memory Type Range Register) support"
- eerror
- eerror "and recompile your kernel ..."
- die "MTRR support not detected!"
- fi
-}
-
-src_unpack() {
- unpack ${A}
-
- # Next section applies patches for linux-2.5 kernel, or if
- # linux-2.4, the page_alloc.c patch courtesy of NVIDIA Corporation.
- # All these are from:
- #
- # http://www.minion.de/nvidia/
- #
- # Many thanks to Christian Zander <zander@minion.de> for bringing
- # these to us, and being so helpful to select which to use.
- # The patches should close bugs #9704 & #15722.
-
- local KV_major="`uname -r | cut -d. -f1`"
- local KV_minor="`uname -r | cut -d. -f2`"
- local KV_micro="`uname -r | cut -d. -f3 | sed -e 's:[^0-9].*::'`"
-
- cd ${S}
- if [ "${KV_major}" -eq 2 -a "${KV_minor}" -eq 4 ] && \
- [ -r /usr/src/linux/mm/rmap.c ]
- then
- einfo "Detected rmap enabled kernel."
- EPATCH_SINGLE_MSG="Applying rmap patch for kernel 2.4..." \
- epatch ${FILESDIR}/${NV_PACKAGE}-2.5-tl.diff
-
- elif [ "${KV_major}" -eq 2 -a "${KV_minor}" -eq 5 ]
- then
- EPATCH_SINGLE_MSG="Applying tasklet patch for kernel 2.5..." \
- epatch ${FILESDIR}/${NV_PACKAGE}-2.5-tl.diff
-
- if [ "${KV_micro}" -ge 54 ]
- then
- EPATCH_SINGLE_MSG="Applying module_loader_no_common_sections patch..." \
- epatch ${FILESDIR}/${NV_PACKAGE}-2.5.54.diff
- fi
- if [ "${KV_micro}" -ge 63 ]
- then
- EPATCH_SINGLE_MSG="Applying missing_modversion.h patch..." \
- epatch ${FILESDIR}/${NV_PACKAGE}-2.5.63.diff
- fi
- fi
-}
-
-src_compile() {
- # Portage should determine the version of the kernel sources
- check_KV
- # IGNORE_CC_MISMATCH disables a sanity check that's needed when gcc has been
- # updated but the running kernel is still compiled with an older gcc. This is
- # needed for chrooted building, where the sanity check detects the gcc of the
- # kernel outside the chroot rather than within.
- make IGNORE_CC_MISMATCH="yes" KERNDIR="/usr/src/linux" \
- clean nvidia.o || die
-}
-
-src_install() {
- # The driver goes into the standard modules location
- insinto /lib/modules/${KV}/video
- doins nvidia.o
-
- # Add the aliases
- insinto /etc/modules.d
- newins ${FILESDIR}/nvidia-1.1 nvidia
-
- # Docs
- dodoc ${S}/README
-
- # The device creation script
- into /
- newsbin ${S}/makedevices.sh NVmakedevices.sh
-}
-
-pkg_postinst() {
- if [ "${ROOT}" = "/" ]
- then
- # Update module dependency
- [ -x /usr/sbin/update-modules ] && /usr/sbin/update-modules
- if [ ! -e /dev/.devfsd ] && [ -x /sbin/NVmakedevices.sh ]
- then
- /sbin/NVmakedevices.sh >/dev/null 2>&1
- fi
- fi
-
- echo
- einfo "If you are not using devfs, loading the module automatically at"
- einfo "boot up, you need to add \"nvidia\" to your /etc/modules.autoload."
- echo
- ewarn "Please note that the driver name changed from \"NVdriver\""
- ewarn "to \"nvidia.o\"."
- echo
-}
diff --git a/media-video/nvidia-kernel/nvidia-kernel-1.0.4191-r2.ebuild b/media-video/nvidia-kernel/nvidia-kernel-1.0.4191-r2.ebuild
deleted file mode 100644
index 2dc242c6e823..000000000000
--- a/media-video/nvidia-kernel/nvidia-kernel-1.0.4191-r2.ebuild
+++ /dev/null
@@ -1,125 +0,0 @@
-# Copyright 1999-2004 Gentoo Technologies, Inc.
-# Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/media-video/nvidia-kernel/nvidia-kernel-1.0.4191-r2.ebuild,v 1.8 2004/01/29 09:55:36 vapier Exp $
-
-inherit eutils
-
-NV_V="${PV/1.0./1.0-}"
-NV_PACKAGE="NVIDIA_kernel-${NV_V}"
-S="${WORKDIR}/${NV_PACKAGE}"
-DESCRIPTION="Linux kernel module for the NVIDIA's X driver"
-HOMEPAGE="http://www.nvidia.com/"
-SRC_URI="http://download.nvidia.com/XFree86_40/${NV_V}/${NV_PACKAGE}.tar.gz"
-
-# The slot needs to be set to $KV to prevent unmerges of modules for other kernels.
-LICENSE="NVIDIA"
-SLOT="${KV}"
-KEYWORDS="-* x86"
-RESTRICT="nostrip"
-
-DEPEND="virtual/linux-sources"
-export _POSIX2_VERSION="199209"
-
-pkg_setup() {
- if [ ! -f /proc/mtrr ]
- then
- eerror "This version needs MTRR support for most chipsets!"
- eerror "Please enable MTRR support in your kernel config, found at:"
- eerror
- eerror " Processor type and features -> [*] MTRR (Memory Type Range Register) support"
- eerror
- eerror "and recompile your kernel ..."
- die "MTRR support not detected!"
- fi
-}
-
-src_unpack() {
- unpack ${A}
-
- # Next section applies patches for linux-2.5 kernel, or if
- # linux-2.4, the page_alloc.c patch courtesy of NVIDIA Corporation.
- # All these are from:
- #
- # http://www.minion.de/nvidia/
- #
- # Many thanks to Christian Zander <zander@minion.de> for bringing
- # these to us, and being so helpful to select which to use.
- # The patches should close bugs #9704 & #15722.
-
- local KV_major="`uname -r | cut -d. -f1`"
- local KV_minor="`uname -r | cut -d. -f2`"
- local KV_micro="`uname -r | cut -d. -f3 | sed -e 's:[^0-9].*::'`"
-
- cd ${S}
- if [ "${KV_major}" -eq 2 -a "${KV_minor}" -eq 4 ] && \
- [ -r /usr/src/linux/mm/rmap.c ]
- then
- einfo "Detected rmap enabled kernel."
- EPATCH_SINGLE_MSG="Applying rmap patch for kernel 2.4..." \
- epatch ${FILESDIR}/${NV_PACKAGE}-2.5-tl.diff
-
- elif [ "${KV_major}" -eq 2 -a "${KV_minor}" -eq 5 ]
- then
- EPATCH_SINGLE_MSG="Applying tasklet patch for kernel 2.5..." \
- epatch ${FILESDIR}/${NV_PACKAGE}-2.5-tl.diff
-
- if [ "${KV_micro}" -ge 54 ]
- then
- EPATCH_SINGLE_MSG="Applying module_loader_no_common_sections patch..." \
- epatch ${FILESDIR}/${NV_PACKAGE}-2.5.54.diff
- fi
- if [ "${KV_micro}" -ge 63 ]
- then
- EPATCH_SINGLE_MSG="Applying missing_modversion.h patch..." \
- epatch ${FILESDIR}/${NV_PACKAGE}-2.5.63.diff
- fi
- fi
-}
-
-src_compile() {
- # Portage should determine the version of the kernel sources
- check_KV
- # IGNORE_CC_MISMATCH disables a sanity check that's needed when gcc has been
- # updated but the running kernel is still compiled with an older gcc. This is
- # needed for chrooted building, where the sanity check detects the gcc of the
- # kernel outside the chroot rather than within.
- make IGNORE_CC_MISMATCH="yes" KERNDIR="/usr/src/linux" \
- clean nvidia.o || die
-}
-
-src_install() {
- # The driver goes into the standard modules location
- insinto /lib/modules/${KV}/video
- doins nvidia.o
-
- # Add the aliases
- insinto /etc/modules.d
- newins ${FILESDIR}/nvidia-1.1 nvidia
-
- # Docs
- dodoc ${S}/README
-
- # The device creation script
- into /
- newsbin ${S}/makedevices.sh NVmakedevices.sh
-}
-
-pkg_postinst() {
- if [ "${ROOT}" = "/" ]
- then
- # Update module dependency
- [ -x /usr/sbin/update-modules ] && /usr/sbin/update-modules
- if [ ! -e /dev/.devfsd ] && [ -x /sbin/NVmakedevices.sh ]
- then
- /sbin/NVmakedevices.sh >/dev/null 2>&1
- fi
- fi
-
- echo
- einfo "If you are not using devfs, loading the module automatically at"
- einfo "boot up, you need to add \"nvidia\" to your /etc/modules.autoload."
- echo
- ewarn "Please note that the driver name changed from \"NVdriver\""
- ewarn "to \"nvidia.o\"."
- echo
-}
diff --git a/media-video/nvidia-kernel/nvidia-kernel-1.0.4349-r2.ebuild b/media-video/nvidia-kernel/nvidia-kernel-1.0.4349-r2.ebuild
deleted file mode 100644
index 316f5cedd29a..000000000000
--- a/media-video/nvidia-kernel/nvidia-kernel-1.0.4349-r2.ebuild
+++ /dev/null
@@ -1,118 +0,0 @@
-# Copyright 1999-2004 Gentoo Technologies, Inc.
-# Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/media-video/nvidia-kernel/nvidia-kernel-1.0.4349-r2.ebuild,v 1.6 2004/01/29 09:55:36 vapier Exp $
-
-inherit eutils
-
-NV_V="${PV/1.0./1.0-}"
-NV_PACKAGE="NVIDIA_kernel-${NV_V}"
-S="${WORKDIR}/${NV_PACKAGE}"
-DESCRIPTION="Linux kernel module for the NVIDIA's X driver"
-HOMEPAGE="http://www.nvidia.com/"
-SRC_URI="ftp://download.nvidia.com/XFree86/Linux-x86/${NV_V}/${NV_PACKAGE}.tar.gz"
-
-# The slot needs to be set to $KV to prevent unmerges of modules for other kernels.
-LICENSE="NVIDIA"
-SLOT="${KV}"
-KEYWORDS="-* x86"
-RESTRICT="nostrip"
-
-DEPEND="virtual/linux-sources"
-export _POSIX2_VERSION="199209"
-
-pkg_setup() {
- if [ ! -f /proc/mtrr ]
- then
- eerror "This version needs MTRR support for most chipsets!"
- eerror "Please enable MTRR support in your kernel config, found at:"
- eerror
- eerror " Processor type and features -> [*] MTRR (Memory Type Range Register) support"
- eerror
- eerror "and recompile your kernel ..."
- die "MTRR support not detected!"
- fi
-}
-
-src_unpack() {
- unpack ${A}
-
- # Next section applies patches for linux-2.5 kernel, or if
- # linux-2.4, the page_alloc.c patch courtesy of NVIDIA Corporation.
- # All these are from:
- #
- # http://www.minion.de/nvidia/
- #
- # Many thanks to Christian Zander <zander@minion.de> for bringing
- # these to us, and being so helpful to select which to use.
- # The patches should close bugs #9704 & #15722.
-
- local KV_major="`uname -r | cut -d. -f1`"
- local KV_minor="`uname -r | cut -d. -f2`"
- local KV_micro="`uname -r | cut -d. -f3 | sed -e 's:[^0-9].*::'`"
-
- cd ${S}
- einfo "Linux kernel ${KV_major}.${KV_minor}.${KV_micro}"
- if [ "${KV_major}" -eq 2 -a "${KV_minor}" -eq 5 ]
- then
- EPATCH_SINGLE_MSG="Applying tasklet patch for kernel 2.5..." \
- epatch ${FILESDIR}/${PV}/${NV_PACKAGE}-2.5-20030402.diff
-
- if [ "${KV_micro}" -ge 68 ] && \
- [ -n "`grep irqreturn_t /usr/src/linux/include/linux/interrupt.h`" ]
- then
- EPATCH_SINGLE_MSG="Applying patch for devfs/irq changes in 2.5.68+..." \
- epatch ${FILESDIR}/${PV}/${NV_PACKAGE}-2.5.68.diff
- fi
-
- # Some problems with kbuild one ..
- ln -s Makefile.nvidia Makefile
- fi
-}
-
-src_compile() {
- # Portage should determine the version of the kernel sources
- check_KV
- # IGNORE_CC_MISMATCH disables a sanity check that's needed when gcc has been
- # updated but the running kernel is still compiled with an older gcc. This is
- # needed for chrooted building, where the sanity check detects the gcc of the
- # kernel outside the chroot rather than within.
- make IGNORE_CC_MISMATCH="yes" KERNDIR="/usr/src/linux" \
- clean nvidia.o || die
-}
-
-src_install() {
- # The driver goes into the standard modules location
- insinto /lib/modules/${KV}/video
- doins nvidia.o
-
- # Add the aliases
- insinto /etc/modules.d
- newins ${FILESDIR}/nvidia-1.1 nvidia
-
- # Docs
- dodoc ${S}/README
-
- # The device creation script
- into /
- newsbin ${S}/makedevices.sh NVmakedevices.sh
-}
-
-pkg_postinst() {
- if [ "${ROOT}" = "/" ]
- then
- # Update module dependency
- [ -x /usr/sbin/update-modules ] && /usr/sbin/update-modules
- if [ ! -e /dev/.devfsd ] && [ -x /sbin/NVmakedevices.sh ]
- then
- /sbin/NVmakedevices.sh >/dev/null 2>&1
- fi
- fi
-
- echo
- einfo "If you are not using devfs, loading the module automatically at"
- einfo "boot up, you need to add \"nvidia\" to your /etc/modules.autoload."
- echo
- ewarn "Please note that the driver name changed from \"NVdriver\""
- ewarn "to \"nvidia.o\"."
- echo
-}
diff --git a/media-video/nvidia-kernel/nvidia-kernel-1.0.4496-r4.ebuild b/media-video/nvidia-kernel/nvidia-kernel-1.0.4496-r4.ebuild
deleted file mode 100644
index e8a46df217c7..000000000000
--- a/media-video/nvidia-kernel/nvidia-kernel-1.0.4496-r4.ebuild
+++ /dev/null
@@ -1,161 +0,0 @@
-# Copyright 1999-2004 Gentoo Technologies, Inc.
-# Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/media-video/nvidia-kernel/nvidia-kernel-1.0.4496-r4.ebuild,v 1.7 2004/01/29 09:55:36 vapier Exp $
-
-inherit eutils
-
-PKG_V="pkg2"
-NV_V="${PV/1.0./1.0-}"
-NV_PACKAGE="NVIDIA-Linux-x86-${NV_V}"
-S="${WORKDIR}/${NV_PACKAGE}-${PKG_V}/usr/src/nv"
-DESCRIPTION="Linux kernel module for the NVIDIA's X driver"
-HOMEPAGE="http://www.nvidia.com/"
-SRC_URI="ftp://download.nvidia.com/XFree86/Linux-x86/${NV_V}/${NV_PACKAGE}-${PKG_V}.run"
-
-# The slot needs to be set to $KV to prevent unmerges of modules for other kernels.
-LICENSE="NVIDIA"
-SLOT="${KV}"
-KEYWORDS="-* ~x86"
-RESTRICT="nostrip"
-
-DEPEND="virtual/linux-sources"
-export _POSIX2_VERSION="199209"
-
-
-pkg_setup() {
- if [ ! -f /proc/mtrr ]
- then
- eerror "This version needs MTRR support for most chipsets!"
- eerror "Please enable MTRR support in your kernel config, found at:"
- eerror
- eerror " Processor type and features -> [*] MTRR (Memory Type Range Register) support"
- eerror
- eerror "and recompile your kernel ..."
- die "MTRR support not detected!"
- fi
-
- check_version_h
-}
-
-check_version_h() {
- if [ ! -f "${ROOT}/usr/src/linux/include/linux/version.h" ]
- then
- eerror "Please verify that your /usr/src/linux symlink is pointing"
- eerror "to your current kernel sources, and that you did run:"
- eerror
- eerror " # make dep"
- die "/usr/src/linux symlink not setup!"
- fi
-}
-
-get_KV_info() {
- check_version_h
-
- # Get the kernel version of sources in /usr/src/linux ...
- export KV_full="$(awk '/UTS_RELEASE/ { gsub("\"", "", $3); print $3 }' \
- "${ROOT}/usr/src/linux/include/linux/version.h")"
- export KV_major="$(echo "${KV_full}" | cut -d. -f1)"
- export KV_minor="$(echo "${KV_full}" | cut -d. -f2)"
- export KV_micro="$(echo "${KV_full}" | cut -d. -f3 | sed -e 's:[^0-9].*::')"
-}
-
-is_2_5_kernel() {
- get_KV_info
-
- if [ "${KV_major}" -eq 2 -a "${KV_minor}" -eq 5 ]
- then
- return 0
- else
- return 1
- fi
-}
-
-is_2_6_kernel() {
- get_KV_info
-
- if [ "${KV_major}" -eq 2 -a "${KV_minor}" -eq 6 ]
- then
- return 0
- else
- return 1
- fi
-}
-
-src_unpack() {
- cd ${WORKDIR}
- bash ${DISTDIR}/${NV_PACKAGE}-${PKG_V}.run --extract-only
-
- # Next section applies patches for linux-2.5 kernel, and/or
- # bugfixes for linux-2.4. All these are from:
- #
- # http://www.minion.de/nvidia/
- #
- # Many thanks to Christian Zander <zander@minion.de> for bringing
- # these to us, and being so helpful to select which to use.
-
- get_KV_info
-
- cd ${S}
- einfo "Linux kernel ${KV_major}.${KV_minor}.${KV_micro}"
-
- if is_2_5_kernel || is_2_6_kernel
- then
- EPATCH_SINGLE_MSG="Applying tasklet patch ..." \
- epatch ${FILESDIR}/${PV}/NVIDIA_kernel-${NV_V}-2.6-20031026.diff
-
- # Kbuild have issues currently (sandbox related).
- ln -snf Makefile.nvidia Makefile
- fi
-
- # if you set this then it's your own fault when stuff breaks :)
- [ ! -z "${USE_CRAZY_OPTS}" ] && sed -i "s:-O:${CFLAGS}:" Makefile
-}
-
-src_compile() {
- # Portage should determine the version of the kernel sources
- check_KV
-
- # IGNORE_CC_MISMATCH disables a sanity check that's needed when gcc has been
- # updated but the running kernel is still compiled with an older gcc. This is
- # needed for chrooted building, where the sanity check detects the gcc of the
- # kernel outside the chroot rather than within.
- make IGNORE_CC_MISMATCH="yes" KERNDIR="/usr/src/linux" \
- clean nvidia.o || die
-}
-
-src_install() {
- # The driver goes into the standard modules location
- insinto /lib/modules/${KV}/video
- doins nvidia.o
-
- # Add the aliases
- insinto /etc/modules.d
- newins ${FILESDIR}/nvidia-1.1 nvidia
-
- # Docs
- dodoc ${S}/README
-
- # The device creation script
- into /
- newsbin ${S}/makedevices.sh NVmakedevices.sh
-}
-
-pkg_postinst() {
- if [ "${ROOT}" = "/" ]
- then
- # Update module dependency
- [ -x /usr/sbin/update-modules ] && /usr/sbin/update-modules
- if [ ! -e /dev/.devfsd ] && [ -x /sbin/NVmakedevices.sh ]
- then
- /sbin/NVmakedevices.sh >/dev/null 2>&1
- fi
- fi
-
- echo
- einfo "If you are not using devfs, loading the module automatically at"
- einfo "boot up, you need to add \"nvidia\" to your /etc/modules.autoload."
- echo
- ewarn "Please note that the driver name changed from \"NVdriver\""
- ewarn "to \"nvidia.o\"."
- echo
-}
diff --git a/media-video/nvidia-kernel/nvidia-kernel-1.0.5328.ebuild b/media-video/nvidia-kernel/nvidia-kernel-1.0.5328.ebuild
deleted file mode 100644
index 57feac972043..000000000000
--- a/media-video/nvidia-kernel/nvidia-kernel-1.0.5328.ebuild
+++ /dev/null
@@ -1,161 +0,0 @@
-# Copyright 1999-2004 Gentoo Technologies, Inc.
-# Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/media-video/nvidia-kernel/nvidia-kernel-1.0.5328.ebuild,v 1.3 2004/01/29 09:55:36 vapier Exp $
-
-inherit eutils
-
-PKG_V="pkg1"
-NV_V="${PV/1.0./1.0-}"
-NV_PACKAGE="NVIDIA-Linux-x86-${NV_V}"
-S="${WORKDIR}/${NV_PACKAGE}-${PKG_V}/usr/src/nv"
-DESCRIPTION="Linux kernel module for the NVIDIA's X driver"
-HOMEPAGE="http://www.nvidia.com/"
-SRC_URI="ftp://download.nvidia.com/XFree86/Linux-x86/${NV_V}/${NV_PACKAGE}-${PKG_V}.run"
-
-# The slot needs to be set to $KV to prevent unmerges of modules for other kernels.
-LICENSE="NVIDIA"
-SLOT="${KV}"
-KEYWORDS="-* ~x86"
-RESTRICT="nostrip"
-
-DEPEND="virtual/linux-sources"
-export _POSIX2_VERSION="199209"
-
-
-pkg_setup() {
- if [ ! -f /proc/mtrr ]
- then
- eerror "This version needs MTRR support for most chipsets!"
- eerror "Please enable MTRR support in your kernel config, found at:"
- eerror
- eerror " Processor type and features -> [*] MTRR (Memory Type Range Register) support"
- eerror
- eerror "and recompile your kernel ..."
- die "MTRR support not detected!"
- fi
-
- check_version_h
-}
-
-check_version_h() {
- if [ ! -f "${ROOT}/usr/src/linux/include/linux/version.h" ]
- then
- eerror "Please verify that your /usr/src/linux symlink is pointing"
- eerror "to your current kernel sources, and that you did run:"
- eerror
- eerror " # make dep"
- die "/usr/src/linux symlink not setup!"
- fi
-}
-
-get_KV_info() {
- check_version_h
-
- # Get the kernel version of sources in /usr/src/linux ...
- export KV_full="$(awk '/UTS_RELEASE/ { gsub("\"", "", $3); print $3 }' \
- "${ROOT}/usr/src/linux/include/linux/version.h")"
- export KV_major="$(echo "${KV_full}" | cut -d. -f1)"
- export KV_minor="$(echo "${KV_full}" | cut -d. -f2)"
- export KV_micro="$(echo "${KV_full}" | cut -d. -f3 | sed -e 's:[^0-9].*::')"
-}
-
-is_2_5_kernel() {
- get_KV_info
-
- if [ "${KV_major}" -eq 2 -a "${KV_minor}" -eq 5 ]
- then
- return 0
- else
- return 1
- fi
-}
-
-is_2_6_kernel() {
- get_KV_info
-
- if [ "${KV_major}" -eq 2 -a "${KV_minor}" -eq 6 ]
- then
- return 0
- else
- return 1
- fi
-}
-
-src_unpack() {
- cd ${WORKDIR}
- bash ${DISTDIR}/${NV_PACKAGE}-${PKG_V}.run --extract-only
-
- # Next section applies patches for linux-2.5 kernel, and/or
- # bugfixes for linux-2.4. All these are from:
- #
- # http://www.minion.de/nvidia/
- #
- # Many thanks to Christian Zander <zander@minion.de> for bringing
- # these to us, and being so helpful to select which to use.
-
- get_KV_info
-
- cd ${S}
- einfo "Linux kernel ${KV_major}.${KV_minor}.${KV_micro}"
-
- if is_2_5_kernel || is_2_6_kernel
- then
- EPATCH_SINGLE_MSG="Applying tasklet patch ..." \
- epatch ${FILESDIR}/${PV}/NVIDIA_kernel-${NV_V}-2.6-20031226.diff
-
- # Kbuild have issues currently (sandbox related).
- ln -snf Makefile.nvidia Makefile
- fi
-
- # if you set this then it's your own fault when stuff breaks :)
- [ ! -z "${USE_CRAZY_OPTS}" ] && sed -i "s:-O:${CFLAGS}:" Makefile
-}
-
-src_compile() {
- # Portage should determine the version of the kernel sources
- check_KV
-
- # IGNORE_CC_MISMATCH disables a sanity check that's needed when gcc has been
- # updated but the running kernel is still compiled with an older gcc. This is
- # needed for chrooted building, where the sanity check detects the gcc of the
- # kernel outside the chroot rather than within.
- make IGNORE_CC_MISMATCH="yes" KERNDIR="/usr/src/linux" \
- clean nvidia.o || die
-}
-
-src_install() {
- # The driver goes into the standard modules location
- insinto /lib/modules/${KV}/video
- doins nvidia.o
-
- # Add the aliases
- insinto /etc/modules.d
- newins ${FILESDIR}/nvidia-1.1 nvidia
-
- # Docs
- dodoc ${S}/README
-
- # The device creation script
- into /
- newsbin ${S}/makedevices.sh NVmakedevices.sh
-}
-
-pkg_postinst() {
- if [ "${ROOT}" = "/" ]
- then
- # Update module dependency
- [ -x /usr/sbin/update-modules ] && /usr/sbin/update-modules
- if [ ! -e /dev/.devfsd ] && [ -x /sbin/NVmakedevices.sh ]
- then
- /sbin/NVmakedevices.sh >/dev/null 2>&1
- fi
- fi
-
- echo
- einfo "If you are not using devfs, loading the module automatically at"
- einfo "boot up, you need to add \"nvidia\" to your /etc/modules.autoload."
- echo
- ewarn "Please note that the driver name changed from \"NVdriver\""
- ewarn "to \"nvidia.o\"."
- echo
-}
diff --git a/media-video/nvidia-kernel/nvidia-kernel-1.0.5332.ebuild b/media-video/nvidia-kernel/nvidia-kernel-1.0.5332.ebuild
deleted file mode 100644
index e223240a8bd3..000000000000
--- a/media-video/nvidia-kernel/nvidia-kernel-1.0.5332.ebuild
+++ /dev/null
@@ -1,175 +0,0 @@
-# Copyright 1999-2004 Gentoo Technologies, Inc.
-# Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/media-video/nvidia-kernel/nvidia-kernel-1.0.5332.ebuild,v 1.3 2004/02/07 22:28:25 brad_mssw Exp $
-
-inherit eutils
-
-PKG_V="pkg0"
-NV_V="${PV/1.0./1.0-}"
-NV_PACKAGE="NVIDIA-Linux-x86_64-${NV_V}"
-S="${WORKDIR}/${NV_PACKAGE}-${PKG_V}/usr/src/nv"
-DESCRIPTION="Linux kernel module for the NVIDIA's X driver"
-HOMEPAGE="http://www.nvidia.com/"
-SRC_URI="ftp://download.nvidia.com/XFree86/Linux-x86_64/${NV_V}/${NV_PACKAGE}-${PKG_V}.run"
-
-# The slot needs to be set to $KV to prevent unmerges of modules for other kernels.
-LICENSE="NVIDIA"
-SLOT="${KV}"
-KEYWORDS="-* amd64"
-RESTRICT="nostrip"
-
-DEPEND="virtual/linux-sources"
-export _POSIX2_VERSION="199209"
-
-
-pkg_setup() {
- if [ ! -f /proc/mtrr ]
- then
- eerror "This version needs MTRR support for most chipsets!"
- eerror "Please enable MTRR support in your kernel config, found at:"
- eerror
- eerror " Processor type and features -> [*] MTRR (Memory Type Range Register) support"
- eerror
- eerror "and recompile your kernel ..."
- die "MTRR support not detected!"
- fi
-
- check_version_h
-}
-
-check_version_h() {
- if [ ! -f "${ROOT}/usr/src/linux/include/linux/version.h" ]
- then
- eerror "Please verify that your /usr/src/linux symlink is pointing"
- eerror "to your current kernel sources, and that you did run:"
- eerror
- eerror " # make dep"
- die "/usr/src/linux symlink not setup!"
- fi
-}
-
-get_KV_info() {
- check_version_h
-
- # Get the kernel version of sources in /usr/src/linux ...
- export KV_full="$(awk '/UTS_RELEASE/ { gsub("\"", "", $3); print $3 }' \
- "${ROOT}/usr/src/linux/include/linux/version.h")"
- export KV_major="$(echo "${KV_full}" | cut -d. -f1)"
- export KV_minor="$(echo "${KV_full}" | cut -d. -f2)"
- export KV_micro="$(echo "${KV_full}" | cut -d. -f3 | sed -e 's:[^0-9].*::')"
-}
-
-is_2_4_kernel() {
- get_KV_info
-
- if [ "${KV_major}" -eq 2 -a "${KV_minor}" -eq 4 ]
- then
- return 0
- else
- return 1
- fi
-}
-
-is_2_5_kernel() {
- get_KV_info
-
- if [ "${KV_major}" -eq 2 -a "${KV_minor}" -eq 5 ]
- then
- return 0
- else
- return 1
- fi
-}
-
-is_2_6_kernel() {
- get_KV_info
-
- if [ "${KV_major}" -eq 2 -a "${KV_minor}" -eq 6 ]
- then
- return 0
- else
- return 1
- fi
-}
-
-src_unpack() {
- cd ${WORKDIR}
- bash ${DISTDIR}/${NV_PACKAGE}-${PKG_V}.run --extract-only
-
- # Next section applies patches for linux-2.5 kernel, and/or
- # bugfixes for linux-2.4. All these are from:
- #
- # http://www.minion.de/nvidia/
- #
- # Many thanks to Christian Zander <zander@minion.de> for bringing
- # these to us, and being so helpful to select which to use.
-
- get_KV_info
-
- cd ${S}
- einfo "Linux kernel ${KV_major}.${KV_minor}.${KV_micro}"
-
- if is_2_5_kernel || is_2_6_kernel
- then
- # Kbuild have issues currently (sandbox related).
- EPATCH_SINGLE_MSG="Applying 2.6.x patch ..." \
- epatch ${FILESDIR}/${PV}/NVIDIA-Linux-x86_64-1.0-5332-2.6.diff
- fi
-
- # if you set this then it's your own fault when stuff breaks :)
- [ ! -z "${USE_CRAZY_OPTS}" ] && sed -i "s:-O:${CFLAGS}:" Makefile
-}
-
-src_compile() {
- # Portage should determine the version of the kernel sources
- check_KV
-
- # IGNORE_CC_MISMATCH disables a sanity check that's needed when gcc has been
- # updated but the running kernel is still compiled with an older gcc. This is
- # needed for chrooted building, where the sanity check detects the gcc of the
- # kernel outside the chroot rather than within.
- make IGNORE_CC_MISMATCH="yes" KERNDIR="/usr/src/linux" \
- clean nvidia.o || die
-}
-
-src_install() {
- # The driver goes into the standard modules location
- insinto /lib/modules/${KV}/video
- if is_2_5_kernel || is_2_6_kernel
- then
- doins nvidia.ko
- else
- doins nvidia.o
- fi
-
- # Add the aliases
- insinto /etc/modules.d
- newins ${FILESDIR}/nvidia-1.1 nvidia
-
- # Docs
- dodoc ${S}/README
-
- # The device creation script
- into /
- newsbin ${S}/makedevices.sh NVmakedevices.sh
-}
-
-pkg_postinst() {
- if [ "${ROOT}" = "/" ]
- then
- # Update module dependency
- [ -x /usr/sbin/update-modules ] && /usr/sbin/update-modules
- if [ ! -e /dev/.devfsd ] && [ -x /sbin/NVmakedevices.sh ]
- then
- /sbin/NVmakedevices.sh >/dev/null 2>&1
- fi
- fi
-
- echo
- einfo "If you are not using devfs, loading the module automatically at"
- einfo "boot up, you need to add \"nvidia\" to your /etc/modules.autoload."
- echo
- ewarn "Please note that the driver name changed from \"NVdriver\""
- ewarn "to \"nvidia.o\"."
- echo
-}
diff --git a/media-video/nvidia-kernel/nvidia-kernel-1.0.5336-r1.ebuild b/media-video/nvidia-kernel/nvidia-kernel-1.0.5336-r1.ebuild
deleted file mode 100644
index 5eb350fbd7ae..000000000000
--- a/media-video/nvidia-kernel/nvidia-kernel-1.0.5336-r1.ebuild
+++ /dev/null
@@ -1,165 +0,0 @@
-# Copyright 1999-2004 Gentoo Technologies, Inc.
-# Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/media-video/nvidia-kernel/nvidia-kernel-1.0.5336-r1.ebuild,v 1.3 2004/02/06 19:27:52 azarah Exp $
-
-inherit eutils
-
-PKG_V="pkg1"
-NV_V="${PV/1.0./1.0-}"
-NV_PACKAGE="NVIDIA-Linux-x86-${NV_V}"
-S="${WORKDIR}/${NV_PACKAGE}-${PKG_V}/usr/src/nv"
-DESCRIPTION="Linux kernel module for the NVIDIA's X driver"
-HOMEPAGE="http://www.nvidia.com/"
-SRC_URI="ftp://download.nvidia.com/XFree86/Linux-x86/${NV_V}/${NV_PACKAGE}-${PKG_V}.run"
-
-# The slot needs to be set to $KV to prevent unmerges of modules for other kernels.
-LICENSE="NVIDIA"
-SLOT="${KV}"
-KEYWORDS="-* ~x86"
-RESTRICT="nostrip"
-
-DEPEND="virtual/linux-sources"
-export _POSIX2_VERSION="199209"
-
-
-pkg_setup() {
- if [ ! -f /proc/mtrr ]
- then
- eerror "This version needs MTRR support for most chipsets!"
- eerror "Please enable MTRR support in your kernel config, found at:"
- eerror
- eerror " Processor type and features -> [*] MTRR (Memory Type Range Register) support"
- eerror
- eerror "and recompile your kernel ..."
- die "MTRR support not detected!"
- fi
-
- check_version_h
-}
-
-check_version_h() {
- if [ ! -f "${ROOT}/usr/src/linux/include/linux/version.h" ]
- then
- eerror "Please verify that your /usr/src/linux symlink is pointing"
- eerror "to your current kernel sources, and that you did run:"
- eerror
- eerror " # make dep"
- die "/usr/src/linux symlink not setup!"
- fi
-}
-
-get_KV_info() {
- check_version_h
-
- # Get the kernel version of sources in /usr/src/linux ...
- export KV_full="$(awk '/UTS_RELEASE/ { gsub("\"", "", $3); print $3 }' \
- "${ROOT}/usr/src/linux/include/linux/version.h")"
- export KV_major="$(echo "${KV_full}" | cut -d. -f1)"
- export KV_minor="$(echo "${KV_full}" | cut -d. -f2)"
- export KV_micro="$(echo "${KV_full}" | cut -d. -f3 | sed -e 's:[^0-9].*::')"
-}
-
-is_kernel() {
- [ -z "$1" -o -z "$2" ] && return 1
-
- get_KV_info
-
- if [ "${KV_major}" -eq "$1" -a "${KV_minor}" -eq "$2" ]
- then
- return 0
- else
- return 1
- fi
-}
-
-src_unpack() {
- cd ${WORKDIR}
- bash ${DISTDIR}/${NV_PACKAGE}-${PKG_V}.run --extract-only
-
- # Next section applies patches for linux-2.5 kernel, and/or
- # bugfixes for linux-2.4. All these are from:
- #
- # http://www.minion.de/nvidia/
- #
- # Many thanks to Christian Zander <zander@minion.de> for bringing
- # these to us, and being so helpful to select which to use.
-
- get_KV_info
-
- cd ${S}
- einfo "Linux kernel ${KV_major}.${KV_minor}.${KV_micro}"
-
- if is_kernel 2 5 || is_kernel 2 6
- then
- EPATCH_SINGLE_MSG="Applying basic sysfs patch ..." \
- epatch ${FILESDIR}/${PV}/NVIDIA_kernel-${NV_V}-basic-sysfs-support.patch
-
- # Kbuild have issues currently (sandbox related).
-# ln -snf Makefile.nvidia Makefile
- sed -e "s:5328:${NV_V/1.0-/}:g" \
- ${FILESDIR}/${PV}/Makefile > ${S}/makefile
- fi
-
- # if you set this then it's your own fault when stuff breaks :)
- [ ! -z "${USE_CRAZY_OPTS}" ] && sed -i "s:-O:${CFLAGS}:" Makefile
-}
-
-src_compile() {
- # Portage should determine the version of the kernel sources
- check_KV
-
- # IGNORE_CC_MISMATCH disables a sanity check that's needed when gcc has been
- # updated but the running kernel is still compiled with an older gcc. This is
- # needed for chrooted building, where the sanity check detects the gcc of the
- # kernel outside the chroot rather than within.
- if is_kernel 2 5 || is_kernel 2 6
- then
- make IGNORE_CC_MISMATCH="yes" KERNDIR="/usr/src/linux" \
- clean nvidia.o || die
- else
- make IGNORE_CC_MISMATCH="yes" KERNDIR="/usr/src/linux" \
- clean module || die
- fi
-}
-
-src_install() {
- # The driver goes into the standard modules location
- insinto /lib/modules/${KV}/video
- if is_kernel 2 5 || is_kernel 2 6
- then
- newins nvidia.o nvidia.ko
- else
- doins nvidia.o
- fi
-
- # Add the aliases
- insinto /etc/modules.d
- newins ${FILESDIR}/nvidia-1.1 nvidia
-
- # Docs
- dodoc ${S}/README
-
- # The device creation script
- into /
- newsbin ${S}/makedevices.sh NVmakedevices.sh
-}
-
-pkg_postinst() {
- if [ "${ROOT}" = "/" ]
- then
- # Update module dependency
- [ -x /usr/sbin/update-modules ] && /usr/sbin/update-modules
- if [ ! -e /dev/.devfsd ] && [ -x /sbin/NVmakedevices.sh ]
- then
- /sbin/NVmakedevices.sh >/dev/null 2>&1
- fi
- fi
-
- echo
- einfo "If you are not using devfs, loading the module automatically at"
- einfo "boot up, you need to add \"nvidia\" to your /etc/modules.autoload."
- echo
- ewarn "Please note that the driver name changed from \"NVdriver\""
- ewarn "to \"nvidia.o\"."
- echo
-}
diff --git a/media-video/nvidia-kernel/nvidia-kernel-1.0.5336.ebuild b/media-video/nvidia-kernel/nvidia-kernel-1.0.5336.ebuild
deleted file mode 100644
index ba72b2e58d45..000000000000
--- a/media-video/nvidia-kernel/nvidia-kernel-1.0.5336.ebuild
+++ /dev/null
@@ -1,159 +0,0 @@
-# Copyright 1999-2004 Gentoo Technologies, Inc.
-# Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/media-video/nvidia-kernel/nvidia-kernel-1.0.5336.ebuild,v 1.1 2004/02/01 02:47:43 azarah Exp $
-
-inherit eutils
-
-PKG_V="pkg1"
-NV_V="${PV/1.0./1.0-}"
-NV_PACKAGE="NVIDIA-Linux-x86-${NV_V}"
-S="${WORKDIR}/${NV_PACKAGE}-${PKG_V}/usr/src/nv"
-DESCRIPTION="Linux kernel module for the NVIDIA's X driver"
-HOMEPAGE="http://www.nvidia.com/"
-SRC_URI="ftp://download.nvidia.com/XFree86/Linux-x86/${NV_V}/${NV_PACKAGE}-${PKG_V}.run"
-
-# The slot needs to be set to $KV to prevent unmerges of modules for other kernels.
-LICENSE="NVIDIA"
-SLOT="${KV}"
-KEYWORDS="-* ~x86"
-RESTRICT="nostrip"
-
-DEPEND="virtual/linux-sources"
-export _POSIX2_VERSION="199209"
-
-
-pkg_setup() {
- if [ ! -f /proc/mtrr ]
- then
- eerror "This version needs MTRR support for most chipsets!"
- eerror "Please enable MTRR support in your kernel config, found at:"
- eerror
- eerror " Processor type and features -> [*] MTRR (Memory Type Range Register) support"
- eerror
- eerror "and recompile your kernel ..."
- die "MTRR support not detected!"
- fi
-
- check_version_h
-}
-
-check_version_h() {
- if [ ! -f "${ROOT}/usr/src/linux/include/linux/version.h" ]
- then
- eerror "Please verify that your /usr/src/linux symlink is pointing"
- eerror "to your current kernel sources, and that you did run:"
- eerror
- eerror " # make dep"
- die "/usr/src/linux symlink not setup!"
- fi
-}
-
-get_KV_info() {
- check_version_h
-
- # Get the kernel version of sources in /usr/src/linux ...
- export KV_full="$(awk '/UTS_RELEASE/ { gsub("\"", "", $3); print $3 }' \
- "${ROOT}/usr/src/linux/include/linux/version.h")"
- export KV_major="$(echo "${KV_full}" | cut -d. -f1)"
- export KV_minor="$(echo "${KV_full}" | cut -d. -f2)"
- export KV_micro="$(echo "${KV_full}" | cut -d. -f3 | sed -e 's:[^0-9].*::')"
-}
-
-is_kernel() {
- [ -z "$1" -o -z "$2" ] && return 1
-
- get_KV_info
-
- if [ "${KV_major}" -eq "$1" -a "${KV_minor}" -eq "$2" ]
- then
- return 0
- else
- return 1
- fi
-}
-
-src_unpack() {
- cd ${WORKDIR}
- bash ${DISTDIR}/${NV_PACKAGE}-${PKG_V}.run --extract-only
-
- # Next section applies patches for linux-2.5 kernel, and/or
- # bugfixes for linux-2.4. All these are from:
- #
- # http://www.minion.de/nvidia/
- #
- # Many thanks to Christian Zander <zander@minion.de> for bringing
- # these to us, and being so helpful to select which to use.
-
- get_KV_info
-
- cd ${S}
- einfo "Linux kernel ${KV_major}.${KV_minor}.${KV_micro}"
-
- if is_kernel 2 5 || is_kernel 2 6
- then
-# EPATCH_SINGLE_MSG="Applying tasklet patch ..." \
-# epatch ${FILESDIR}/${PV}/NVIDIA_kernel-${NV_V}-2.6-20040105.diff
-
- # Kbuild have issues currently (sandbox related).
-# ln -snf Makefile.nvidia Makefile
- cp -f ${FILESDIR}/${PV}/Makefile ${S}/Makefile.nvidia
- cp -f ${FILESDIR}/${PV}/Makefile ${S}/Makefile.kbuild
- fi
-
- # if you set this then it's your own fault when stuff breaks :)
- [ ! -z "${USE_CRAZY_OPTS}" ] && sed -i "s:-O:${CFLAGS}:" Makefile
-}
-
-src_compile() {
- # Portage should determine the version of the kernel sources
- check_KV
-
- # IGNORE_CC_MISMATCH disables a sanity check that's needed when gcc has been
- # updated but the running kernel is still compiled with an older gcc. This is
- # needed for chrooted building, where the sanity check detects the gcc of the
- # kernel outside the chroot rather than within.
- make IGNORE_CC_MISMATCH="yes" KERNDIR="/usr/src/linux" \
- clean nvidia.o || die
-}
-
-src_install() {
- # The driver goes into the standard modules location
- insinto /lib/modules/${KV}/video
- if is_kernel 2 5 || is_kernel 2 6
- then
- newins nvidia.o nvidia.ko
- else
- doins nvidia.o
- fi
-
- # Add the aliases
- insinto /etc/modules.d
- newins ${FILESDIR}/nvidia-1.1 nvidia
-
- # Docs
- dodoc ${S}/README
-
- # The device creation script
- into /
- newsbin ${S}/makedevices.sh NVmakedevices.sh
-}
-
-pkg_postinst() {
- if [ "${ROOT}" = "/" ]
- then
- # Update module dependency
- [ -x /usr/sbin/update-modules ] && /usr/sbin/update-modules
- if [ ! -e /dev/.devfsd ] && [ -x /sbin/NVmakedevices.sh ]
- then
- /sbin/NVmakedevices.sh >/dev/null 2>&1
- fi
- fi
-
- echo
- einfo "If you are not using devfs, loading the module automatically at"
- einfo "boot up, you need to add \"nvidia\" to your /etc/modules.autoload."
- echo
- ewarn "Please note that the driver name changed from \"NVdriver\""
- ewarn "to \"nvidia.o\"."
- echo
-}