+2015-11-14 Mike Frysinger <vapier@gentoo.org>
+
+ * wrapper.c (sim_close): Delete.
+
2015-07-14 Nick Clifton <nickc@redhat.com>
* armcopro.c: Remove extraneous whitespace.
return sd;
}
-void
-sim_close (SIM_DESC sd ATTRIBUTE_UNUSED,
- int quitting ATTRIBUTE_UNUSED)
-{
- /* Nothing to do. */
-}
-
void
sim_stop_reason (SIM_DESC sd ATTRIBUTE_UNUSED,
enum sim_stop *reason,
+2015-11-14 Mike Frysinger <vapier@gentoo.org>
+
+ * interp.c (sim_close): Delete.
+
2015-06-23 Mike Frysinger <vapier@gentoo.org>
* configure: Regenerate.
return sd;
}
-void
-sim_close (SIM_DESC sd, int quitting)
-{
- sim_module_uninstall (sd);
-}
-
SIM_RC
sim_create_inferior (SIM_DESC sd, struct bfd *abfd, char **argv, char **env)
{
+2015-11-14 Mike Frysinger <vapier@gentoo.org>
+
+ * interp.c (sim_close): Delete.
+
2015-10-11 Mike Frysinger <vapier@gentoo.org>
PR sim/18407
return sd;
}
-void
-sim_close (SIM_DESC sd, int quitting)
-{
- sim_module_uninstall (sd);
-}
-
/* Some utils don't like having a NULL environ. */
static const char * const simple_env[] = { "HOME=/", "PATH=/bin", NULL };
+2015-11-14 Mike Frysinger <vapier@gentoo.org>
+
+ * Make-common.in (SIM_NEW_COMMON_OBJS): Add sim-close.o
+ * sim-close.c: New file.
+
2015-09-25 Andrew Bennett <andrew.bennett@imgtec.com>
Ali Lown <ali.lown@imgtec.com>
SIM_NEW_COMMON_OBJS = \
sim-arange.o \
sim-bits.o \
+ sim-close.o \
sim-command.o \
sim-config.o \
sim-core.o \
--- /dev/null
+/* Miscellaneous simulator utilities.
+
+ Copyright (C) 2005-2015 Free Software Foundation, Inc.
+ Contributed by Analog Devices, Inc. and Stephane Carrez.
+
+ This file is part of simulators.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>. */
+
+#include "sim-main.h"
+#include "sim-module.h"
+#include "gdb/remote-sim.h"
+
+/* Generic implementation of sim_close that works with simulators that use
+ sim-module for all custom runtime options. */
+
+#ifndef SIM_CLOSE_HOOK
+# define SIM_CLOSE_HOOK(sd, quitting)
+#endif
+
+void
+sim_close (SIM_DESC sd, int quitting)
+{
+ SIM_CLOSE_HOOK (sd, quitting);
+
+ /* If cgen is active, close it down. */
+#ifdef CGEN_ARCH
+# define __cgen_cpu_close(arch) arch##_cgen_cpu_close
+# define _cgen_cpu_close(arch) __cgen_cpu_close (arch)
+# define cgen_cpu_close _cgen_cpu_close (CGEN_ARCH)
+ cgen_cpu_close (CPU_CPU_DESC (STATE_CPU (sd, 0)));
+#endif
+
+ /* Shut down all registered/active modules. */
+ sim_module_uninstall (sd);
+
+ /* Ensure that any resources allocated through the callback
+ mechanism are released. */
+ sim_io_shutdown (sd);
+
+ /* Break down all of the cpus. */
+ sim_cpu_free_all (sd);
+
+ /* Finally break down the sim state itself. */
+ sim_state_free (sd);
+}
+2015-11-14 Mike Frysinger <vapier@gentoo.org>
+
+ * interp.c (sim_close): Delete.
+
2015-11-10 Mike Frysinger <vapier@gentoo.org>
* interp.c (sim_cr16_translate_dmap_addr): Mark static.
return sd;
}
-
-void
-sim_close (SIM_DESC sd, int quitting)
-{
- /* Nothing to do. */
-}
-
uint8 *
dmem_addr (uint32 offset)
{
+2015-11-14 Mike Frysinger <vapier@gentoo.org>
+
+ * sim-if.c (sim_close): Delete.
+
2015-06-23 Mike Frysinger <vapier@gentoo.org>
* configure: Regenerate.
return sd;
}
-
-void
-sim_close (SIM_DESC sd, int quitting ATTRIBUTE_UNUSED)
-{
- cris_cgen_cpu_close (CPU_CPU_DESC (STATE_CPU (sd, 0)));
- sim_module_uninstall (sd);
-}
\f
SIM_RC
sim_create_inferior (SIM_DESC sd, struct bfd *abfd,
+2015-11-14 Mike Frysinger <vapier@gentoo.org>
+
+ * interp.c (sim_close): Delete.
+
2015-11-10 Mike Frysinger <vapier@gentoo.org>
* interp.c (sim_d10v_translate_dmap_addr): Mark static.
return sd;
}
-
-void
-sim_close (SIM_DESC sd, int quitting)
-{
- /* Nothing to do. */
-}
-
uint8 *
dmem_addr (uint16 offset)
{
+2015-11-14 Mike Frysinger <vapier@gentoo.org>
+
+ * interp.c (sim_close): Rename to ...
+ (frv_sim_close): ... this. Delete calls to frv_cgen_cpu_close and
+ sim_module_uninstall.
+ * sim-main.h (frv_sim_close): Declare.
+ (SIM_CLOSE_HOOK): Define.
+
2015-06-23 Mike Frysinger <vapier@gentoo.org>
* configure.ac (AC_ARG_ENABLE(sim-trapdump)): Call AS_HELP_STRING.
}
void
-sim_close (sd, quitting)
+frv_sim_close (sd, quitting)
SIM_DESC sd;
int quitting;
{
frv_cache_term (CPU_INSN_CACHE (cpu));
frv_cache_term (CPU_DATA_CACHE (cpu));
}
-
- frv_cgen_cpu_close (CPU_CPU_DESC (STATE_CPU (sd, 0)));
- sim_module_uninstall (sd);
}
\f
SIM_RC
#include "profile.h"
void frv_sim_engine_halt_hook (SIM_DESC, SIM_CPU *, sim_cia);
+
+extern void frv_sim_close (SIM_DESC sd, int quitting);
+#define SIM_CLOSE_HOOK(...) frv_sim_close (__VA_ARGS__)
\f
/* The _sim_cpu struct. */
+2015-11-14 Mike Frysinger <vapier@gentoo.org>
+
+ * interp.c (sim_close): Delete.
+
2015-09-29 James Bowman <james.bowman@ftdichip.com>
* interp.c (step_once): Correct length for MEMSET and MEMCPY
return sd;
}
-void
-sim_close (SIM_DESC sd, int quitting)
-{
- sim_module_uninstall (sd);
-}
-
SIM_RC
sim_create_inferior (SIM_DESC sd,
struct bfd *abfd,
+2015-11-14 Mike Frysinger <vapier@gentoo.org>
+
+ * compile.c (sim_close): Delete.
+
2015-11-09 Mike Frysinger <vapier@gentoo.org>
* compile.c (littleendian): Delete.
return sd;
}
-void
-sim_close (SIM_DESC sd, int quitting)
-{
- /* Nothing to do. */
-}
-
/* Called by gdb to load a program into memory. */
SIM_RC
+2015-11-14 Mike Frysinger <vapier@gentoo.org>
+
+ * sim-if.c (sim_close): Delete.
+
2015-06-23 Mike Frysinger <vapier@gentoo.org>
* configure: Regenerate.
return sd;
}
-
-void
-sim_close (sd, quitting)
- SIM_DESC sd;
- int quitting;
-{
- iq2000_cgen_cpu_close (CPU_CPU_DESC (STATE_CPU (sd, 0)));
- sim_module_uninstall (sd);
-}
\f
SIM_RC
sim_create_inferior (sd, abfd, argv, envp)
+2015-11-14 Mike Frysinger <vapier@gentoo.org>
+
+ * sim-if.c (sim_close): Delete.
+
2015-06-23 Mike Frysinger <vapier@gentoo.org>
* configure: Regenerate.
return sd;
}
-
-void
-sim_close (sd, quitting)
- SIM_DESC sd;
- int quitting;
-{
- lm32_cgen_cpu_close (CPU_CPU_DESC (STATE_CPU (sd, 0)));
- sim_module_uninstall (sd);
-}
\f
SIM_RC
sim_create_inferior (sd, abfd, argv, envp)
+2015-11-14 Mike Frysinger <vapier@gentoo.org>
+
+ * sim-if.c (sim_close): Delete.
+
2015-06-23 Mike Frysinger <vapier@gentoo.org>
* configure: Regenerate.
return sd;
}
-
-void
-sim_close (sd, quitting)
- SIM_DESC sd;
- int quitting;
-{
- m32r_cgen_cpu_close (CPU_CPU_DESC (STATE_CPU (sd, 0)));
- sim_module_uninstall (sd);
-}
\f
SIM_RC
sim_create_inferior (sd, abfd, argv, envp)
+2015-11-14 Mike Frysinger <vapier@gentoo.org>
+
+ * interp.c (sim_close): Delete.
+
2015-06-23 Mike Frysinger <vapier@gentoo.org>
* configure: Regenerate.
return sd;
}
-
-void
-sim_close (SIM_DESC sd, int quitting)
-{
- /* shut down modules */
- sim_module_uninstall (sd);
-
- /* Ensure that any resources allocated through the callback
- mechanism are released: */
- sim_io_shutdown (sd);
-
- /* FIXME - free SD */
- sim_state_free (sd);
- return;
-}
-
/* Generic implementation of sim_engine_run that works within the
sim_engine setjmp/longjmp framework. */
+2015-11-14 Mike Frysinger <vapier@gentoo.org>
+
+ * interp.c (sim_close): Delete.
+
2015-06-23 Mike Frysinger <vapier@gentoo.org>
* configure: Regenerate.
return sd;
}
-void
-sim_close (SIM_DESC sd, int quitting)
-{
- /* nothing to do */
-}
-
SIM_RC
sim_create_inferior (SIM_DESC sd, struct bfd *prog_bfd, char **argv, char **env)
{
+2015-11-14 Mike Frysinger <vapier@gentoo.org>
+
+ * interp.c (sim_close): Delete.
+
2015-06-23 Mike Frysinger <vapier@gentoo.org>
* configure: Regenerate.
return sd;
}
-void
-sim_close (SIM_DESC sd, int quitting)
-{
- /* Do nothing. */
-}
-
SIM_RC
sim_create_inferior (SIM_DESC sd, struct bfd *prog_bfd, char **argv, char **env)
{
+2015-11-14 Mike Frysinger <vapier@gentoo.org>
+
+ * interp.c (sim_close): Rename to ...
+ (mips_sim_close): ... this. Delete calls to sim_module_uninstall and
+ sim_io_shutdown.
+ * sim-main.h (mips_sim_close): Declare.
+ (SIM_CLOSE_HOOK): Define.
+
2015-09-25 Andrew Bennett <andrew.bennett@imgtec.com>
Ali Lown <ali.lown@imgtec.com>
}
void
-sim_close (SIM_DESC sd, int quitting)
+mips_sim_close (SIM_DESC sd, int quitting)
{
-#ifdef DEBUG
- printf("DBG: sim_close: entered (quitting = %d)\n",quitting);
-#endif
-
-
- /* "quitting" is non-zero if we cannot hang on errors */
-
- /* shut down modules */
- sim_module_uninstall (sd);
-
- /* Ensure that any resources allocated through the callback
- mechanism are released: */
- sim_io_shutdown (sd);
-
#if WITH_TRACE_ANY_P
if (tracefh != NULL && tracefh != stderr)
fclose(tracefh);
tracefh = NULL;
#endif
-
- /* FIXME - free SD */
-
- return;
}
-
int
sim_write (SIM_DESC sd, SIM_ADDR addr, const unsigned char *buffer, int size)
{
sim_cpu_base base;
};
+extern void mips_sim_close (SIM_DESC sd, int quitting);
+#define SIM_CLOSE_HOOK(...) mips_sim_close (__VA_ARGS__)
/* MIPS specific simulator watch config */
+2015-11-14 Mike Frysinger <vapier@gentoo.org>
+
+ * interp.c (sim_close): Delete.
+
2015-06-23 Mike Frysinger <vapier@gentoo.org>
* configure: Regenerate.
return sd;
}
-
-void
-sim_close (SIM_DESC sd, int quitting)
-{
- sim_module_uninstall (sd);
-}
-
-
SIM_RC
sim_create_inferior (SIM_DESC sd,
struct bfd *prog_bfd,
+2015-11-14 Mike Frysinger <vapier@gentoo.org>
+
+ * interp.c (sim_close): Delete.
+
2015-10-11 Mike Frysinger <vapier@gentoo.org>
PR sim/18273
return sd;
}
-void
-sim_close (SIM_DESC sd, int quitting)
-{
- /* nothing to do */
-}
-
-
/* Load the device tree blob. */
static void
+2015-11-14 Mike Frysinger <vapier@gentoo.org>
+
+ * interp.c (sim_close): Rename to ...
+ (msp430_sim_close): ... this. Delete call to sim_state_free.
+ * sim-main.h (msp430_sim_close): Declare.
+ (SIM_CLOSE_HOOK): Define.
+
2015-06-24 Mike Frysinger <vapier@gentoo.org>
* msp430-sim.c (trace_reg_put): Change TRACE_VPU to TRACE_REGISTER.
}
void
-sim_close (SIM_DESC sd,
- int quitting)
+msp430_sim_close (SIM_DESC sd, int quitting)
{
free (STATE_SYMBOL_TABLE (sd));
- sim_state_free (sd);
}
SIM_RC
#include "sim-engine.h"
#include "sim-options.h"
+extern void msp430_sim_close (SIM_DESC sd, int quitting);
+#define SIM_CLOSE_HOOK(...) msp430_sim_close (__VA_ARGS__)
+
#endif /* _MSP430_MAIN_SIM_H_ */
+2015-11-14 Mike Frysinger <vapier@gentoo.org>
+
+ * interp.c (sim_close): Delete.
+
2015-06-23 Mike Frysinger <vapier@gentoo.org>
* configure: Regenerate.
callback->printf_filtered (callback, "Bad memory size %d; must be 1 to 24, inclusive\n", n);
}
-void
-sim_close (SIM_DESC sd, int quitting)
-{
- /* nothing to do */
-}
-
SIM_RC
sim_create_inferior (SIM_DESC sd, struct bfd *prog_bfd, char **argv, char **env)
{
+2015-11-14 Mike Frysinger <vapier@gentoo.org>
+
+ * sim-if.c (sim_close): Delete.
+
2015-06-23 Mike Frysinger <vapier@gentoo.org>
* configure: Regenerate.
return sd;
}
-
-void
-sim_close (sd, quitting)
- SIM_DESC sd;
- int quitting;
-{
- sh_cgen_cpu_close (CPU_CPU_DESC (STATE_CPU (sd, 0)));
- sim_module_uninstall (sd);
-}
\f
SIM_RC
sim_create_inferior (sd, abfd, argv, envp)
+2015-11-14 Mike Frysinger <vapier@gentoo.org>
+
+ * interp.c (sim_close): Delete.
+
2015-06-23 Mike Frysinger <vapier@gentoo.org>
* configure: Regenerate.
return sd;
}
-
-void
-sim_close (SIM_DESC sd, int quitting)
-{
- sim_module_uninstall (sd);
-}
-
SIM_RC
sim_create_inferior (SIM_DESC sd,
struct bfd * prog_bfd,