1 diff -uNr NVIDIA-Linux-x86-1.0-5336-pkg1/usr/src/nv/nv.c NVIDIA-Linux-x86-1.0-5336-pkg1.fixed/usr/src/nv/nv.c
2 --- NVIDIA-Linux-x86-1.0-5336-pkg1/usr/src/nv/nv.c 2004-01-15 04:29:11.000000000 +0100
3 +++ NVIDIA-Linux-x86-1.0-5336-pkg1.fixed/usr/src/nv/nv.c 2004-02-17 20:53:36.000000000 +0100
5 * addresses by the CPU. This nopage handler will fault on CPU
6 * accesses to AGP memory and map the address to the correct page.
8 -struct page *nv_kern_vma_nopage(struct vm_area_struct *vma, unsigned long address, int write_access)
9 +struct page *nv_kern_vma_nopage(struct vm_area_struct *vma, unsigned long address, int *write_access)
11 #if defined(NVCPU_IA64) && (LINUX_VERSION_CODE >= KERNEL_VERSION(2, 4, 9))
15 nv_kern_vma_release, /* "close" */
20 static nv_file_private_t *
22 * so use the first page, which is page-aligned. this way, our
23 * allocated page table does not need to be page-aligned
25 - *pAddress = (void *) at->page_table[0].dma_addr;
26 + *pAddress = (void *)(NV_UINTPTR_T) at->page_table[0].dma_addr;
27 at->flags = NV_ALLOC_TYPE_PCI;
28 nvl_add_alloc(nvl, at);
30 diff -uNr NVIDIA-Linux-x86-1.0-5336-pkg1/usr/src/nv/nv-linux.h NVIDIA-Linux-x86-1.0-5336-pkg1.fixed/usr/src/nv/nv-linux.h
31 --- NVIDIA-Linux-x86-1.0-5336-pkg1/usr/src/nv/nv-linux.h 2004-01-15 04:29:11.000000000 +0100
32 +++ NVIDIA-Linux-x86-1.0-5336-pkg1.fixed/usr/src/nv/nv-linux.h 2004-02-17 20:57:55.438110888 +0100
35 #define NV_MEM_TRACKING_RETRIEVE_SIZE(ptr, size) \
37 - (char *) (ptr) -= sizeof(void *); \
38 + ptr -= sizeof(void *); \
39 size = *(int *) (ptr); \
43 #if defined(NVCPU_IA64)
44 #define NV_VMALLOC(ptr, size) \
46 - (void *) (ptr) = vmalloc_dma(size); \
47 + ptr = vmalloc_dma(size); \
48 VM_ALLOC_RECORD(ptr, size, "vm_alloc"); \
51 #define NV_VMALLOC(ptr, size) \
53 - (void *) (ptr) = vmalloc_32(size); \
54 + ptr = vmalloc_32(size); \
55 VM_ALLOC_RECORD(ptr, size, "vm_alloc"); \
60 #define NV_IOREMAP(ptr, physaddr, size) \
62 - (void *) (ptr) = ioremap(physaddr, size); \
63 + ptr = ioremap(physaddr, size); \
64 VM_ALLOC_RECORD(ptr, size, "vm_ioremap"); \
67 #define NV_IOREMAP_NOCACHE(ptr, physaddr, size) \
69 - (void *) (ptr) = ioremap_nocache(physaddr, size); \
70 + ptr = ioremap_nocache(physaddr, size); \
71 VM_ALLOC_RECORD(ptr, size, "vm_ioremap_nocache"); \
76 #define NV_KMALLOC(ptr, size) \
78 - (void *) (ptr) = kmalloc(size, GFP_KERNEL); \
79 + ptr = kmalloc(size, GFP_KERNEL); \
80 KM_ALLOC_RECORD(ptr, size, "km_alloc"); \
83 #define NV_KMALLOC_ATOMIC(ptr, size) \
85 - (void *) (ptr) = kmalloc(size, GFP_ATOMIC); \
86 + ptr = kmalloc(size, GFP_ATOMIC); \
87 KM_ALLOC_RECORD(ptr, size, "km_alloc_atomic"); \
92 #define NV_GET_FREE_PAGES(ptr, order) \
94 - (void *) (ptr) = __get_free_pages(NV_GFP_HW, order); \
95 + ptr = __get_free_pages(NV_GFP_HW, order); \
98 #define NV_FREE_PAGES(ptr, order) \
101 /* for the card devices */
102 #define NVL_FROM_FILEP(filep) \
103 - ((nv_linux_state_t*) (NV_GET_NVFP(filep))->nvptr)
104 + ((NV_GET_NVFP(filep))->nvptr)
106 #define NV_GET_NVL_FROM_NV_STATE(nv) \
107 ((nv_linux_state_t *) nv->os_state)