1 /* Target syscall mappings for newlib/libgloss environment.
2 Copyright 1995-2024 Free Software Foundation, Inc.
3 Contributed by Mike Frysinger.
5 This file is part of simulators.
7 This program is free software; you can redistribute it and/or modify
8 it under the terms of the GNU General Public License as published by
9 the Free Software Foundation; either version 3 of the License, or
10 (at your option) any later version.
12 This program is distributed in the hope that it will be useful,
13 but WITHOUT ANY WARRANTY; without even the implied warranty of
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 GNU General Public License for more details.
17 You should have received a copy of the GNU General Public License
18 along with this program. If not, see <http://www.gnu.org/licenses/>. */
20 /* This must come before any other includes. */
23 #include "sim/callback.h"
25 #include "target-newlib-syscall.h"
27 /* This file is kept up-to-date via the gennltvals.py script. Do not edit
28 anything between the START & END comment blocks below. */
30 /* gennltvals: START */
31 CB_TARGET_DEFS_MAP cb_cr16_syscall_map
[] = {
33 { "ARG", CB_SYS_ARG
, TARGET_NEWLIB_CR16_SYS_ARG
},
36 { "chdir", CB_SYS_chdir
, TARGET_NEWLIB_CR16_SYS_chdir
},
39 { "chmod", CB_SYS_chmod
, TARGET_NEWLIB_CR16_SYS_chmod
},
42 { "chown", CB_SYS_chown
, TARGET_NEWLIB_CR16_SYS_chown
},
45 { "close", CB_SYS_close
, TARGET_NEWLIB_CR16_SYS_close
},
48 { "create", CB_SYS_create
, TARGET_NEWLIB_CR16_SYS_create
},
51 { "execv", CB_SYS_execv
, TARGET_NEWLIB_CR16_SYS_execv
},
54 { "execve", CB_SYS_execve
, TARGET_NEWLIB_CR16_SYS_execve
},
57 { "exit", CB_SYS_exit
, TARGET_NEWLIB_CR16_SYS_exit
},
60 { "fork", CB_SYS_fork
, TARGET_NEWLIB_CR16_SYS_fork
},
63 { "fstat", CB_SYS_fstat
, TARGET_NEWLIB_CR16_SYS_fstat
},
66 { "getpid", CB_SYS_getpid
, TARGET_NEWLIB_CR16_SYS_getpid
},
69 { "isatty", CB_SYS_isatty
, TARGET_NEWLIB_CR16_SYS_isatty
},
72 { "kill", CB_SYS_kill
, TARGET_NEWLIB_CR16_SYS_kill
},
75 { "link", CB_SYS_link
, TARGET_NEWLIB_CR16_SYS_link
},
78 { "lseek", CB_SYS_lseek
, TARGET_NEWLIB_CR16_SYS_lseek
},
81 { "mknod", CB_SYS_mknod
, TARGET_NEWLIB_CR16_SYS_mknod
},
84 { "open", CB_SYS_open
, TARGET_NEWLIB_CR16_SYS_open
},
87 { "pipe", CB_SYS_pipe
, TARGET_NEWLIB_CR16_SYS_pipe
},
90 { "read", CB_SYS_read
, TARGET_NEWLIB_CR16_SYS_read
},
93 { "rename", CB_SYS_rename
, TARGET_NEWLIB_CR16_SYS_rename
},
96 { "stat", CB_SYS_stat
, TARGET_NEWLIB_CR16_SYS_stat
},
99 { "time", CB_SYS_time
, TARGET_NEWLIB_CR16_SYS_time
},
102 { "unlink", CB_SYS_unlink
, TARGET_NEWLIB_CR16_SYS_unlink
},
105 { "utime", CB_SYS_utime
, TARGET_NEWLIB_CR16_SYS_utime
},
108 { "wait", CB_SYS_wait
, TARGET_NEWLIB_CR16_SYS_wait
},
111 { "wait4", CB_SYS_wait4
, TARGET_NEWLIB_CR16_SYS_wait4
},
114 { "write", CB_SYS_write
, TARGET_NEWLIB_CR16_SYS_write
},
119 CB_TARGET_DEFS_MAP cb_d10v_syscall_map
[] = {
121 { "ARG", CB_SYS_ARG
, TARGET_NEWLIB_D10V_SYS_ARG
},
124 { "chdir", CB_SYS_chdir
, TARGET_NEWLIB_D10V_SYS_chdir
},
127 { "chmod", CB_SYS_chmod
, TARGET_NEWLIB_D10V_SYS_chmod
},
130 { "chown", CB_SYS_chown
, TARGET_NEWLIB_D10V_SYS_chown
},
133 { "close", CB_SYS_close
, TARGET_NEWLIB_D10V_SYS_close
},
136 { "creat", CB_SYS_creat
, TARGET_NEWLIB_D10V_SYS_creat
},
139 { "execv", CB_SYS_execv
, TARGET_NEWLIB_D10V_SYS_execv
},
142 { "execve", CB_SYS_execve
, TARGET_NEWLIB_D10V_SYS_execve
},
145 { "exit", CB_SYS_exit
, TARGET_NEWLIB_D10V_SYS_exit
},
148 { "fork", CB_SYS_fork
, TARGET_NEWLIB_D10V_SYS_fork
},
151 { "fstat", CB_SYS_fstat
, TARGET_NEWLIB_D10V_SYS_fstat
},
154 { "getpid", CB_SYS_getpid
, TARGET_NEWLIB_D10V_SYS_getpid
},
157 { "isatty", CB_SYS_isatty
, TARGET_NEWLIB_D10V_SYS_isatty
},
160 { "kill", CB_SYS_kill
, TARGET_NEWLIB_D10V_SYS_kill
},
163 { "link", CB_SYS_link
, TARGET_NEWLIB_D10V_SYS_link
},
166 { "lseek", CB_SYS_lseek
, TARGET_NEWLIB_D10V_SYS_lseek
},
169 { "mknod", CB_SYS_mknod
, TARGET_NEWLIB_D10V_SYS_mknod
},
172 { "open", CB_SYS_open
, TARGET_NEWLIB_D10V_SYS_open
},
175 { "pipe", CB_SYS_pipe
, TARGET_NEWLIB_D10V_SYS_pipe
},
178 { "read", CB_SYS_read
, TARGET_NEWLIB_D10V_SYS_read
},
181 { "stat", CB_SYS_stat
, TARGET_NEWLIB_D10V_SYS_stat
},
184 { "time", CB_SYS_time
, TARGET_NEWLIB_D10V_SYS_time
},
187 { "unlink", CB_SYS_unlink
, TARGET_NEWLIB_D10V_SYS_unlink
},
190 { "utime", CB_SYS_utime
, TARGET_NEWLIB_D10V_SYS_utime
},
193 { "wait", CB_SYS_wait
, TARGET_NEWLIB_D10V_SYS_wait
},
196 { "wait4", CB_SYS_wait4
, TARGET_NEWLIB_D10V_SYS_wait4
},
199 { "write", CB_SYS_write
, TARGET_NEWLIB_D10V_SYS_write
},
204 CB_TARGET_DEFS_MAP cb_mcore_syscall_map
[] = {
206 { "access", CB_SYS_access
, TARGET_NEWLIB_MCORE_SYS_access
},
209 { "close", CB_SYS_close
, TARGET_NEWLIB_MCORE_SYS_close
},
212 { "creat", CB_SYS_creat
, TARGET_NEWLIB_MCORE_SYS_creat
},
215 { "link", CB_SYS_link
, TARGET_NEWLIB_MCORE_SYS_link
},
218 { "lseek", CB_SYS_lseek
, TARGET_NEWLIB_MCORE_SYS_lseek
},
221 { "open", CB_SYS_open
, TARGET_NEWLIB_MCORE_SYS_open
},
224 { "read", CB_SYS_read
, TARGET_NEWLIB_MCORE_SYS_read
},
227 { "time", CB_SYS_time
, TARGET_NEWLIB_MCORE_SYS_time
},
230 { "times", CB_SYS_times
, TARGET_NEWLIB_MCORE_SYS_times
},
233 { "unlink", CB_SYS_unlink
, TARGET_NEWLIB_MCORE_SYS_unlink
},
236 { "write", CB_SYS_write
, TARGET_NEWLIB_MCORE_SYS_write
},
241 CB_TARGET_DEFS_MAP cb_riscv_syscall_map
[] = {
243 { "access", CB_SYS_access
, TARGET_NEWLIB_RISCV_SYS_access
},
246 { "brk", CB_SYS_brk
, TARGET_NEWLIB_RISCV_SYS_brk
},
249 { "chdir", CB_SYS_chdir
, TARGET_NEWLIB_RISCV_SYS_chdir
},
251 #ifdef CB_SYS_clock_gettime64
252 { "clock_gettime64", CB_SYS_clock_gettime64
, TARGET_NEWLIB_RISCV_SYS_clock_gettime64
},
255 { "close", CB_SYS_close
, TARGET_NEWLIB_RISCV_SYS_close
},
258 { "dup", CB_SYS_dup
, TARGET_NEWLIB_RISCV_SYS_dup
},
261 { "exit", CB_SYS_exit
, TARGET_NEWLIB_RISCV_SYS_exit
},
263 #ifdef CB_SYS_exit_group
264 { "exit_group", CB_SYS_exit_group
, TARGET_NEWLIB_RISCV_SYS_exit_group
},
266 #ifdef CB_SYS_faccessat
267 { "faccessat", CB_SYS_faccessat
, TARGET_NEWLIB_RISCV_SYS_faccessat
},
270 { "fcntl", CB_SYS_fcntl
, TARGET_NEWLIB_RISCV_SYS_fcntl
},
273 { "fstat", CB_SYS_fstat
, TARGET_NEWLIB_RISCV_SYS_fstat
},
275 #ifdef CB_SYS_fstatat
276 { "fstatat", CB_SYS_fstatat
, TARGET_NEWLIB_RISCV_SYS_fstatat
},
279 { "getcwd", CB_SYS_getcwd
, TARGET_NEWLIB_RISCV_SYS_getcwd
},
281 #ifdef CB_SYS_getdents
282 { "getdents", CB_SYS_getdents
, TARGET_NEWLIB_RISCV_SYS_getdents
},
284 #ifdef CB_SYS_getegid
285 { "getegid", CB_SYS_getegid
, TARGET_NEWLIB_RISCV_SYS_getegid
},
287 #ifdef CB_SYS_geteuid
288 { "geteuid", CB_SYS_geteuid
, TARGET_NEWLIB_RISCV_SYS_geteuid
},
291 { "getgid", CB_SYS_getgid
, TARGET_NEWLIB_RISCV_SYS_getgid
},
293 #ifdef CB_SYS_getmainvars
294 { "getmainvars", CB_SYS_getmainvars
, TARGET_NEWLIB_RISCV_SYS_getmainvars
},
297 { "getpid", CB_SYS_getpid
, TARGET_NEWLIB_RISCV_SYS_getpid
},
299 #ifdef CB_SYS_gettimeofday
300 { "gettimeofday", CB_SYS_gettimeofday
, TARGET_NEWLIB_RISCV_SYS_gettimeofday
},
303 { "getuid", CB_SYS_getuid
, TARGET_NEWLIB_RISCV_SYS_getuid
},
306 { "kill", CB_SYS_kill
, TARGET_NEWLIB_RISCV_SYS_kill
},
309 { "link", CB_SYS_link
, TARGET_NEWLIB_RISCV_SYS_link
},
312 { "lseek", CB_SYS_lseek
, TARGET_NEWLIB_RISCV_SYS_lseek
},
315 { "lstat", CB_SYS_lstat
, TARGET_NEWLIB_RISCV_SYS_lstat
},
318 { "mkdir", CB_SYS_mkdir
, TARGET_NEWLIB_RISCV_SYS_mkdir
},
321 { "mmap", CB_SYS_mmap
, TARGET_NEWLIB_RISCV_SYS_mmap
},
324 { "mremap", CB_SYS_mremap
, TARGET_NEWLIB_RISCV_SYS_mremap
},
327 { "munmap", CB_SYS_munmap
, TARGET_NEWLIB_RISCV_SYS_munmap
},
330 { "open", CB_SYS_open
, TARGET_NEWLIB_RISCV_SYS_open
},
333 { "openat", CB_SYS_openat
, TARGET_NEWLIB_RISCV_SYS_openat
},
336 { "pread", CB_SYS_pread
, TARGET_NEWLIB_RISCV_SYS_pread
},
339 { "pwrite", CB_SYS_pwrite
, TARGET_NEWLIB_RISCV_SYS_pwrite
},
342 { "read", CB_SYS_read
, TARGET_NEWLIB_RISCV_SYS_read
},
344 #ifdef CB_SYS_rt_sigaction
345 { "rt_sigaction", CB_SYS_rt_sigaction
, TARGET_NEWLIB_RISCV_SYS_rt_sigaction
},
348 { "stat", CB_SYS_stat
, TARGET_NEWLIB_RISCV_SYS_stat
},
351 { "time", CB_SYS_time
, TARGET_NEWLIB_RISCV_SYS_time
},
354 { "times", CB_SYS_times
, TARGET_NEWLIB_RISCV_SYS_times
},
357 { "uname", CB_SYS_uname
, TARGET_NEWLIB_RISCV_SYS_uname
},
360 { "unlink", CB_SYS_unlink
, TARGET_NEWLIB_RISCV_SYS_unlink
},
363 { "write", CB_SYS_write
, TARGET_NEWLIB_RISCV_SYS_write
},
366 { "writev", CB_SYS_writev
, TARGET_NEWLIB_RISCV_SYS_writev
},
371 CB_TARGET_DEFS_MAP cb_sh_syscall_map
[] = {
373 { "ARG", CB_SYS_ARG
, TARGET_NEWLIB_SH_SYS_ARG
},
376 { "argc", CB_SYS_argc
, TARGET_NEWLIB_SH_SYS_argc
},
379 { "argn", CB_SYS_argn
, TARGET_NEWLIB_SH_SYS_argn
},
381 #ifdef CB_SYS_argnlen
382 { "argnlen", CB_SYS_argnlen
, TARGET_NEWLIB_SH_SYS_argnlen
},
385 { "chdir", CB_SYS_chdir
, TARGET_NEWLIB_SH_SYS_chdir
},
388 { "chmod", CB_SYS_chmod
, TARGET_NEWLIB_SH_SYS_chmod
},
391 { "chown", CB_SYS_chown
, TARGET_NEWLIB_SH_SYS_chown
},
394 { "close", CB_SYS_close
, TARGET_NEWLIB_SH_SYS_close
},
397 { "creat", CB_SYS_creat
, TARGET_NEWLIB_SH_SYS_creat
},
400 { "execv", CB_SYS_execv
, TARGET_NEWLIB_SH_SYS_execv
},
403 { "execve", CB_SYS_execve
, TARGET_NEWLIB_SH_SYS_execve
},
406 { "exit", CB_SYS_exit
, TARGET_NEWLIB_SH_SYS_exit
},
409 { "fork", CB_SYS_fork
, TARGET_NEWLIB_SH_SYS_fork
},
412 { "fstat", CB_SYS_fstat
, TARGET_NEWLIB_SH_SYS_fstat
},
414 #ifdef CB_SYS_ftruncate
415 { "ftruncate", CB_SYS_ftruncate
, TARGET_NEWLIB_SH_SYS_ftruncate
},
418 { "getpid", CB_SYS_getpid
, TARGET_NEWLIB_SH_SYS_getpid
},
421 { "isatty", CB_SYS_isatty
, TARGET_NEWLIB_SH_SYS_isatty
},
424 { "link", CB_SYS_link
, TARGET_NEWLIB_SH_SYS_link
},
427 { "lseek", CB_SYS_lseek
, TARGET_NEWLIB_SH_SYS_lseek
},
430 { "mknod", CB_SYS_mknod
, TARGET_NEWLIB_SH_SYS_mknod
},
433 { "open", CB_SYS_open
, TARGET_NEWLIB_SH_SYS_open
},
436 { "pipe", CB_SYS_pipe
, TARGET_NEWLIB_SH_SYS_pipe
},
439 { "read", CB_SYS_read
, TARGET_NEWLIB_SH_SYS_read
},
442 { "stat", CB_SYS_stat
, TARGET_NEWLIB_SH_SYS_stat
},
445 { "time", CB_SYS_time
, TARGET_NEWLIB_SH_SYS_time
},
447 #ifdef CB_SYS_truncate
448 { "truncate", CB_SYS_truncate
, TARGET_NEWLIB_SH_SYS_truncate
},
451 { "unlink", CB_SYS_unlink
, TARGET_NEWLIB_SH_SYS_unlink
},
454 { "utime", CB_SYS_utime
, TARGET_NEWLIB_SH_SYS_utime
},
457 { "wait", CB_SYS_wait
, TARGET_NEWLIB_SH_SYS_wait
},
460 { "wait4", CB_SYS_wait4
, TARGET_NEWLIB_SH_SYS_wait4
},
463 { "write", CB_SYS_write
, TARGET_NEWLIB_SH_SYS_write
},
468 CB_TARGET_DEFS_MAP cb_v850_syscall_map
[] = {
470 { "ARG", CB_SYS_ARG
, TARGET_NEWLIB_V850_SYS_ARG
},
473 { "chdir", CB_SYS_chdir
, TARGET_NEWLIB_V850_SYS_chdir
},
476 { "chmod", CB_SYS_chmod
, TARGET_NEWLIB_V850_SYS_chmod
},
479 { "chown", CB_SYS_chown
, TARGET_NEWLIB_V850_SYS_chown
},
482 { "close", CB_SYS_close
, TARGET_NEWLIB_V850_SYS_close
},
485 { "creat", CB_SYS_creat
, TARGET_NEWLIB_V850_SYS_creat
},
488 { "execv", CB_SYS_execv
, TARGET_NEWLIB_V850_SYS_execv
},
491 { "execve", CB_SYS_execve
, TARGET_NEWLIB_V850_SYS_execve
},
494 { "exit", CB_SYS_exit
, TARGET_NEWLIB_V850_SYS_exit
},
497 { "fork", CB_SYS_fork
, TARGET_NEWLIB_V850_SYS_fork
},
500 { "fstat", CB_SYS_fstat
, TARGET_NEWLIB_V850_SYS_fstat
},
503 { "getpid", CB_SYS_getpid
, TARGET_NEWLIB_V850_SYS_getpid
},
505 #ifdef CB_SYS_gettimeofday
506 { "gettimeofday", CB_SYS_gettimeofday
, TARGET_NEWLIB_V850_SYS_gettimeofday
},
509 { "isatty", CB_SYS_isatty
, TARGET_NEWLIB_V850_SYS_isatty
},
512 { "link", CB_SYS_link
, TARGET_NEWLIB_V850_SYS_link
},
515 { "lseek", CB_SYS_lseek
, TARGET_NEWLIB_V850_SYS_lseek
},
518 { "mknod", CB_SYS_mknod
, TARGET_NEWLIB_V850_SYS_mknod
},
521 { "open", CB_SYS_open
, TARGET_NEWLIB_V850_SYS_open
},
524 { "pipe", CB_SYS_pipe
, TARGET_NEWLIB_V850_SYS_pipe
},
527 { "read", CB_SYS_read
, TARGET_NEWLIB_V850_SYS_read
},
530 { "rename", CB_SYS_rename
, TARGET_NEWLIB_V850_SYS_rename
},
533 { "stat", CB_SYS_stat
, TARGET_NEWLIB_V850_SYS_stat
},
536 { "time", CB_SYS_time
, TARGET_NEWLIB_V850_SYS_time
},
539 { "times", CB_SYS_times
, TARGET_NEWLIB_V850_SYS_times
},
542 { "unlink", CB_SYS_unlink
, TARGET_NEWLIB_V850_SYS_unlink
},
545 { "utime", CB_SYS_utime
, TARGET_NEWLIB_V850_SYS_utime
},
548 { "wait", CB_SYS_wait
, TARGET_NEWLIB_V850_SYS_wait
},
551 { "wait4", CB_SYS_wait4
, TARGET_NEWLIB_V850_SYS_wait4
},
554 { "write", CB_SYS_write
, TARGET_NEWLIB_V850_SYS_write
},
559 CB_TARGET_DEFS_MAP cb_init_syscall_map
[] = {
561 { "argc", CB_SYS_argc
, TARGET_NEWLIB_SYS_argc
},
564 { "argn", CB_SYS_argn
, TARGET_NEWLIB_SYS_argn
},
566 #ifdef CB_SYS_argnlen
567 { "argnlen", CB_SYS_argnlen
, TARGET_NEWLIB_SYS_argnlen
},
570 { "argv", CB_SYS_argv
, TARGET_NEWLIB_SYS_argv
},
572 #ifdef CB_SYS_argvlen
573 { "argvlen", CB_SYS_argvlen
, TARGET_NEWLIB_SYS_argvlen
},
576 { "chdir", CB_SYS_chdir
, TARGET_NEWLIB_SYS_chdir
},
579 { "chmod", CB_SYS_chmod
, TARGET_NEWLIB_SYS_chmod
},
582 { "close", CB_SYS_close
, TARGET_NEWLIB_SYS_close
},
585 { "exit", CB_SYS_exit
, TARGET_NEWLIB_SYS_exit
},
588 { "fstat", CB_SYS_fstat
, TARGET_NEWLIB_SYS_fstat
},
591 { "getpid", CB_SYS_getpid
, TARGET_NEWLIB_SYS_getpid
},
593 #ifdef CB_SYS_gettimeofday
594 { "gettimeofday", CB_SYS_gettimeofday
, TARGET_NEWLIB_SYS_gettimeofday
},
597 { "kill", CB_SYS_kill
, TARGET_NEWLIB_SYS_kill
},
600 { "link", CB_SYS_link
, TARGET_NEWLIB_SYS_link
},
603 { "lseek", CB_SYS_lseek
, TARGET_NEWLIB_SYS_lseek
},
606 { "open", CB_SYS_open
, TARGET_NEWLIB_SYS_open
},
609 { "read", CB_SYS_read
, TARGET_NEWLIB_SYS_read
},
611 #ifdef CB_SYS_reconfig
612 { "reconfig", CB_SYS_reconfig
, TARGET_NEWLIB_SYS_reconfig
},
615 { "stat", CB_SYS_stat
, TARGET_NEWLIB_SYS_stat
},
618 { "time", CB_SYS_time
, TARGET_NEWLIB_SYS_time
},
621 { "times", CB_SYS_times
, TARGET_NEWLIB_SYS_times
},
624 { "unlink", CB_SYS_unlink
, TARGET_NEWLIB_SYS_unlink
},
627 { "utime", CB_SYS_utime
, TARGET_NEWLIB_SYS_utime
},
630 { "write", CB_SYS_write
, TARGET_NEWLIB_SYS_write
},
634 /* gennltvals: END */