lh | 9ed821d | 2023-04-07 01:36:19 -0700 | [diff] [blame] | 1 | #include <linux/module.h> |
| 2 | #include <linux/syscalls.h> |
| 3 | |
| 4 | #ifdef USE_CPPS_KO |
| 5 | |
| 6 | struct cpps_callbacks cpps_callbacks; |
| 7 | EXPORT_SYMBOL(cpps_callbacks); |
| 8 | |
| 9 | int cpps_callbacks_register(struct cpps_callbacks *p_call) |
| 10 | { |
| 11 | cpps_callbacks = *p_call; |
| 12 | |
| 13 | return 0; |
| 14 | } |
| 15 | EXPORT_SYMBOL(cpps_callbacks_register); |
| 16 | |
| 17 | int cpps_callbacks_unregister(void) |
| 18 | { |
| 19 | memset(&cpps_callbacks,0,sizeof(cpps_callbacks)); |
| 20 | |
| 21 | return 0; |
| 22 | } |
| 23 | EXPORT_SYMBOL(cpps_callbacks_unregister); |
| 24 | |
| 25 | struct cpps_globalModem cpps_global_var; |
| 26 | EXPORT_SYMBOL(cpps_global_var); |
| 27 | |
| 28 | int cpps_globalVar_register(struct cpps_globalModem *p_var) |
| 29 | { |
| 30 | cpps_global_var = *p_var; |
| 31 | |
| 32 | return 0; |
| 33 | } |
| 34 | EXPORT_SYMBOL(cpps_globalVar_register); |
| 35 | |
| 36 | |
| 37 | #endif /* USE_CPPS_KO */ |
| 38 | |
| 39 | long kernel_sys_mount(char __user *dev_name, char __user *dir_name, |
| 40 | char __user *type, unsigned long flags, |
| 41 | void __user *data) |
| 42 | { |
| 43 | return sys_mount(dev_name, dir_name, type, flags, data); |
| 44 | } |
| 45 | EXPORT_SYMBOL(kernel_sys_mount); |
| 46 | |
| 47 | long kernel_sys_umount(char __user *name, int flags) |
| 48 | { |
| 49 | return sys_umount(name, flags); |
| 50 | } |
| 51 | EXPORT_SYMBOL(kernel_sys_umount); |
| 52 | |
| 53 | long kernel_sys_lseek(unsigned int fd, off_t offset, |
| 54 | unsigned int origin) |
| 55 | { |
| 56 | return sys_lseek(fd, offset, origin); |
| 57 | } |
| 58 | EXPORT_SYMBOL(kernel_sys_lseek); |
| 59 | |
| 60 | long kernel_sys_unlink(const char __user *pathname) |
| 61 | { |
| 62 | return sys_unlink(pathname); |
| 63 | } |
| 64 | EXPORT_SYMBOL(kernel_sys_unlink); |
| 65 | |
| 66 | long kernel_sys_fsync(unsigned int fd) |
| 67 | { |
| 68 | return sys_fsync(fd); |
| 69 | } |
| 70 | EXPORT_SYMBOL(kernel_sys_fsync); |
| 71 | |
| 72 | long kernel_sys_rename(const char __user *oldname, |
| 73 | const char __user *newname) |
| 74 | { |
| 75 | return sys_rename(oldname, newname); |
| 76 | } |
| 77 | EXPORT_SYMBOL(kernel_sys_rename); |
| 78 | |
| 79 | long kernel_sys_read(unsigned int fd, char __user *buf, size_t count) |
| 80 | { |
| 81 | return sys_read(fd, buf, count); |
| 82 | } |
| 83 | EXPORT_SYMBOL(kernel_sys_read); |
| 84 | |
| 85 | long kernel_sys_write(unsigned int fd, const char __user *buf, |
| 86 | size_t count) |
| 87 | { |
| 88 | return sys_write(fd, buf, count); |
| 89 | } |
| 90 | EXPORT_SYMBOL(kernel_sys_write); |
| 91 | |
| 92 | long kernel_sys_mkdir(const char __user *pathname, umode_t mode) |
| 93 | { |
| 94 | return sys_mkdir(pathname, mode); |
| 95 | } |
| 96 | EXPORT_SYMBOL(kernel_sys_mkdir); |
| 97 | |
| 98 | long kernel_sys_getcwd(char __user *buf, unsigned long size) |
| 99 | { |
| 100 | return sys_getcwd(buf, size); |
| 101 | } |
| 102 | EXPORT_SYMBOL(kernel_sys_getcwd); |
| 103 | |
| 104 | long kernel_sys_ftruncate(unsigned int fd, unsigned long length) |
| 105 | { |
| 106 | return sys_ftruncate(fd, length); |
| 107 | } |
| 108 | EXPORT_SYMBOL(kernel_sys_ftruncate); |
| 109 | |
| 110 | long kernel_sys_newstat(const char __user *filename, |
| 111 | struct stat __user *statbuf) |
| 112 | { |
| 113 | return sys_newstat(filename, statbuf); |
| 114 | } |
| 115 | EXPORT_SYMBOL(kernel_sys_newstat); |
| 116 | |
| 117 | long kernel_sys_getdents(unsigned int fd, |
| 118 | struct linux_dirent __user *dirent, |
| 119 | unsigned int count) |
| 120 | { |
| 121 | return sys_getdents(fd, dirent, count); |
| 122 | } |
| 123 | EXPORT_SYMBOL(kernel_sys_getdents); |
| 124 | |
| 125 | long kernel_sys_chdir(const char __user *filename) |
| 126 | { |
| 127 | return sys_chdir(filename); |
| 128 | } |
| 129 | EXPORT_SYMBOL(kernel_sys_chdir); |
| 130 | |
| 131 | long kernel_sys_rmdir(const char __user *pathname) |
| 132 | { |
| 133 | return sys_rmdir(pathname); |
| 134 | } |
| 135 | EXPORT_SYMBOL(kernel_sys_rmdir); |
| 136 | |
| 137 | long kernel_sys_newfstat(unsigned int fd, struct stat __user *statbuf) |
| 138 | { |
| 139 | return sys_newfstat(fd, statbuf); |
| 140 | } |
| 141 | EXPORT_SYMBOL(kernel_sys_newfstat); |
| 142 | |
| 143 | long kernel_sys_sync(void) |
| 144 | { |
| 145 | return sys_sync(); |
| 146 | } |
| 147 | EXPORT_SYMBOL(kernel_sys_sync); |
| 148 | |
| 149 | long kernel_sys_chmod(const char __user *filename, umode_t mode) |
| 150 | { |
| 151 | return sys_chmod(filename, mode); |
| 152 | } |
| 153 | EXPORT_SYMBOL(kernel_sys_chmod); |
| 154 | |
| 155 | long kernel_sys_open(const char __user *filename, |
| 156 | int flags, umode_t mode) |
| 157 | { |
| 158 | return sys_open(filename, flags, mode); |
| 159 | } |
| 160 | EXPORT_SYMBOL(kernel_sys_open); |
| 161 | |
xf.li | aa4d92f | 2023-09-13 00:18:58 -0700 | [diff] [blame] | 162 | long kernel_sys_ioctl(const char __user *filename, unsigned int cmd, |
| 163 | unsigned long arg) |
| 164 | { |
| 165 | return sys_ioctl(filename,cmd,arg); |
| 166 | } |
| 167 | EXPORT_SYMBOL(kernel_sys_ioctl); |
| 168 | |
lh | 9ed821d | 2023-04-07 01:36:19 -0700 | [diff] [blame] | 169 | long kernel_sys_access(const char __user *filename, int mode) |
| 170 | { |
| 171 | return sys_access(filename, mode); |
| 172 | } |
| 173 | EXPORT_SYMBOL(kernel_sys_access); |
| 174 | |
| 175 | long kernel_sys_statfs(const char __user * path, |
| 176 | struct statfs __user *buf) |
| 177 | { |
| 178 | return sys_statfs(path, buf); |
| 179 | } |
| 180 | EXPORT_SYMBOL(kernel_sys_statfs); |
| 181 | |
| 182 | long kernel_sys_creat(const char __user *pathname, umode_t mode) |
| 183 | { |
| 184 | return sys_creat(pathname, mode); |
| 185 | } |
| 186 | EXPORT_SYMBOL(kernel_sys_creat); |
| 187 | |
| 188 | long kernel_sys_close(unsigned int fd) |
| 189 | { |
| 190 | return sys_close(fd); |
| 191 | } |
| 192 | EXPORT_SYMBOL(kernel_sys_close); |
| 193 | |
| 194 | /* |
| 195 | ERROR: "sys_lseek" [drivers/cpkodemo/cpkodemo.ko.ko] undefined! |
| 196 | ERROR: "sys_unlink" [drivers/cpkodemo/cpkodemo.ko.ko] undefined! |
| 197 | ERROR: "sys_fsync" [drivers/cpkodemo/cpkodemo.ko.ko] undefined! |
| 198 | ERROR: "sys_rename" [drivers/cpkodemo/cpkodemo.ko.ko] undefined! |
| 199 | ERROR: "sys_read" [drivers/cpkodemo/cpkodemo.ko.ko] undefined! |
| 200 | ERROR: "sys_write" [drivers/cpkodemo/cpkodemo.ko.ko] undefined! |
| 201 | ERROR: "sys_mkdir" [drivers/cpkodemo/cpkodemo.ko.ko] undefined! |
| 202 | ERROR: "sys_getcwd" [drivers/cpkodemo/cpkodemo.ko.ko] undefined! |
| 203 | ERROR: "sys_ftruncate" [drivers/cpkodemo/cpkodemo.ko.ko] undefined! |
| 204 | ERROR: "sys_newstat" [drivers/cpkodemo/cpkodemo.ko.ko] undefined! |
| 205 | ERROR: "sys_getdents" [drivers/cpkodemo/cpkodemo.ko.ko] undefined! |
| 206 | ERROR: "sys_chdir" [drivers/cpkodemo/cpkodemo.ko.ko] undefined! |
| 207 | ERROR: "sys_rmdir" [drivers/cpkodemo/cpkodemo.ko.ko] undefined! |
| 208 | ERROR: "sys_newfstat" [drivers/cpkodemo/cpkodemo.ko.ko] undefined! |
| 209 | ERROR: "sys_sync" [drivers/cpkodemo/cpkodemo.ko.ko] undefined! |
| 210 | ERROR: "sys_chmod" [drivers/cpkodemo/cpkodemo.ko.ko] undefined! |
| 211 | ERROR: "sys_open" [drivers/cpkodemo/cpkodemo.ko.ko] undefined! |
| 212 | ERROR: "sys_access" [drivers/cpkodemo/cpkodemo.ko.ko] undefined! |
| 213 | ERROR: "sys_statfs" [drivers/cpkodemo/cpkodemo.ko.ko] undefined! |
| 214 | ERROR: "sys_creat" [drivers/cpkodemo/cpkodemo.ko.ko] undefined! |
| 215 | */ |