diff options
author | Mike Frysinger <vapier@gentoo.org> | 2021-11-01 01:31:44 -0400 |
---|---|---|
committer | Mike Frysinger <vapier@gentoo.org> | 2021-11-28 13:23:57 -0500 |
commit | 64ae70dde5bc8916800bbdb570d6281b700f7e84 (patch) | |
tree | d42650d14607f4ec69b314017afe529077ced46f /sim/README-HACKING | |
parent | 96537189c92734cad48c95de00d3cd167ad7092d (diff) | |
download | fsf-binutils-gdb-64ae70dde5bc8916800bbdb570d6281b700f7e84.zip fsf-binutils-gdb-64ae70dde5bc8916800bbdb570d6281b700f7e84.tar.gz fsf-binutils-gdb-64ae70dde5bc8916800bbdb570d6281b700f7e84.tar.bz2 |
sim: nltvals: pull target syscalls out into a dedicated source file
Like we just did for pulling out the errno map, pull out the syscall
maps into a dedicated common file. Most newlib ports are using the
same syscall map, but not all, which means we have to do a bit more
work to migrate.
This commit adds the maps and switches the ports using the common
default syscall table over to it. Ports using unique syscall tables
are still using the old targ-map.c logic.
Switching common ports over is easy by checking NL_TARGET, but the
ppc code needs a bit more cleanup here hence its larger diff.
Diffstat (limited to 'sim/README-HACKING')
-rw-r--r-- | sim/README-HACKING | 23 |
1 files changed, 6 insertions, 17 deletions
diff --git a/sim/README-HACKING b/sim/README-HACKING index 9bb705e..38915bf 100644 --- a/sim/README-HACKING +++ b/sim/README-HACKING @@ -20,10 +20,7 @@ The common directory contains: - common Makefile fragment and configury (e.g. Make-common.in, aclocal.m4). In addition "common" contains portions of the system call support -(e.g. callback.c, nltvals.def). - -Even though no files are built in this directory, it is still configured -so support for regenerating nltvals.def is present. +(e.g. callback.c, target-newlib-*.c). Common Makefile Support ======================= @@ -161,8 +158,8 @@ internal state pretty printed from gdb. FIXME: This can obviously be made more elaborate. As needed it will be. -Rebuilding nltvals.def -====================== +Rebuilding target-newlib-* files +================================ Checkout a copy of the SIM and LIBGLOSS modules (Unless you've already got one to hand): @@ -191,17 +188,9 @@ all set! If the target has a custom syscall table, you need to declare it: Add your new processor target (you'll need to grub around to find where your syscall.h lives). - devo/sim/<processor>/Makefile.in - - Add the definition: - - ``NL_TARGET = -DNL_TARGET_d10v'' - - just before the line COMMON_POST_CONFIG_FRAG. - devo/sim/<processor>/*.[ch] - Include targ-vals.h instead of syscall.h. + Include target-newlib-syscall.h instead of syscall.h. Tracing ======= @@ -335,8 +324,8 @@ only store the error code when the result is an error. Keep in mind that the CB_SYS_xxx defines are normalized values with no real meaning with respect to the target. They provide a unique map on the host so -that it can parse things sanely. For libgloss, the common/nltvals.def file -creates the target's system call numbers to the CB_SYS_xxx values. +that it can parse things sanely. For libgloss, the common/target-newlib-syscall +file contains the target's system call numbers to the CB_SYS_xxx values. To simulate other userspace targets, you really only need to update the maps pointers that are part of the callback interface. So create CB_TARGET_DEFS_MAP |