[352] | 1 | /*
|
---|
| 2 | * TOPPERS ECHONET Lite Communication Middleware
|
---|
| 3 | *
|
---|
| 4 | * Copyright (C) 2018 Cores Co., Ltd. Japan
|
---|
| 5 | *
|
---|
| 6 | * 上記著作権者は,以下の(1)~(4)の条件を満たす場合に限り,本ソフトウェ
|
---|
| 7 | * ア(本ソフトウェアを改変したものを含む.以下同じ)を使用・複製・改
|
---|
| 8 | * 変・再配布(以下,利用と呼ぶ)することを無償で許諾する.
|
---|
| 9 | * (1) 本ソフトウェアをソースコードの形で利用する場合には,上記の著作
|
---|
| 10 | * 権表示,この利用条件および下記の無保証規定が,そのままの形でソー
|
---|
| 11 | * スコード中に含まれていること.
|
---|
| 12 | * (2) 本ソフトウェアを,ライブラリ形式など,他のソフトウェア開発に使
|
---|
| 13 | * 用できる形で再配布する場合には,再配布に伴うドキュメント(利用
|
---|
| 14 | * 者マニュアルなど)に,上記の著作権表示,この利用条件および下記
|
---|
| 15 | * の無保証規定を掲載すること.
|
---|
| 16 | * (3) 本ソフトウェアを,機器に組み込むなど,他のソフトウェア開発に使
|
---|
| 17 | * 用できない形で再配布する場合には,次のいずれかの条件を満たすこ
|
---|
| 18 | * と.
|
---|
| 19 | * (a) 再配布に伴うドキュメント(利用者マニュアルなど)に,上記の著
|
---|
| 20 | * 作権表示,この利用条件および下記の無保証規定を掲載すること.
|
---|
| 21 | * (b) 再配布の形態を,別に定める方法によって,TOPPERSプロジェクトに
|
---|
| 22 | * 報告すること.
|
---|
| 23 | * (4) 本ソフトウェアの利用により直接的または間接的に生じるいかなる損
|
---|
| 24 | * 害からも,上記著作権者およびTOPPERSプロジェクトを免責すること.
|
---|
| 25 | * また,本ソフトウェアのユーザまたはエンドユーザからのいかなる理
|
---|
| 26 | * 由に基づく請求からも,上記著作権者およびTOPPERSプロジェクトを
|
---|
| 27 | * 免責すること.
|
---|
| 28 | *
|
---|
| 29 | * 本ソフトウェアは,無保証で提供されているものである.上記著作権者お
|
---|
| 30 | * よびTOPPERSプロジェクトは,本ソフトウェアに関して,特定の使用目的
|
---|
| 31 | * に対する適合性も含めて,いかなる保証も行わない.また,本ソフトウェ
|
---|
| 32 | * アの利用により直接的または間接的に生じたいかなる損害に関しても,そ
|
---|
| 33 | * の責任を負わない.
|
---|
| 34 | *
|
---|
| 35 | * @(#) $Id$
|
---|
| 36 | */
|
---|
| 37 | #include "bits/syscall.h"
|
---|
| 38 | #include "shellif.h"
|
---|
| 39 | #include <t_syslog.h>
|
---|
| 40 | #include "MBRZA1H.h"
|
---|
| 41 |
|
---|
| 42 | void *thread_area;
|
---|
| 43 | void *tid_address;
|
---|
| 44 |
|
---|
| 45 | // https://os.mbed.com/users/dkato/code/FlashAccess/#652a093cf264
|
---|
| 46 | void flash_access_cache_control(void) {
|
---|
| 47 | unsigned int assoc;
|
---|
| 48 |
|
---|
| 49 | /* ==== Cleaning and invalidation of the L1 data cache ==== */
|
---|
[374] | 50 | L1C_CleanInvalidateDCacheAll();
|
---|
[352] | 51 | __DSB();
|
---|
| 52 |
|
---|
| 53 | /* ==== Cleaning and invalidation of the L2 cache ==== */
|
---|
[374] | 54 | if (L2C_310->AUX_CNT & (1 << 16)) {
|
---|
[352] | 55 | assoc = 16;
|
---|
| 56 | }
|
---|
| 57 | else {
|
---|
| 58 | assoc = 8;
|
---|
| 59 | }
|
---|
[374] | 60 | L2C_310->INV_WAY = (1 << assoc) - 1;
|
---|
| 61 | while (L2C_310->INV_WAY & ((1 << assoc) - 1)); // poll invalidate
|
---|
| 62 | L2C_310->CACHE_SYNC = 0x0;
|
---|
[352] | 63 |
|
---|
| 64 | /* ==== Invalidate all TLB entries ==== */
|
---|
[374] | 65 | MMU_InvalidateTLB();
|
---|
[352] | 66 |
|
---|
| 67 | /* ==== Invalidate the L1 instruction cache ==== */
|
---|
[374] | 68 | L1C_InvalidateICacheAll();
|
---|
[352] | 69 | __DSB();
|
---|
| 70 | __ISB();
|
---|
| 71 | }
|
---|
| 72 |
|
---|
| 73 | long no_implement(const char *text)
|
---|
| 74 | {
|
---|
| 75 | syslog(LOG_ERROR, text);
|
---|
| 76 | DebugBreak();
|
---|
| 77 | return -ENOSYS;
|
---|
| 78 | }
|
---|
| 79 |
|
---|
| 80 | long __syscall_nr(long n, ...)
|
---|
| 81 | {
|
---|
| 82 | long ret = -ENOSYS;
|
---|
| 83 | va_list ap;
|
---|
| 84 |
|
---|
| 85 | va_start(ap, n);
|
---|
| 86 |
|
---|
| 87 | switch (n) {
|
---|
| 88 | case __NR_setresgid:
|
---|
| 89 | no_implement("setresgid");
|
---|
| 90 | break;
|
---|
| 91 | case __NR_setresuid:
|
---|
| 92 | no_implement("setresuid");
|
---|
| 93 | break;
|
---|
| 94 | case __NR_setgid:
|
---|
| 95 | no_implement("setgid");
|
---|
| 96 | break;
|
---|
| 97 | case __NR_setregid:
|
---|
| 98 | no_implement("setregid");
|
---|
| 99 | break;
|
---|
| 100 | case __NR_setreuid:
|
---|
| 101 | no_implement("setreuid");
|
---|
| 102 | break;
|
---|
| 103 | case __NR_setuid:
|
---|
| 104 | no_implement("setuid");
|
---|
| 105 | break;
|
---|
| 106 | default:
|
---|
| 107 | no_implement("syscall");
|
---|
| 108 | break;
|
---|
| 109 | }
|
---|
| 110 |
|
---|
| 111 | va_end(ap);
|
---|
| 112 |
|
---|
| 113 | return ret;
|
---|
| 114 | }
|
---|
| 115 |
|
---|
| 116 | long SYS__llseek(long a, long b, long c, long d, long e) {
|
---|
| 117 | return shell_llseek((int)a, ((off_t)b << 32) | (off_t)c, (off_t *)d, (int)e);
|
---|
| 118 | }
|
---|
| 119 |
|
---|
| 120 | long SYS__newselect(long a, long b, long c, long d, long e) {
|
---|
| 121 | return shell_select((int)a, (fd_set *)b, (fd_set *)c, (fd_set *)d, (struct timeval *)e);
|
---|
| 122 | }
|
---|
| 123 |
|
---|
| 124 | long SYS_accept(long a, long b, long c) {
|
---|
| 125 | return shell_accept((int)a, (struct sockaddr *)b, (socklen_t *)c);
|
---|
| 126 | }
|
---|
| 127 |
|
---|
| 128 | long SYS_access(long a, long b) {
|
---|
| 129 | return shell_access((const char *)a, (int)b);
|
---|
| 130 | }
|
---|
| 131 |
|
---|
| 132 | long SYS_bind(long a, long b, long c) {
|
---|
| 133 | return shell_bind((int)a, (const struct sockaddr *)b, (socklen_t)c);
|
---|
| 134 | }
|
---|
| 135 |
|
---|
| 136 | long SYS_brk(long a) {
|
---|
| 137 | return (long)shell_brk((void *)a);
|
---|
| 138 | }
|
---|
| 139 |
|
---|
| 140 | long SYS_chdir(long a) {
|
---|
| 141 | return shell_chdir((const char *)a);
|
---|
| 142 | }
|
---|
| 143 |
|
---|
| 144 | long SYS_chmod(long a, long b) {
|
---|
| 145 | return shell_chmod((const char *)a, (mode_t)b);
|
---|
| 146 | }
|
---|
| 147 |
|
---|
| 148 | long SYS_chroot(long a) {
|
---|
| 149 | return shell_chroot((const char *)a);
|
---|
| 150 | }
|
---|
| 151 |
|
---|
| 152 | long SYS_clock_getres(long a, long b) {
|
---|
| 153 | return shell_clock_getres((clockid_t)a, (struct timespec *)b);
|
---|
| 154 | }
|
---|
| 155 |
|
---|
| 156 | long SYS_clock_gettime(long a, long b) {
|
---|
| 157 | return shell_clock_gettime((clockid_t)a, (struct timespec *)b);
|
---|
| 158 | }
|
---|
| 159 |
|
---|
| 160 | long SYS_clock_settime(long a, long b) {
|
---|
| 161 | return shell_clock_settime((clockid_t)a, (const struct timespec *)b);
|
---|
| 162 | }
|
---|
| 163 |
|
---|
| 164 | long SYS_close(long a) {
|
---|
| 165 | return shell_close((int)a);
|
---|
| 166 | }
|
---|
| 167 |
|
---|
| 168 | long SYS_connect(long a, long b, long c) {
|
---|
| 169 | return shell_connect((int)a, (const struct sockaddr *)b, (socklen_t)c);
|
---|
| 170 | }
|
---|
| 171 |
|
---|
| 172 | long SYS_exit(long a) {
|
---|
| 173 | shell_exit((int)a);
|
---|
| 174 | return 0;
|
---|
| 175 | }
|
---|
| 176 |
|
---|
| 177 | long SYS_exit_group(long a) {
|
---|
| 178 | shell_exit_group((int)a);
|
---|
| 179 | return 0;
|
---|
| 180 | }
|
---|
| 181 |
|
---|
| 182 | long SYS_fcntl64(long a, long b, long c) {
|
---|
| 183 | return shell_fcntl((int)a, (int)b, (void *)c);
|
---|
| 184 | }
|
---|
| 185 |
|
---|
[374] | 186 | long SYS_fdatasync(long a) {
|
---|
| 187 | //int fdatasync(int fd)
|
---|
[352] | 188 | return no_implement("fdatasync\n");
|
---|
| 189 | }
|
---|
| 190 |
|
---|
| 191 | long SYS_fstat64(long a, long b) {
|
---|
| 192 | return shell_fstat((int)a, (struct stat *)b);
|
---|
| 193 | }
|
---|
| 194 |
|
---|
| 195 | long SYS_fsync(long a) {
|
---|
| 196 | return shell_fsync((int)a);
|
---|
| 197 | }
|
---|
| 198 |
|
---|
| 199 | long SYS_ftruncate64(long a, long b, long c) {
|
---|
| 200 | return shell_ftruncate((int)a, ((off_t)b << 32) | (off_t)c);
|
---|
| 201 | }
|
---|
| 202 |
|
---|
[374] | 203 | long SYS_futex(long a, long b, long c, long d, long e, long f) {
|
---|
| 204 | //int futex(int *uaddr, int op, int val, const struct timespec *timeout, int *uaddr2, int val3);
|
---|
[352] | 205 | return no_implement("futex\n");
|
---|
| 206 | }
|
---|
| 207 |
|
---|
[374] | 208 | long SYS_futimesat(long a, long b, long c) {
|
---|
| 209 | //int futimesat(int dirfd, const char *pathname, const struct timeval times[2])
|
---|
[352] | 210 | return no_implement("futimesat\n");
|
---|
| 211 | }
|
---|
| 212 |
|
---|
| 213 | long SYS_getcwd(long a, long b) {
|
---|
| 214 | return (long)shell_getcwd((char *)a, (size_t)b);
|
---|
| 215 | }
|
---|
| 216 |
|
---|
| 217 | long SYS_getdents64(long a, long b, long c) {
|
---|
| 218 | return shell_getdents((int)a, (struct dirent *)b, (size_t)c);
|
---|
| 219 | }
|
---|
| 220 |
|
---|
| 221 | long SYS_getpeername(long a, long b, long c) {
|
---|
| 222 | return shell_getpeername((int)a, (struct sockaddr *)b, (socklen_t *)c);
|
---|
| 223 | }
|
---|
| 224 |
|
---|
| 225 | long SYS_getsockname(long a, long b, long c) {
|
---|
| 226 | return shell_getsockname((int)a, (struct sockaddr *)b, (socklen_t *)c);
|
---|
| 227 | }
|
---|
| 228 |
|
---|
| 229 | long SYS_getpid() {
|
---|
| 230 | return shell_getpid();
|
---|
| 231 | }
|
---|
| 232 |
|
---|
| 233 | long SYS_getsockopt(long a, long b, long c, long d, long e) {
|
---|
| 234 | return shell_getsockopt((int)a, (int)b, (int)c, (void *)d, (socklen_t *)e);
|
---|
| 235 | }
|
---|
| 236 |
|
---|
| 237 | long SYS_gettid() {
|
---|
| 238 | return shell_gettid();
|
---|
| 239 | }
|
---|
| 240 |
|
---|
| 241 | long SYS_gettimeofday(long a, long b) {
|
---|
| 242 | return shell_gettimeofday((struct timeval *)a, (void *)b);
|
---|
| 243 | }
|
---|
| 244 |
|
---|
| 245 | long SYS_getuid32() {
|
---|
| 246 | return no_implement("getuid\n");
|
---|
| 247 | }
|
---|
| 248 |
|
---|
| 249 | long SYS_ioctl(long a, long b, long c) {
|
---|
| 250 | return shell_ioctl((int)a, (int)b, (void *)c);
|
---|
| 251 | }
|
---|
| 252 |
|
---|
| 253 | long SYS_kill(long a, long b) {
|
---|
| 254 | return shell_kill((int)a, (int)b);
|
---|
| 255 | }
|
---|
| 256 |
|
---|
| 257 | long SYS_link(long a, long b) {
|
---|
| 258 | return shell_link((const char *)a, (const char *)b);
|
---|
| 259 | }
|
---|
| 260 |
|
---|
| 261 | long SYS_listen(long a, long b) {
|
---|
| 262 | return shell_listen((int)a, (int)b);
|
---|
| 263 | }
|
---|
| 264 |
|
---|
| 265 | long SYS_lstat64(long a, long b) {
|
---|
| 266 | return shell_lstat((const char *__restrict)a, (struct stat *__restrict)b);
|
---|
| 267 | }
|
---|
| 268 |
|
---|
| 269 | long SYS_madvise(long a, long b, long c) {
|
---|
| 270 | return shell_madvise((void *)a, (size_t)b, (int)c);
|
---|
| 271 | }
|
---|
| 272 |
|
---|
| 273 | long SYS_mkdir(long a, long b) {
|
---|
| 274 | return shell_mkdir((const char *)a, (mode_t)b);
|
---|
| 275 | }
|
---|
| 276 |
|
---|
| 277 | long SYS_mmap2(long a, long b, long c, long d, long e, long f, long g) {
|
---|
| 278 | return (int)shell_mmap2((void *)a, (size_t)b, (int)c, (int)d, (int)e, ((off_t)f << 32) | (off_t)g);
|
---|
| 279 | }
|
---|
| 280 |
|
---|
| 281 | long SYS_mprotect(long a, long b, long c) {
|
---|
| 282 | return shell_mprotect((void *)a, (size_t)b, (int)c);
|
---|
| 283 | }
|
---|
| 284 |
|
---|
[374] | 285 | long SYS_munmap(long a, long b) {
|
---|
| 286 | //int munmap(void *start, size_t len)
|
---|
[352] | 287 | return no_implement("munmap\n");
|
---|
| 288 | }
|
---|
| 289 |
|
---|
| 290 | long SYS_open(long a, long b, long c) {
|
---|
| 291 | return shell_open((const char *)a, (int)b, (void *)c);
|
---|
| 292 | }
|
---|
| 293 |
|
---|
| 294 | long SYS_poll(long a, long b, long c) {
|
---|
| 295 | return shell_poll((struct pollfd *)a, (nfds_t)b, (int)c);
|
---|
| 296 | }
|
---|
| 297 |
|
---|
[374] | 298 | long SYS_pread64(long a, long b, long c, long d) {
|
---|
| 299 | //#define pread64 pread
|
---|
| 300 | //ssize_t pread(int fd, void *buf, size_t size, off_t ofs)
|
---|
[352] | 301 | return no_implement("pread64\n");
|
---|
| 302 | }
|
---|
| 303 |
|
---|
[374] | 304 | long SYS_pwrite64(long a, long b, long c, long d) {
|
---|
| 305 | //#define pwrite64 pwrite
|
---|
| 306 | //ssize_t pwrite(int fd, const void *buf, size_t size, off_t ofs)
|
---|
[352] | 307 | return no_implement("pwrite64\n");
|
---|
| 308 | }
|
---|
| 309 |
|
---|
| 310 | long SYS_read(long a, long b, long c) {
|
---|
| 311 | return shell_read((int)a, (void *)b, (size_t)c);
|
---|
| 312 | }
|
---|
| 313 |
|
---|
| 314 | long SYS_readv(long a, long b, long c) {
|
---|
| 315 | return shell_readv((int)a, (const struct iovec *)b, (int)c);
|
---|
| 316 | }
|
---|
| 317 |
|
---|
| 318 | long SYS_recv(long a, long b, long c, long d) {
|
---|
[364] | 319 | return shell_recvfrom((int)a, (void *)b, (size_t)c, (int)d, NULL, NULL);
|
---|
[352] | 320 | }
|
---|
| 321 |
|
---|
| 322 | long SYS_recvfrom(long a, long b, long c, long d, long e, long f) {
|
---|
[364] | 323 | return shell_recvfrom(a, (void *)b, (size_t)c, (int)d, (struct sockaddr *)e, (socklen_t *)f);
|
---|
[352] | 324 | }
|
---|
| 325 |
|
---|
| 326 | long SYS_recvmsg(long a, long b, long c) {
|
---|
| 327 | return shell_recvmsg((int)a, (struct msghdr *)b, (size_t)c);
|
---|
| 328 | }
|
---|
| 329 |
|
---|
| 330 | long SYS_rename(long a, long b) {
|
---|
| 331 | return shell_rename((const char *)a, (const char *)b);
|
---|
| 332 | }
|
---|
| 333 |
|
---|
| 334 | long SYS_rmdir(long a) {
|
---|
| 335 | return shell_rmdir((const char *)a);
|
---|
| 336 | }
|
---|
| 337 |
|
---|
| 338 | long SYS_rt_sigaction(long a, long b, long c) {
|
---|
| 339 | return shell_sigaction((int)a, (const struct sigaction *)b, (struct sigaction *)c);
|
---|
| 340 | }
|
---|
| 341 |
|
---|
| 342 | long SYS_rt_sigprocmask(long a, long b, long c) {
|
---|
| 343 | return shell_sigprocmask((int)a, (const sigset_t *)b, (sigset_t *)c);
|
---|
| 344 | }
|
---|
| 345 |
|
---|
[374] | 346 | long SYS_rt_sigqueueinfo(long a, long b, long c) {
|
---|
| 347 | //int rt_sigqueueinfo(pid_t tgid, int sig, siginfo_t *uinfo)
|
---|
[352] | 348 | return no_implement("rt_sigqueueinfo\n");
|
---|
| 349 | }
|
---|
| 350 |
|
---|
| 351 | long SYS_send(long a, long b, long c, long d) {
|
---|
[364] | 352 | return shell_sendto((int)a, (const void *)b, (size_t)c, (int)d, NULL, 0);
|
---|
[352] | 353 | }
|
---|
| 354 |
|
---|
| 355 | long SYS_sendmsg(long a, long b, long c) {
|
---|
| 356 | return shell_sendmsg((int)a, (const struct msghdr *)b, (size_t)c);
|
---|
| 357 | }
|
---|
| 358 |
|
---|
| 359 | long SYS_sendto(long a, long b, long c, long d, long e, long f) {
|
---|
[364] | 360 | return shell_sendto(a, (const void *)b, (size_t)c, (int)d, (const struct sockaddr *)e, (socklen_t)f);
|
---|
[352] | 361 | }
|
---|
| 362 |
|
---|
| 363 | long SYS_setsockopt(long a, long b, long c, long d, long e) {
|
---|
| 364 | return shell_setsockopt((int)a, (int)b, (int)c, (const void *)d, (socklen_t)e);
|
---|
| 365 | }
|
---|
| 366 |
|
---|
| 367 | long SYS_shutdown(long a, long b) {
|
---|
| 368 | return shell_shutdown((int)a, (int)b);
|
---|
| 369 | }
|
---|
| 370 |
|
---|
[374] | 371 | long SYS_sched_setscheduler(long a, long b, long c) {
|
---|
| 372 | //int sched_setscheduler(pid_t pid, int sched, const struct sched_param *param)
|
---|
[352] | 373 | return no_implement("sched_setscheduler\n");
|
---|
| 374 | }
|
---|
| 375 |
|
---|
[374] | 376 | long SYS_set_robust_list(long a, long b) {
|
---|
| 377 | //long set_robust_list(struct robust_list_head *head, size_t len)
|
---|
[352] | 378 | return no_implement("set_robust_list\n");
|
---|
| 379 | }
|
---|
| 380 |
|
---|
| 381 | #ifdef SYS_set_thread_area
|
---|
| 382 | long SYS_set_thread_area(long a) {
|
---|
| 383 | thread_area = (void *)a;
|
---|
| 384 | return 0;
|
---|
| 385 | }
|
---|
| 386 | #endif
|
---|
| 387 |
|
---|
| 388 | long SYS_set_tid_address(long a) {
|
---|
| 389 | tid_address = (void *)a;
|
---|
| 390 | return 0;
|
---|
| 391 | }
|
---|
| 392 |
|
---|
| 393 | long SYS_socket(long a, long b, long c) {
|
---|
| 394 | return shell_socket((int)a, (int)b, (int)c);
|
---|
| 395 | }
|
---|
| 396 |
|
---|
| 397 | long SYS_stat64(long a, long b) {
|
---|
| 398 | return shell_stat((const char *)a, (struct stat *)b);
|
---|
| 399 | }
|
---|
| 400 |
|
---|
| 401 | long SYS_tkill(long a, long b) {
|
---|
| 402 | return shell_tkill((int)a, (int)b);
|
---|
| 403 | }
|
---|
| 404 |
|
---|
| 405 | long SYS_uname(long a) {
|
---|
| 406 | return shell_uname((struct utsname *)a);
|
---|
| 407 | }
|
---|
| 408 |
|
---|
| 409 | long SYS_unlink(long a) {
|
---|
| 410 | return shell_unlink((const char *)a);
|
---|
| 411 | }
|
---|
| 412 |
|
---|
[374] | 413 | long SYS_utimensat(long a, long b, long c, long d) {
|
---|
| 414 | //int utimensat(int fd, const char *path, const struct timespec times[2], int flags)
|
---|
[352] | 415 | return no_implement("utimensat\n");
|
---|
| 416 | }
|
---|
| 417 |
|
---|
[374] | 418 | long SYS_utimes(long a, long b) {
|
---|
| 419 | //int utimes(const char *path, const struct timeval times[2])
|
---|
[352] | 420 | return no_implement("utimes\n");
|
---|
| 421 | }
|
---|
| 422 |
|
---|
| 423 | long SYS_write(long a, long b, long c) {
|
---|
| 424 | return shell_write((int)a, (const void *)b, (size_t)c);
|
---|
| 425 | }
|
---|
| 426 |
|
---|
| 427 | long SYS_writev(long a, long b, long c) {
|
---|
| 428 | return shell_writev((int)a, (const struct iovec *)b, (size_t)c);
|
---|
| 429 | }
|
---|
| 430 |
|
---|
[374] | 431 | long SYS_dup(long a) {
|
---|
| 432 | //int dup(int fd)
|
---|
[364] | 433 | return no_implement("dup\n");
|
---|
| 434 | }
|
---|
| 435 |
|
---|
[374] | 436 | long SYS_dup2(long a, long b) {
|
---|
| 437 | //int dup2(int old, int new)
|
---|
[364] | 438 | return no_implement("dup2\n");
|
---|
| 439 | }
|
---|
| 440 |
|
---|
[374] | 441 | long SYS_pipe(long a) {
|
---|
| 442 | //int pipe(int fd[2])
|
---|
[364] | 443 | return no_implement("pipe\n");
|
---|
| 444 | }
|
---|
| 445 |
|
---|
[374] | 446 | long SYS_readlink(long a, long b, long c) {
|
---|
| 447 | //ssize_t readlink(const char *restrict path, char *restrict buf, size_t bufsize)
|
---|
[364] | 448 | return no_implement("readlink\n");
|
---|
| 449 | }
|
---|
| 450 |
|
---|
[374] | 451 | long SYS_symlink(long a, long b) {
|
---|
| 452 | //int symlink(const char *existing, const char *new)
|
---|
[364] | 453 | return no_implement("symlink\n");
|
---|
| 454 | }
|
---|
| 455 |
|
---|
[374] | 456 | long SYS_umask(long a) {
|
---|
| 457 | //mode_t umask(mode_t mode)
|
---|
[364] | 458 | return no_implement("umask\n");
|
---|
| 459 | }
|
---|
| 460 |
|
---|
[374] | 461 | long SYS_execve(long a, long b, long c) {
|
---|
| 462 | //int execve(const char *path, char *const argv[], char *const envp[])
|
---|
[364] | 463 | return no_implement("execve\n");
|
---|
| 464 | }
|
---|
| 465 |
|
---|
[374] | 466 | long SYS_fork() {
|
---|
| 467 | //pid_t fork(void)
|
---|
[364] | 468 | return no_implement("fork\n");
|
---|
| 469 | }
|
---|
| 470 |
|
---|
[374] | 471 | long SYS_wait4(long a, long b, long c, long d) {
|
---|
| 472 | //pid_t wait4(pid_t pid, int *status, int options, struct rusage *usage)
|
---|
[364] | 473 | return no_implement("wait4\n");
|
---|
| 474 | }
|
---|
| 475 |
|
---|
[374] | 476 | long SYS_socketpair(long a, long b, long c, long d) {
|
---|
| 477 | //int socketpair(int domain, int type, int protocol, int fd[2])
|
---|
[364] | 478 | return no_implement("socketpair\n");
|
---|
| 479 | }
|
---|
| 480 |
|
---|
[374] | 481 | long SYS_flock(long a, long b) {
|
---|
| 482 | //int flock(int fd, int op)
|
---|
[364] | 483 | return no_implement("flock\n");
|
---|
| 484 | }
|
---|
| 485 |
|
---|
[374] | 486 | long SYS_fchdir()
|
---|
| 487 | {
|
---|
| 488 | return no_implement("fchdir\n");
|
---|
| 489 | }
|
---|
| 490 |
|
---|
| 491 | long SYS_getegid32()
|
---|
| 492 | {
|
---|
| 493 | return no_implement("getegid32\n");
|
---|
| 494 | }
|
---|
| 495 |
|
---|
| 496 | long SYS_geteuid32()
|
---|
| 497 | {
|
---|
| 498 | return no_implement("geteuid32\n");
|
---|
| 499 | }
|
---|
| 500 |
|
---|
| 501 | long SYS_getgid32()
|
---|
| 502 | {
|
---|
| 503 | return no_implement("getgid32\n");
|
---|
| 504 | }
|
---|
| 505 |
|
---|
| 506 | long SYS_pipe2()
|
---|
| 507 | {
|
---|
| 508 | return no_implement("pipe2\n");
|
---|
| 509 | }
|
---|
| 510 |
|
---|
| 511 | long SYS_setgid32()
|
---|
| 512 | {
|
---|
| 513 | return no_implement("setgid32\n");
|
---|
| 514 | }
|
---|
| 515 |
|
---|
| 516 | long SYS_setpgid()
|
---|
| 517 | {
|
---|
| 518 | return no_implement("setpgid\n");
|
---|
| 519 | }
|
---|
| 520 |
|
---|
| 521 | long SYS_setsid()
|
---|
| 522 | {
|
---|
| 523 | return no_implement("setsid\n");
|
---|
| 524 | }
|
---|
| 525 |
|
---|
| 526 | long SYS_setuid32()
|
---|
| 527 | {
|
---|
| 528 | return no_implement("setuid32\n");
|
---|
| 529 | }
|
---|
| 530 |
|
---|
| 531 | long SYS_tgkill()
|
---|
| 532 | {
|
---|
| 533 | return no_implement("tgkill\n");
|
---|
| 534 | }
|
---|
| 535 |
|
---|
| 536 | long SYS_nanosleep(long a, long b) {
|
---|
| 537 | //int nanosleep(const struct timespec *req, struct timespec *rem)
|
---|
| 538 | return no_implement("nanosleep\n");
|
---|
| 539 | }
|
---|
| 540 |
|
---|
| 541 | long SYS_prlimit64(long a, long b, long c, long d) {
|
---|
| 542 | //#define prlimit64 prlimit
|
---|
| 543 | //int prlimit(pid_t pid, int resource, const struct rlimit *new_limit, struct rlimit *old_limit)
|
---|
| 544 | return no_implement("prlimit64\n");
|
---|
| 545 | }
|
---|
| 546 |
|
---|
| 547 | long SYS_sched_getaffinity(long a, long b, long c) {
|
---|
| 548 | //int sched_getaffinity(pid_t tid, size_t size, cpu_set_t *set)
|
---|
| 549 | return no_implement("sched_getaffinity\n");
|
---|
| 550 | }
|
---|
| 551 |
|
---|
| 552 | long SYS_sysinfo(long a) {
|
---|
| 553 | //int sysinfo(struct sysinfo *info)
|
---|
| 554 | return no_implement("sysinfo\n");
|
---|
| 555 | }
|
---|
| 556 |
|
---|
| 557 | long SYS_ugetrlimit(long a, long b) {
|
---|
| 558 | //#define SYS_getrlimit SYS_ugetrlimit
|
---|
| 559 | //int getrlimit(int resource, struct rlimit *rlim)
|
---|
| 560 | return no_implement("ugetrlimit\n");
|
---|
| 561 | }
|
---|
| 562 |
|
---|
[352] | 563 | long ARM_SYS_cacheflush() {
|
---|
| 564 | flash_access_cache_control();
|
---|
| 565 | return 0;
|
---|
| 566 | }
|
---|
| 567 |
|
---|
| 568 | long ARM_SYS_set_tls(long a) {
|
---|
| 569 | thread_area = (void *)a;
|
---|
| 570 | __asm__ __volatile__("mcr p15,0,%0,c13,c0,3" :: "r"(thread_area));
|
---|
| 571 | return 0;
|
---|
| 572 | }
|
---|