diff options
author | Daniel Robbins <drobbins@gentoo.org> | 2001-01-16 17:07:58 +0000 |
---|---|---|
committer | Daniel Robbins <drobbins@gentoo.org> | 2001-01-16 17:07:58 +0000 |
commit | c2221a2cc0befd73199cb9083904cc182cf59332 (patch) | |
tree | 0e0447da9aa1fa00c18842100e1e1466665e15fb /x11-base | |
parent | *** empty log message *** (diff) | |
download | historical-c2221a2cc0befd73199cb9083904cc182cf59332.tar.gz historical-c2221a2cc0befd73199cb9083904cc182cf59332.tar.bz2 historical-c2221a2cc0befd73199cb9083904cc182cf59332.zip |
adding missing files
Diffstat (limited to 'x11-base')
-rw-r--r-- | x11-base/nvidia/files/nvidia_devfs.diff | 149 | ||||
-rw-r--r-- | x11-base/nvidia/files/patch-2.4.0-PR | 118 |
2 files changed, 267 insertions, 0 deletions
diff --git a/x11-base/nvidia/files/nvidia_devfs.diff b/x11-base/nvidia/files/nvidia_devfs.diff new file mode 100644 index 000000000000..5fa03cf3b06b --- /dev/null +++ b/x11-base/nvidia/files/nvidia_devfs.diff @@ -0,0 +1,149 @@ +Binary files NVIDIA_kernel-0.9-4/.nv.c.swp and NVIDIA_kernel_devfs-0.9-4/.nv.c.swp differ +Binary files NVIDIA_kernel-0.9-4/.nv.h.swp and NVIDIA_kernel_devfs-0.9-4/.nv.h.swp differ +diff -urN NVIDIA_kernel-0.9-4/DEVFS_README NVIDIA_kernel_devfs-0.9-4/DEVFS_README +--- NVIDIA_kernel-0.9-4/DEVFS_README Wed Dec 31 18:00:00 1969 ++++ NVIDIA_kernel_devfs-0.9-4/DEVFS_README Mon Aug 7 00:06:11 2000 +@@ -0,0 +1,14 @@ ++ The devfs patch should still compile if you have a 2.4.x kernel without ++devfs. If you use devfs, all this patch does is create the devices for you ++whenever the module is loaded, so you don't have to create them manually every ++time you reboot. ++ It is normal to not have the /dev files nvidia1 - nvidia3, those are only for ++extra video cards and will be made if any other nvidia cards are found. ++ It would be much better to make it so the /dev files were not put in ++/dev but rather in a subdirectory in /dev (as is the point of creating devfs ++in the first place), but that would require changing source code that I do ++not have access to. ++ ++Vomjom ++ ++Any problems or questions, mail me at vomjom@earthlink.net +diff -urN NVIDIA_kernel-0.9-4/nv.c NVIDIA_kernel_devfs-0.9-4/nv.c +--- NVIDIA_kernel-0.9-4/nv.c Mon Jul 10 17:32:13 2000 ++++ NVIDIA_kernel_devfs-0.9-4/nv.c Mon Aug 7 00:01:37 2000 +@@ -122,6 +122,13 @@ + nv_client_t nv_clients[NV_MAX_CLIENTS]; + struct tq_struct nv_bottom_halves[NV_MAX_CLIENTS]; + ++/* devfs stuff */ ++#ifdef DEVFS ++#include<linux/devfs_fs_kernel.h> ++devfs_handle_t nv_handles[NV_MAX_CLIENTS]; ++devfs_handle_t nv_ctl_handle; ++#endif ++ + /* + * pick apart our minor device number + * low 3 bits is NV device +@@ -324,7 +331,7 @@ + return 0; + } + +-void nv_probe_devices(void) ++int nv_probe_devices(void) + { + int probenum = 0; + unsigned char bus, func; +@@ -433,6 +440,7 @@ + NV_DMSG((nv_state_t *) 0, + "nv_probe_devices: found %d device%s", dev_count, + dev_count == 1 ? "" : "s"); ++ return dev_count; + } + + +@@ -851,7 +859,9 @@ + int rc; + + // Register driver ++#ifndef DEVFS + rc = register_chrdev(nv_major, "nvidia", &nv_fops); ++ + if (rc < 0) { + NV_EMSG((nv_state_t *) 0, + "init_module: register failed %d", rc); +@@ -860,10 +870,38 @@ + // if we requested dynamic major assignment, then 'rc' will have new number + if (nv_major == 0) + nv_major = rc; +- + NV_DMSG((nv_state_t *) 0, "init_module: major number %d", nv_major); + + nv_probe_devices(); ++#else ++ { ++ int i; ++ char device_name[16]; ++ int ret; ++ ++ if(devfs_register_chrdev(nv_major, "nvidia", &nv_fops)) ++ { ++ NV_EMSG((nv_state_t *) 0, "init_module: register failed %d", nv_major); ++ return nv_major; ++ } ++/* It would be MUCH better to make devices in a subdirectory in /dev, but since the ++ * location of the current devices is probably hard-coded elsewhere, and I can't access ++ * the source code, it's probably something for you guys to change later. */ ++ nv_ctl_handle = devfs_register(NULL, "nvidiactl", DEVFS_FL_DEFAULT, nv_major, 0xFF, ++ S_IFCHR | S_IRUGO | S_IWUGO, &nv_fops, NULL); ++ ret = nv_probe_devices(); ++ for(i = 0; i < ret; i++) ++ { ++ sprintf(device_name, "nvidia%d", i); ++ nv_handles[i] = devfs_register(NULL, device_name, DEVFS_FL_DEFAULT, nv_major, i, ++ S_IFCHR | S_IRUGO | S_IWUGO, &nv_fops, NULL); ++ } ++ while(i != NV_MAX_DEVICES) ++ { ++ nv_handles[++i] = 0; ++ } ++ } ++#endif + + // init all the bottom half structures + for (nv = nv_devices; nv < nv_devices + NV_MAX_DEVICES; nv++) +@@ -902,16 +940,30 @@ + + // make sure we freed up all the mappings + // kernel should do this automagically before calling close +- for (nv = &nv_devices[0]; nv < nv_devices + NV_MAX_DEVICES; nv++) ++ for (nv = nv_devices; nv < nv_devices + NV_MAX_DEVICES; nv++) + if (nv->alloc_queue) + NV_EMSG(nv, + "still have vm que at cleanup_module(): 0x%x to 0x%x", + nv->alloc_queue->vma->vm_start, + nv->alloc_queue->vma->vm_end); + ++#ifndef DEVFS + if ((rc = unregister_chrdev(nv_major, "nvidia")) < 0) + NV_EMSG((nv_state_t *) 0, + "cleanup_module: unregister nv failed %d", rc); ++#else ++ { ++ int i = 0; ++ if(devfs_unregister_chrdev(nv_major, "nvidia")) ++ NV_EMSG((nv_state_t *) 0, ++ "cleanup_module: unregister nv failed %d", nv_major); ++ devfs_unregister(nv_ctl_handle); ++ while(nv_handles[i]) ++ { ++ devfs_unregister(nv_handles[i++]); ++ } ++ } ++#endif + } + + static void nv_interrupts_disable( +diff -urN NVIDIA_kernel-0.9-4/nv.h NVIDIA_kernel_devfs-0.9-4/nv.h +--- NVIDIA_kernel-0.9-4/nv.h Mon Jul 10 17:32:13 2000 ++++ NVIDIA_kernel_devfs-0.9-4/nv.h Mon Aug 7 00:02:08 2000 +@@ -138,6 +138,9 @@ + #ifdef CONFIG_AGP_MODULE + #define AGPGART + #endif ++#ifdef CONFIG_DEVFS_FS ++ #define DEVFS ++#endif + + #ifdef AGPGART + #include <linux/types.h> diff --git a/x11-base/nvidia/files/patch-2.4.0-PR b/x11-base/nvidia/files/patch-2.4.0-PR new file mode 100644 index 000000000000..f4c045a43abc --- /dev/null +++ b/x11-base/nvidia/files/patch-2.4.0-PR @@ -0,0 +1,118 @@ +diff -ruN NVIDIA_kernel-0.9-5/nv.c nvdriver/nv.c +--- NVIDIA_kernel-0.9-5/nv.c Sat Aug 26 02:48:38 2000 ++++ nvdriver/nv.c Tue Jan 2 13:43:13 2001 +@@ -49,6 +49,13 @@ + #include <linux/modversions.h> + #endif + ++#ifndef mem_map_dec_count ++ #define mem_map_dec_count(p) atomic_dec(&((p)->count)); ++#endif ++#ifndef mem_map_inc_count ++ #define mem_map_inc_count(p) atomic_inc(&((p)->count)); ++#endif ++ + #include <nv.h> // needs to precede other headers (SMP) + + #include <linux/stddef.h> +@@ -778,17 +785,6 @@ + } + + +-void nv_vma_release(struct vm_area_struct *vma) +-{ +- nv_state_t *nv; +- +- nv = &nv_devices[NV_DEVICE_NUMBER(LINUX_VMA_DEV(vma))]; +- NV_DMSG(nv, "vma_release [0x%lx-0x%lx]", vma->vm_start, vma->vm_end); +- +- MOD_DEC_USE_COUNT; +-} +- +- + // assumes we are destroying entire map + void nv_vma_unmap( + struct vm_area_struct *vma, +@@ -833,6 +829,21 @@ + } + } + ++ ++void nv_vma_release(struct vm_area_struct *vma) ++{ ++ nv_state_t *nv; ++ ++ nv = &nv_devices[NV_DEVICE_NUMBER(LINUX_VMA_DEV(vma))]; ++ NV_DMSG(nv, "vma_release [0x%lx-0x%lx]", vma->vm_start, vma->vm_end); ++ ++ /* 2.4.0 PR fix/hack */ ++ nv_vma_unmap(vma, vma->vm_start, vma->vm_end - vma->vm_start); ++ ++ MOD_DEC_USE_COUNT; ++} ++ ++ + #if LINUX_VERSION_CODE < KERNEL_VERSION(2, 4, 0) + struct vm_operations_struct nv_vm_ops = { + nv_vma_open, +@@ -850,7 +861,8 @@ + struct vm_operations_struct nv_vm_ops = { + open: nv_vma_open, + close: nv_vma_release, +- unmap: nv_vma_unmap, ++/* 2.4.0 PR hack/fix */ ++/* unmap: nv_vma_unmap, */ + }; + #endif + +diff -ruN NVIDIA_kernel-0.9-5/nv.h nvdriver/nv.h +--- NVIDIA_kernel-0.9-5/nv.h Sat Aug 26 02:48:38 2000 ++++ nvdriver/nv.h Tue Jan 2 13:43:41 2001 +@@ -128,7 +128,7 @@ + #if LINUX_VERSION_CODE < KERNEL_VERSION(2, 3, 0) + #define KERNEL_2_2 + #else +- #warning This driver is not officially supported on post-2.2 kernels ++/* #warning This driver is not officially supported on post-2.2 kernels */ + #define KERNEL_2_3 + #endif // < 2.3 + #endif // < 2.2 +diff -ruN NVIDIA_kernel-0.9-5/os-interface.c nvdriver/os-interface.c +--- NVIDIA_kernel-0.9-5/os-interface.c Fri Sep 1 04:19:17 2000 ++++ nvdriver/os-interface.c Tue Jan 2 13:41:14 2001 +@@ -1331,6 +1331,11 @@ + char *parmp; + char ch; + ++ spinlock_t unload_lock = SPIN_LOCK_UNLOCKED; ++ struct module *mp = THIS_MODULE; ++ struct module_symbol *sym; ++ int i; ++ + if ((strlen(regParmStr) + NV_SYM_PREFIX_LENGTH) > NV_MAX_SYM_NAME) + goto done; + +@@ -1351,11 +1356,18 @@ + + *symp = '\0'; + +- symbol_value = get_module_symbol(NV_MODULE_NAME, symbol_name); +- +-#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 4, 0) +- put_module_symbol(symbol_value); +-#endif ++ spin_lock(&unload_lock); ++ if (MOD_CAN_QUERY(mp) && (mp->nsyms > 0)) { ++ for (i = mp->nsyms, sym = mp->syms; ++ i > 0; --i, ++sym) { ++ ++ if (strcmp(sym->name, symbol_name) == 0) { ++ symbol_value = sym->value; ++ break; ++ } ++ } ++ } ++ spin_unlock(&unload_lock); + + done: + return (void *) symbol_value; |