Lines 688-698
extern nv_spinlock_t km_lock;
Link Here
|
688 |
VM_ALLOC_RECORD(ptr, size, "vm_ioremap"); \ |
688 |
VM_ALLOC_RECORD(ptr, size, "vm_ioremap"); \ |
689 |
} |
689 |
} |
690 |
|
690 |
|
|
|
691 |
#if defined(NV_IOREMAP_NOCACHE_PRESENT) |
691 |
#define NV_IOREMAP_NOCACHE(ptr, physaddr, size) \ |
692 |
#define NV_IOREMAP_NOCACHE(ptr, physaddr, size) \ |
692 |
{ \ |
693 |
{ \ |
693 |
(ptr) = ioremap_nocache(physaddr, size); \ |
694 |
(ptr) = ioremap_nocache(physaddr, size); \ |
694 |
VM_ALLOC_RECORD(ptr, size, "vm_ioremap_nocache"); \ |
695 |
VM_ALLOC_RECORD(ptr, size, "vm_ioremap_nocache"); \ |
695 |
} |
696 |
} |
|
|
697 |
#else |
698 |
#define NV_IOREMAP_NOCACHE(ptr, physaddr, size) \ |
699 |
NV_IOREMAP(ptr, physaddr, size) |
700 |
#endif |
696 |
|
701 |
|
697 |
#if defined(NV_IOREMAP_CACHE_PRESENT) |
702 |
#if defined(NV_IOREMAP_CACHE_PRESENT) |
698 |
#define NV_IOREMAP_CACHE(ptr, physaddr, size) \ |
703 |
#define NV_IOREMAP_CACHE(ptr, physaddr, size) \ |
Lines 774-779
extern nv_spinlock_t km_lock;
Link Here
|
774 |
#error "NV_KMEM_CACHE_CREATE() undefined (kmem_cache_create() unavailable)!" |
779 |
#error "NV_KMEM_CACHE_CREATE() undefined (kmem_cache_create() unavailable)!" |
775 |
#endif |
780 |
#endif |
776 |
|
781 |
|
|
|
782 |
#if defined(NV_KMEM_CACHE_CREATE_USERCOPY_PRESENT) |
783 |
#define NV_KMEM_CACHE_CREATE_USERCOPY(kmem_cache, name, type) \ |
784 |
{ \ |
785 |
kmem_cache = kmem_cache_create_usercopy(name, sizeof(type), \ |
786 |
0, 0, 0, sizeof(type), NULL); \ |
787 |
} |
788 |
#else |
789 |
#define NV_KMEM_CACHE_CREATE_USERCOPY(kmem_cache, name, type) \ |
790 |
NV_KMEM_CACHE_CREATE(kmem_cache, name, type) |
791 |
#endif |
792 |
|
777 |
#define NV_KMEM_CACHE_ALLOC(ptr, kmem_cache, type) \ |
793 |
#define NV_KMEM_CACHE_ALLOC(ptr, kmem_cache, type) \ |
778 |
{ \ |
794 |
{ \ |
779 |
(ptr) = kmem_cache_alloc(kmem_cache, GFP_KERNEL); \ |
795 |
(ptr) = kmem_cache_alloc(kmem_cache, GFP_KERNEL); \ |
Lines 1971-1976
extern NvU32 nv_assign_gpu_count;
Link Here
|
1971 |
}) |
1987 |
}) |
1972 |
#endif |
1988 |
#endif |
1973 |
|
1989 |
|
|
|
1990 |
#if defined(NV_HAVE_PROC_OPS) |
1991 |
#define NV_CREATE_PROC_FILE(filename,parent,__name,__data) \ |
1992 |
({ \ |
1993 |
struct proc_dir_entry *__entry; \ |
1994 |
int mode = (S_IFREG | S_IRUGO); \ |
1995 |
const struct proc_ops *fops = &nv_procfs_##__name##_fops; \ |
1996 |
if (fops->proc_write != 0) \ |
1997 |
mode |= S_IWUSR; \ |
1998 |
__entry = NV_CREATE_PROC_ENTRY(filename, mode, parent, fops, \ |
1999 |
__data); \ |
2000 |
__entry; \ |
2001 |
}) |
2002 |
#else |
1974 |
#define NV_CREATE_PROC_FILE(filename,parent,__name,__data) \ |
2003 |
#define NV_CREATE_PROC_FILE(filename,parent,__name,__data) \ |
1975 |
({ \ |
2004 |
({ \ |
1976 |
struct proc_dir_entry *__entry; \ |
2005 |
struct proc_dir_entry *__entry; \ |
Lines 1982-1987
extern NvU32 nv_assign_gpu_count;
Link Here
|
1982 |
__data); \ |
2011 |
__data); \ |
1983 |
__entry; \ |
2012 |
__entry; \ |
1984 |
}) |
2013 |
}) |
|
|
2014 |
#endif |
1985 |
|
2015 |
|
1986 |
/* |
2016 |
/* |
1987 |
* proc_mkdir_mode exists in Linux 2.6.9, but isn't exported until Linux 3.0. |
2017 |
* proc_mkdir_mode exists in Linux 2.6.9, but isn't exported until Linux 3.0. |
Lines 2023-2028
extern NvU32 nv_assign_gpu_count;
Link Here
|
2023 |
remove_proc_entry(entry->name, entry->parent); |
2053 |
remove_proc_entry(entry->name, entry->parent); |
2024 |
#endif |
2054 |
#endif |
2025 |
|
2055 |
|
|
|
2056 |
#if defined(NV_HAVE_PROC_OPS) |
2057 |
#define NV_DEFINE_PROCFS_SINGLE_FILE(__name) \ |
2058 |
static int nv_procfs_open_##__name( \ |
2059 |
struct inode *inode, \ |
2060 |
struct file *filep \ |
2061 |
) \ |
2062 |
{ \ |
2063 |
return single_open(filep, nv_procfs_read_##__name, \ |
2064 |
NV_PDE_DATA(inode)); \ |
2065 |
} \ |
2066 |
\ |
2067 |
static const struct proc_ops nv_procfs_##__name##_fops = { \ |
2068 |
.proc_open = nv_procfs_open_##__name, \ |
2069 |
.proc_read = seq_read, \ |
2070 |
.proc_lseek = seq_lseek, \ |
2071 |
.proc_release = single_release, \ |
2072 |
}; |
2073 |
#else |
2026 |
#define NV_DEFINE_PROCFS_SINGLE_FILE(__name) \ |
2074 |
#define NV_DEFINE_PROCFS_SINGLE_FILE(__name) \ |
2027 |
static int nv_procfs_open_##__name( \ |
2075 |
static int nv_procfs_open_##__name( \ |
2028 |
struct inode *inode, \ |
2076 |
struct inode *inode, \ |
Lines 2040-2045
extern NvU32 nv_assign_gpu_count;
Link Here
|
2040 |
.llseek = seq_lseek, \ |
2088 |
.llseek = seq_lseek, \ |
2041 |
.release = single_release, \ |
2089 |
.release = single_release, \ |
2042 |
}; |
2090 |
}; |
|
|
2091 |
#endif |
2043 |
|
2092 |
|
2044 |
#endif /* CONFIG_PROC_FS */ |
2093 |
#endif /* CONFIG_PROC_FS */ |
2045 |
|
2094 |
|