00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021 #ifndef DAZUKO_LINUX_H
00022 #define DAZUKO_LINUX_H
00023
00024 #if CONFIG_MODVERSIONS==1
00025 #define MODVERSIONS
00026 #include <linux/modversions.h>
00027 #endif
00028
00029 #include <linux/kernel.h>
00030 #include <linux/version.h>
00031
00032 #ifdef MODULE
00033 #include <linux/module.h>
00034 #endif
00035
00036 #ifndef KERNEL_VERSION
00037 #define KERNEL_VERSION(a,b,c) ((a)*65536+(b)*256+(c))
00038 #endif
00039
00040 #include <linux/init.h>
00041
00042 #include <linux/unistd.h>
00043 #include <linux/fs.h>
00044 #include <linux/slab.h>
00045 #include <asm/uaccess.h>
00046 #include <asm/atomic.h>
00047
00048 #ifdef CONFIG_SMP
00049 #ifndef __SMP__
00050 #define __SMP__
00051 #endif
00052 #endif
00053
00054 #ifdef __SMP__
00055 #include <asm/smplock.h>
00056 #endif
00057
00058
00059 #define DEVICE_NAME "dazuko"
00060
00061 #define XP_ERROR_PERMISSION -EPERM;
00062 #define XP_ERROR_INTERRUPT -EINTR;
00063 #define XP_ERROR_BUSY -EBUSY;
00064 #define XP_ERROR_FAULT -EFAULT;
00065 #define XP_ERROR_INVALID -EINVAL;
00066
00067
00068 struct xp_daemon_id
00069 {
00070 int pid;
00071 struct file *file;
00072 };
00073
00074 struct xp_file
00075 {
00076 struct file *file;
00077 };
00078
00079 struct xp_mutex
00080 {
00081 struct semaphore mutex;
00082 };
00083
00084 struct xp_atomic
00085 {
00086 atomic_t atomic;
00087 };
00088
00089 struct xp_file_struct
00090 {
00091 const char *user_filename;
00092 int filename_length;
00093 char *filename;
00094 int putname_filename;
00095 int full_filename_length;
00096 char *full_filename;
00097 int free_full_filename;
00098 struct dentry *dentry;
00099 int dput_dentry;
00100 char *buffer;
00101 int free_page_buffer;
00102 #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,4,0)
00103 struct nameidata nd;
00104 int path_release_nd;
00105 struct vfsmount *vfsmount;
00106 int mntput_vfsmount;
00107 #endif
00108 #ifdef DAZUKO_FIST
00109 struct inode *inode;
00110 #endif
00111 };
00112
00113 struct xp_queue
00114 {
00115 #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,4,0)
00116 wait_queue_head_t queue;
00117 #else
00118 struct wait_queue *queue;
00119 #endif
00120 };
00121
00122 struct xp_rwlock
00123 {
00124 rwlock_t rwlock;
00125 };
00126
00127 #ifdef FISTGEN
00128 int fist_dazuko_sys_generic(int event, struct inode *inode, struct dentry *dentry, struct vfsmount *vfsmount, int daemon_is_allowed);
00129 #endif
00130
00131 #endif