sim: make LMA loading the default for all targets

Most targets already default to loading code via their LMA, but for
a few, this means the default changes from loading VMA to LMA.  It's
better to have the different targets be consistent, and allows some
code clean up.
This commit is contained in:
Mike Frysinger 2015-12-24 21:36:09 -05:00
parent 9db2b71908
commit 269362117d
25 changed files with 72 additions and 42 deletions

View File

@ -1,3 +1,7 @@
2015-12-24 Mike Frysinger <vapier@gentoo.org>
* tconfig.h (SIM_HANDLES_LMA): Delete.
2015-11-17 Mike Frysinger <vapier@gentoo.org>
* tconfig.h (WITH_MODULO_MEMORY): Delete.

View File

@ -1,8 +1,5 @@
/* Blackfin target configuration file. -*- C -*- */
/* See sim-hload.c. We properly handle LMA. -- TODO: check this */
#define SIM_HANDLES_LMA 1
/* We use this so that we are passed the requesting CPU for HW acesses.
Common sim core by default sets hw_system_cpu to NULL for WITH_HW. */
#define WITH_DEVICES 1

View File

@ -1,3 +1,9 @@
2015-12-24 Mike Frysinger <vapier@gentoo.org>
* sim-options.c (standard_options): Always enable load-lma and
load-vma options.
(standard_install): Always set STATE_LOAD_AT_LMA_P(sd) to 1.
2015-12-24 Mike Frysinger <vapier@gentoo.org>
* sim-module.c (MODULE_LIST): Delete.

View File

@ -167,18 +167,12 @@ static const OPTION standard_options[] =
'\0', "BFDNAME", "Specify the object-code format for the object files",
standard_option_handler },
#ifdef SIM_HANDLES_LMA
{ {"load-lma", no_argument, NULL, OPTION_LOAD_LMA},
'\0', NULL,
#if SIM_HANDLES_LMA
"Use VMA or LMA addresses when loading image (default LMA)",
#else
"Use VMA or LMA addresses when loading image (default VMA)",
#endif
standard_option_handler, "load-{lma,vma}" },
{ {"load-vma", no_argument, NULL, OPTION_LOAD_VMA},
'\0', NULL, "", standard_option_handler, "" },
#endif
{ {"sysroot", required_argument, NULL, OPTION_SYSROOT},
'\0', "SYSROOT",
@ -423,9 +417,7 @@ standard_install (SIM_DESC sd)
SIM_ASSERT (STATE_MAGIC (sd) == SIM_MAGIC_NUMBER);
if (sim_add_option_table (sd, NULL, standard_options) != SIM_RC_OK)
return SIM_RC_FAIL;
#ifdef SIM_HANDLES_LMA
STATE_LOAD_AT_LMA_P (sd) = SIM_HANDLES_LMA;
#endif
STATE_LOAD_AT_LMA_P (sd) = 1;
return SIM_RC_OK;
}

View File

@ -1,3 +1,7 @@
2015-12-24 Mike Frysinger <vapier@gentoo.org>
* tconfig.h (SIM_HANDLES_LMA): Delete.
2015-11-15 Mike Frysinger <vapier@gentoo.org>
* Makefile.in (SIM_OBJS): Delete sim-reason.o, sim-reg.o, and

View File

@ -24,9 +24,6 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. */
file. I just copied it from m32r, pruned some stuff and added
HAVE_MODEL because it seemed useful. */
/* See sim-hload.c. We properly handle LMA. */
#define SIM_HANDLES_LMA 1
/* For MSPR support. FIXME: revisit. */
#define WITH_DEVICES 1

View File

