Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #if defined(NV_PROC_DIR_ENTRY_HAS_OWNER)
- #define NV_SET_PROC_ENTRY_OWNER(entry) ((entry)->owner = THIS_MODULE)
- #else
- #define NV_SET_PROC_ENTRY_OWNER(entry)
- #endif
- #define NV_CREATE_PROC_ENTRY(name,mode,parent,NULL) \
- ({ \
- struct proc_dir_entry *__entry; \
- __entry = proc_create(name, mode, parent, NULL); \
- if (__entry != NULL) \
- NV_SET_PROC_ENTRY_OWNER(__entry); \
- __entry; \
- })
- #define NV_CREATE_PROC_FILE(name,parent,__read_proc, \
- __write_proc,__fops,__data) \
- ({ \
- struct proc_dir_entry *__entry; \
- int __mode = (S_IFREG | S_IRUGO); \
- if ((NvUPtr)(__write_proc) != 0) \
- __mode |= S_IWUSR; \
- __entry = NV_CREATE_PROC_ENTRY(name, __mode, parent, NULL); \
- if (__entry != NULL) \
- { \
- if ((NvUPtr)(__read_proc) != 0) \
- __entry->read_proc = (__read_proc); \
- if ((NvUPtr)(__write_proc) != 0) \
- { \
- __entry->write_proc = (__write_proc); \
- __entry->proc_fops = (__fops); \
- } \
- __entry->data = (__data); \
- } \
- __entry; \
- })
- #define NV_CREATE_PROC_DIR(name,parent) \
- ({ \
- struct proc_dir_entry *__entry; \
- int __mode = (S_IFDIR | S_IRUGO | S_IXUGO); \
- __entry = NV_CREATE_PROC_ENTRY(name, __mode, parent, NULL); \
- __entry; \
- })
- #define NV_PROC_WRITE_BUFFER_SIZE (64 * RM_PAGE_SIZE)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement