+2021-04-18 Mike Frysinger <vapier@gentoo.org>
+
+ * gennltvals.py (TARGETS): Add iq2000.
+ * nltvals.def: Regenerate.
+
2021-04-18 Mike Frysinger <vapier@gentoo.org>
* syscall.c (cb_syscall): Implement CB_SYS_getpid.
'fr30',
'frv',
'i960',
+ 'iq2000',
'lm32',
'm32r',
'mcore',
/* end i960 sys target macros */
#endif
#endif
+#ifdef NL_TARGET_iq2000
+#ifdef sys_defs
+/* from syscall.h */
+/* begin iq2000 sys target macros */
+ { "SYS_argc", 22 },
+ { "SYS_argn", 24 },
+ { "SYS_argnlen", 23 },
+ { "SYS_argv", 13 },
+ { "SYS_argvlen", 12 },
+ { "SYS_chdir", 14 },
+ { "SYS_chmod", 16 },
+ { "SYS_close", 3 },
+ { "SYS_exit", 1 },
+ { "SYS_fstat", 10 },
+ { "SYS_getpid", 8 },
+ { "SYS_gettimeofday", 19 },
+ { "SYS_kill", 9 },
+ { "SYS_link", 21 },
+ { "SYS_lseek", 6 },
+ { "SYS_open", 2 },
+ { "SYS_read", 4 },
+ { "SYS_reconfig", 25 },
+ { "SYS_stat", 15 },
+ { "SYS_time", 18 },
+ { "SYS_times", 20 },
+ { "SYS_unlink", 7 },
+ { "SYS_utime", 17 },
+ { "SYS_write", 5 },
+/* end iq2000 sys target macros */
+#endif
+#endif
#ifdef NL_TARGET_lm32
#ifdef sys_defs
/* from syscall.h */
{ "SYS_access", 1033 },
{ "SYS_brk", 214 },
{ "SYS_chdir", 49 },
+ { "SYS_clock_gettime64", 403 },
{ "SYS_close", 57 },
{ "SYS_dup", 23 },
{ "SYS_exit", 93 },
+2021-04-18 Mike Frysinger <vapier@gentoo.org>
+
+ * Makefile.in (NL_TARGET): Define.
+ * iq2000.c: Include targ-vals.h.
+ (libgloss_syscall): Delete.
+ (do_syscall): Add TARGET_ prefix to all SYS_ constants.
+
2021-04-18 Mike Frysinger <vapier@gentoo.org>
* configure: Regenerate.
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
+# This selects the newlib/libgloss syscall definitions.
+NL_TARGET = -DNL_TARGET_iq2000
+
## COMMON_PRE_CONFIG_FRAG
IQ2000_OBJS = iq2000.o cpu.o decode.o sem.o model.o mloop.o
#include "sim-main.h"
#include "cgen-mem.h"
#include "cgen-ops.h"
+#include "targ-vals.h"
#include <stdlib.h>
enum
PC_REGNUM = 32
};
-enum libgloss_syscall
-{
- SYS_exit = 1,
- SYS_open = 2,
- SYS_close = 3,
- SYS_read = 4,
- SYS_write = 5,
- SYS_lseek = 6,
- SYS_unlink = 7,
- SYS_getpid = 8,
- SYS_kill = 9,
- SYS_fstat = 10,
- SYS_argvlen = 12,
- SYS_argv = 13,
- SYS_chdir = 14,
- SYS_stat = 15,
- SYS_chmod = 16,
- SYS_utime = 17,
- SYS_time = 18,
- SYS_gettimeofday = 19,
- SYS_times = 20
-};
-
/* Read a null terminated string from memory, return in a buffer */
static char *
fetch_str (SIM_CPU *current_cpu, PCADDR pc, DI addr)
exit (1);
}
- case SYS_write:
+ case TARGET_SYS_write:
buf = zalloc (PARM3);
sim_read (CPU_STATE (current_cpu), CPU2DATA(PARM2), buf, PARM3);
SET_H_GR (ret_reg,
free (buf);
break;
- case SYS_lseek:
+ case TARGET_SYS_lseek:
SET_H_GR (ret_reg,
sim_io_lseek (CPU_STATE (current_cpu),
PARM1, PARM2, PARM3));
break;
- case SYS_exit:
+ case TARGET_SYS_exit:
sim_engine_halt (CPU_STATE (current_cpu), current_cpu,
NULL, pc, sim_exited, PARM1);
break;
- case SYS_read:
+ case TARGET_SYS_read:
buf = zalloc (PARM3);
SET_H_GR (ret_reg,
sim_io_read (CPU_STATE (current_cpu),
free (buf);
break;
- case SYS_open:
+ case TARGET_SYS_open:
buf = fetch_str (current_cpu, pc, PARM1);
SET_H_GR (ret_reg,
sim_io_open (CPU_STATE (current_cpu),
free (buf);
break;
- case SYS_close:
+ case TARGET_SYS_close:
SET_H_GR (ret_reg,
sim_io_close (CPU_STATE (current_cpu), PARM1));
break;
- case SYS_time:
+ case TARGET_SYS_time:
SET_H_GR (ret_reg, time (0));
break;