@ -1,3 +1,7 @@
2015-12-24 Mike Frysinger <vapier@gentoo.org>
* tconfig.h (SIM_HANDLES_LMA): Delete.
2015-12-24 Mike Frysinger <vapier@gentoo.org>
* tconfig.h (SIM_HAVE_BREAKPOINTS, SIM_BREAKPOINT,

View File

@ -1,8 +1,5 @@
/* FRV target configuration file. -*- C -*- */
/* See sim-hload.c. We properly handle LMA. -- TODO: check this */
#define SIM_HANDLES_LMA 1
/* For MSPR support. FIXME: revisit. */
#define WITH_DEVICES 1

View File

@ -1,3 +1,7 @@
2015-12-24 Mike Frysinger <vapier@gentoo.org>
* tconfig.h (SIM_HANDLES_LMA): Delete.
2015-12-24 Mike Frysinger <vapier@gentoo.org>
* tconfig.h (SIM_HAVE_BREAKPOINTS, SIM_BREAKPOINT,

View File

@ -1,8 +1,5 @@
/* IQ2000 target configuration file. -*- C -*- */
/* See sim-hload.c. We properly handle LMA. -- TODO: check this */
#define SIM_HANDLES_LMA 1
/* For MSPR support. FIXME: revisit. */
#define WITH_DEVICES 0

View File

@ -1,3 +1,7 @@
2015-12-24 Mike Frysinger <vapier@gentoo.org>
* tconfig.h (SIM_HANDLES_LMA): Delete.
2015-11-15 Mike Frysinger <vapier@gentoo.org>
* Makefile.in (SIM_OBJS): Delete sim-reason.o, sim-reg.o, and

View File

@ -19,9 +19,6 @@
#ifndef LM32_TCONFIG_H
#define LM32_TCONFIG_H
/* See sim-hload.c. We properly handle LMA. */
#define SIM_HANDLES_LMA 1
#define WITH_SCACHE_PBB 1
#endif /* LM32_TCONFIG_H */

View File

@ -1,3 +1,7 @@
2015-12-24 Mike Frysinger <vapier@gentoo.org>
* tconfig.h (SIM_HANDLES_LMA): Delete.
2015-12-24 Mike Frysinger <vapier@gentoo.org>
* tconfig.h (SIM_HAVE_BREAKPOINTS, SIM_BREAKPOINT,

View File

@ -3,9 +3,6 @@
#ifndef M32R_TCONFIG_H
#define M32R_TCONFIG_H
/* See sim-hload.c. We properly handle LMA. */
#define SIM_HANDLES_LMA 1
/* For MSPR support. FIXME: revisit. */
#define WITH_DEVICES 1

View File

@ -1,3 +1,7 @@
2015-12-24 Mike Frysinger <vapier@gentoo.org>
* sim-main.h (SIM_HANDLES_LMA): Delete.
2015-12-24 Mike Frysinger <vapier@gentoo.org>
* sim-main.h (WITH_WATCHPOINTS): Delete.

View File

@ -20,8 +20,6 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. */
#ifndef _SIM_MAIN_H
#define _SIM_MAIN_H
#define SIM_HANDLES_LMA 1
#include "sim-basics.h"
#include "sim-signal.h"
#include "sim-base.h"

View File

@ -1,3 +1,7 @@
2015-12-24 Mike Frysinger <vapier@gentoo.org>
* tconfig.h (SIM_HANDLES_LMA): Delete.
2015-12-24 Mike Frysinger <vapier@gentoo.org>
* sim-main.h (WITH_WATCHPOINTS): Delete.

View File

@ -1,11 +1,4 @@
/* mips target configuration file. */
/* See sim-hload.c. We properly handle LMA. */
#ifdef TARGET_TX3904
#define SIM_HANDLES_LMA 1
#else
#define SIM_HANDLES_LMA 0
#endif
/* MIPS uses an unusual format for floating point quiet NaNs. */
#define SIM_QUIET_NAN_NEGATED

View File

@ -1,3 +1,7 @@
2015-12-24 Mike Frysinger <vapier@gentoo.org>
* sim-main.h (SIM_HANDLES_LMA): Delete.
2015-12-24 Mike Frysinger <vapier@gentoo.org>
* sim-main.h (WITH_WATCHPOINTS): Delete.

View File

@ -22,8 +22,6 @@
#ifndef SIM_MAIN_H
#define SIM_MAIN_H
#define SIM_HANDLES_LMA 1
#define SIM_ENGINE_HALT_HOOK(SD,LAST_CPU,CIA) 0 /* disable this hook */
#include "sim-basics.h"

View File

@ -1,3 +1,7 @@
2015-12-24 Mike Frysinger <vapier@gentoo.org>
* tconfig.h (SIM_HANDLES_LMA): Delete.
2015-12-24 Mike Frysinger <vapier@gentoo.org>
* tconfig.h (SIM_HAVE_BREAKPOINTS, SIM_BREAKPOINT,

View File

@ -1,8 +1,5 @@
/* SH64 target configuration file. -*- C -*- */
/* See sim-hload.c. We properly handle LMA. -- TODO: check this */
#define SIM_HANDLES_LMA 1
/* For MSPR support. FIXME: revisit. */
#define WITH_DEVICES 0

View File

@ -1,3 +1,8 @@
2015-12-24 Mike Frysinger <vapier@gentoo.org>
* allinsn.exp: Append --load-vma to global_sim_options.
* misc.exp: Likewise.
2015-03-29 Mike Frysinger <vapier@gentoo.org>
PR sim/12385

View File

@ -1,6 +1,5 @@
# CR16 simulator testsuite.
if [istarget cr16*-*-*] {
# load support procs
# load_lib cgen.exp
@ -8,6 +7,14 @@ if [istarget cr16*-*-*] {
# all machines
set all_machs "cr16"
global global_sim_options
if ![info exists global_sim_options] {
set global_sim_options ""
}
set saved_global_sim_options $global_sim_options
# The cr16 linker sets the default LMA base to 0, and all the code
# expects the VMA when running, so use that when running the tests.
set global_sim_options "$saved_global_sim_options --load-vma"
# The .cgs suffix is for "cgen .s".
foreach src [lsort [glob -nocomplain $srcdir/$subdir/*.cgs]] {
@ -19,4 +26,6 @@ if [istarget cr16*-*-*] {
run_sim_test $src $all_machs
}
set global_sim_options $saved_global_sim_options
}

View File

@ -7,6 +7,14 @@ if [istarget cr16*-*-*] {
# all machines
set all_machs "cr16"
global global_sim_options
if ![info exists global_sim_options] {
set global_sim_options ""
}
set saved_global_sim_options $global_sim_options
# The cr16 linker sets the default LMA base to 0, and all the code
# expects the VMA when running, so use that when running the tests.
set global_sim_options "$saved_global_sim_options --load-vma"
# The .ms suffix is for "miscellaneous .s".
foreach src [lsort [glob -nocomplain $srcdir/$subdir/*.ms]] {
@ -18,4 +26,6 @@ if [istarget cr16*-*-*] {
run_sim_test $src $all_machs
}
set global_sim_options $saved_global_sim_options
}