sim: cgen: move cgen_cpu_max_extra_bytes logic into the common code

Every arch handles this the same way, so move it to the common code.
This will also make unifying the sim_cpu structure easier.
This commit is contained in:
Mike Frysinger 2016-08-12 22:12:41 +08:00
parent 32d715691a
commit d5a71b1131
57 changed files with 156 additions and 35 deletions

View File

@ -1,3 +1,7 @@
2021-04-12 Mike Frysinger <vapier@gentoo.org>
* interp.c (sim_open): Delete 3rd arg to sim_cpu_alloc_all.
2021-04-07 Jim Wilson <jimw@sifive.com>
PR sim/27483

View File

@ -329,7 +329,7 @@ sim_open (SIM_OPEN_KIND kind,
SIM_ASSERT (STATE_MAGIC (sd) == SIM_MAGIC_NUMBER);
/* Perform the initialization steps one by one. */
if (sim_cpu_alloc_all (sd, 1, 0) != SIM_RC_OK
if (sim_cpu_alloc_all (sd, 1) != SIM_RC_OK
|| sim_pre_argv_init (sd, argv[0]) != SIM_RC_OK
|| sim_parse_args (sd, argv) != SIM_RC_OK
|| sim_analyze_program (sd,

View File

@ -1,3 +1,7 @@
2021-04-12 Mike Frysinger <vapier@gentoo.org>
* wrapper.c (sim_open): Delete 3rd arg to sim_cpu_alloc_all.
2021-04-02 Mike Frysinger <vapier@gentoo.org>
* aclocal.m4, configure: Regenerate.

View File

@ -800,7 +800,7 @@ sim_open (SIM_OPEN_KIND kind,
SIM_ASSERT (STATE_MAGIC (sd) == SIM_MAGIC_NUMBER);
/* The cpu data is kept in a separately allocated chunk of memory. */
if (sim_cpu_alloc_all (sd, 1, /*cgen_cpu_max_extra_bytes ()*/0) != SIM_RC_OK)
if (sim_cpu_alloc_all (sd, 1) != SIM_RC_OK)
{
free_state (sd);
return 0;

View File

@ -1,3 +1,7 @@
2021-04-12 Mike Frysinger <vapier@gentoo.org>
* interp.c (sim_open): Delete 3rd arg to sim_cpu_alloc_all.
2021-04-02 Mike Frysinger <vapier@gentoo.org>
* aclocal.m4, configure: Regenerate.

View File

@ -1684,7 +1684,7 @@ sim_open (SIM_OPEN_KIND kind, host_callback *cb,
SIM_ASSERT (STATE_MAGIC (sd) == SIM_MAGIC_NUMBER);
/* The cpu data is kept in a separately allocated chunk of memory. */
if (sim_cpu_alloc_all (sd, 1, /*cgen_cpu_max_extra_bytes ()*/0) != SIM_RC_OK)
if (sim_cpu_alloc_all (sd, 1) != SIM_RC_OK)
{
free_state (sd);
return 0;

View File

@ -1,3 +1,7 @@
2021-04-12 Mike Frysinger <vapier@gentoo.org>
* interp.c (sim_open): Delete 3rd arg to sim_cpu_alloc_all.
2021-04-02 Mike Frysinger <vapier@gentoo.org>
* aclocal.m4, configure: Regenerate.

View File

@ -723,7 +723,7 @@ sim_open (SIM_OPEN_KIND kind, host_callback *callback,
SIM_DESC sd = sim_state_alloc (kind, callback);
/* The cpu data is kept in a separately allocated chunk of memory. */
if (sim_cpu_alloc_all (sd, 1, /*cgen_cpu_max_extra_bytes ()*/0) != SIM_RC_OK)
if (sim_cpu_alloc_all (sd, 1) != SIM_RC_OK)
{
free_state (sd);
return 0;

View File

@ -1,3 +1,7 @@
2021-04-12 Mike Frysinger <vapier@gentoo.org>
* sim-if.c (sim_open): Delete 3rd arg to sim_cpu_alloc_all.
2021-04-08 Tom Tromey <tom@tromey.com>
* bpf.c (bpf_def_model_init): Use new-style declaration.

View File

@ -122,8 +122,7 @@ sim_open (SIM_OPEN_KIND kind,
SIM_DESC sd = sim_state_alloc (kind, callback);
if (sim_cpu_alloc_all (sd, 1, cgen_cpu_max_extra_bytes ())
!= SIM_RC_OK)
if (sim_cpu_alloc_all (sd, 1) != SIM_RC_OK)
goto error;
if (sim_pre_argv_init (sd, argv[0]) != SIM_RC_OK)

View File

@ -1,3 +1,12 @@
2021-04-12 Mike Frysinger <vapier@gentoo.org>
* sim-cpu.c (sim_cpu_alloc_all): Delete 3rd arg. Delete 2nd arg to
sim_cpu_alloc.
(sim_cpu_alloc): Move extra_bytes to local var. Add result of
cgen_cpu_max_extra_bytes.
* sim-cpu.h (sim_cpu_alloc_all): Delete 3rd arg.
(sim_cpu_alloc): Delete 2nd arg.
2021-04-08 Tom Tromey <tom@tromey.com>
* cgen-utils.c (RORQI, ROLQI, RORHI, ROLHI, RORSI, ROLSI): Use

View File

@ -23,17 +23,16 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. */
#include "bfd.h"
/* Allocate space for all cpus in the simulator.
Space for the cpu must currently exist prior to parsing ARGV.
EXTRA_BYTES is additional space to allocate for the sim_cpu struct. */
Space for the cpu must currently exist prior to parsing ARGV. */
/* ??? wip. better solution must wait. */
SIM_RC
sim_cpu_alloc_all (SIM_DESC sd, int ncpus, int extra_bytes)
sim_cpu_alloc_all (SIM_DESC sd, int ncpus)
{
int c;
for (c = 0; c < ncpus; ++c)
STATE_CPU (sd, c) = sim_cpu_alloc (sd, extra_bytes);
STATE_CPU (sd, c) = sim_cpu_alloc (sd);
return SIM_RC_OK;
}
@ -41,8 +40,14 @@ sim_cpu_alloc_all (SIM_DESC sd, int ncpus, int extra_bytes)
EXTRA_BYTES is additional space to allocate for the sim_cpu struct. */
sim_cpu *
sim_cpu_alloc (SIM_DESC sd, int extra_bytes)
sim_cpu_alloc (SIM_DESC sd)
{
int extra_bytes = 0;
#ifdef CGEN_ARCH
extra_bytes += cgen_cpu_max_extra_bytes ();
#endif
return zalloc (sizeof (sim_cpu) + extra_bytes);
}

View File

@ -123,9 +123,9 @@ typedef struct {
} sim_cpu_base;
/* Create all cpus. */
extern SIM_RC sim_cpu_alloc_all (SIM_DESC, int, int);
extern SIM_RC sim_cpu_alloc_all (SIM_DESC, int);
/* Create a cpu. */
extern sim_cpu *sim_cpu_alloc (SIM_DESC, int);
extern sim_cpu *sim_cpu_alloc (SIM_DESC);
/* Release resources held by all cpus. */
extern void sim_cpu_free_all (SIM_DESC);
/* Release resources held by a cpu. */

View File

@ -1,3 +1,7 @@
2021-04-12 Mike Frysinger <vapier@gentoo.org>
* interp.c (sim_open): Delete 3rd arg to sim_cpu_alloc_all.
2021-04-02 Mike Frysinger <vapier@gentoo.org>
* aclocal.m4, configure: Regenerate.

View File

@ -397,7 +397,7 @@ sim_open (SIM_OPEN_KIND kind, struct host_callback_struct *cb,
SIM_ASSERT (STATE_MAGIC (sd) == SIM_MAGIC_NUMBER);
/* The cpu data is kept in a separately allocated chunk of memory. */
if (sim_cpu_alloc_all (sd, 1, /*cgen_cpu_max_extra_bytes ()*/0) != SIM_RC_OK)
if (sim_cpu_alloc_all (sd, 1) != SIM_RC_OK)
{
free_state (sd);
return 0;

View File

@ -1,3 +1,7 @@
2021-04-12 Mike Frysinger <vapier@gentoo.org>
* sim-if.c (sim_open): Delete 3rd arg to sim_cpu_alloc_all.
2021-04-08 Tom Tromey <tom@tromey.com>
* traps.c: Include stdlib.h.

View File

@ -659,7 +659,7 @@ sim_open (SIM_OPEN_KIND kind, host_callback *callback, struct bfd *abfd,
bfd_byte sp_init[4] = {0, 0, 0, 0};
/* The cpu data is kept in a separately allocated chunk of memory. */
if (sim_cpu_alloc_all (sd, 1, cgen_cpu_max_extra_bytes ()) != SIM_RC_OK)
if (sim_cpu_alloc_all (sd, 1) != SIM_RC_OK)
{
free_state (sd);
return 0;

View File

@ -1,3 +1,7 @@
2021-04-12 Mike Frysinger <vapier@gentoo.org>
* interp.c (sim_open): Delete 3rd arg to sim_cpu_alloc_all.
2021-04-02 Mike Frysinger <vapier@gentoo.org>
* aclocal.m4, configure: Regenerate.

View File

@ -751,7 +751,7 @@ sim_open (SIM_OPEN_KIND kind, host_callback *cb,
SIM_ASSERT (STATE_MAGIC (sd) == SIM_MAGIC_NUMBER);
/* The cpu data is kept in a separately allocated chunk of memory. */
if (sim_cpu_alloc_all (sd, 1, /*cgen_cpu_max_extra_bytes ()*/0) != SIM_RC_OK)
if (sim_cpu_alloc_all (sd, 1) != SIM_RC_OK)
{
free_state (sd);
return 0;

View File

@ -1,3 +1,7 @@
2021-04-12 Mike Frysinger <vapier@gentoo.org>
* interp.c (sim_open): Delete 3rd arg to sim_cpu_alloc_all.
2021-04-03 Mike Frysinger <vapier@gentoo.org>
* configure.ac, interp.c, Makefile.in, README, README.arch-spec,

View File

@ -82,7 +82,7 @@ sim_open (SIM_OPEN_KIND kind, host_callback *callback,
SIM_DESC sd = sim_state_alloc (kind, callback);
/* The cpu data is kept in a separately allocated chunk of memory. */
if (sim_cpu_alloc_all (sd, 1, /*cgen_cpu_max_extra_bytes ()*/0) != SIM_RC_OK)
if (sim_cpu_alloc_all (sd, 1) != SIM_RC_OK)
{
free_state (sd);
return 0;

View File

@ -1,3 +1,7 @@
2021-04-12 Mike Frysinger <vapier@gentoo.org>
* sim-if.c (sim_open): Delete 3rd arg to sim_cpu_alloc_all.
2021-04-08 Tom Tromey <tom@tromey.com>
* traps.c: Include stdlib.h.

View File

@ -52,7 +52,7 @@ sim_open (SIM_OPEN_KIND kind, host_callback *callback, bfd *abfd,
SIM_DESC sd = sim_state_alloc (kind, callback);
/* The cpu data is kept in a separately allocated chunk of memory. */
if (sim_cpu_alloc_all (sd, 1, cgen_cpu_max_extra_bytes ()) != SIM_RC_OK)
if (sim_cpu_alloc_all (sd, 1) != SIM_RC_OK)
{
free_state (sd);
return 0;

View File

@ -1,3 +1,7 @@
2021-04-12 Mike Frysinger <vapier@gentoo.org>
* interp.c (sim_open): Delete 3rd arg to sim_cpu_alloc_all.
2021-04-02 Mike Frysinger <vapier@gentoo.org>
* aclocal.m4, configure: Regenerate.

View File

@ -807,7 +807,7 @@ sim_open (SIM_OPEN_KIND kind,
SIM_DESC sd = sim_state_alloc (kind, cb);
/* The cpu data is kept in a separately allocated chunk of memory. */
if (sim_cpu_alloc_all (sd, 1, /*cgen_cpu_max_extra_bytes ()*/0) != SIM_RC_OK)
if (sim_cpu_alloc_all (sd, 1) != SIM_RC_OK)
{
free_state (sd);
return 0;

View File

@ -1,3 +1,7 @@
2021-04-12 Mike Frysinger <vapier@gentoo.org>
* compile.c (sim_open): Delete 3rd arg to sim_cpu_alloc_all.
2021-04-08 Tom Tromey <tom@tromey.com>
* compile.c (init_pointers): Fix sequence point warning.

View File

@ -4659,7 +4659,7 @@ sim_open (SIM_OPEN_KIND kind,
sd = sim_state_alloc (kind, callback);
/* The cpu data is kept in a separately allocated chunk of memory. */
if (sim_cpu_alloc_all (sd, 1, /*cgen_cpu_max_extra_bytes ()*/0) != SIM_RC_OK)
if (sim_cpu_alloc_all (sd, 1) != SIM_RC_OK)
{
free_state (sd);
return 0;

View File

@ -1,3 +1,7 @@
2021-04-12 Mike Frysinger <vapier@gentoo.org>
* sim-if.c (sim_open): Delete 3rd arg to sim_cpu_alloc_all.
2021-04-08 Tom Tromey <tom@tromey.com>
* iq2000.c: Include stdlib.h.

View File

@ -58,7 +58,7 @@ sim_open (SIM_OPEN_KIND kind, host_callback *callback, struct bfd *abfd,
SIM_DESC sd = sim_state_alloc (kind, callback);
/* The cpu data is kept in a separately allocated chunk of memory. */
if (sim_cpu_alloc_all (sd, 1, cgen_cpu_max_extra_bytes ()) != SIM_RC_OK)
if (sim_cpu_alloc_all (sd, 1) != SIM_RC_OK)
{
free_state (sd);
return 0;

View File

@ -1,3 +1,7 @@
2021-04-12 Mike Frysinger <vapier@gentoo.org>
* sim-if.c (sim_open): Delete 3rd arg to sim_cpu_alloc_all.
2021-04-08 Tom Tromey <tom@tromey.com>
* sim-if.c (sim_open, sim_create_inferior): Use new-style

View File

@ -89,7 +89,7 @@ sim_open (SIM_OPEN_KIND kind, host_callback *callback, struct bfd *abfd,
unsigned long base, limit;
/* The cpu data is kept in a separately allocated chunk of memory. */
if (sim_cpu_alloc_all (sd, 1, cgen_cpu_max_extra_bytes ()) != SIM_RC_OK)
if (sim_cpu_alloc_all (sd, 1) != SIM_RC_OK)
{
free_state (sd);
return 0;

View File

@ -1,3 +1,7 @@
2021-04-12 Mike Frysinger <vapier@gentoo.org>
* sim-if.c (sim_open): Delete 3rd arg to sim_cpu_alloc_all.
2021-04-08 Tom Tromey <tom@tromey.com>
* traps.c: Include stdlib.h.

View File

@ -52,7 +52,7 @@ sim_open (SIM_OPEN_KIND kind, host_callback *callback, struct bfd *abfd,
int i;
/* The cpu data is kept in a separately allocated chunk of memory. */
if (sim_cpu_alloc_all (sd, 1, cgen_cpu_max_extra_bytes ()) != SIM_RC_OK)
if (sim_cpu_alloc_all (sd, 1) != SIM_RC_OK)
{
free_state (sd);
return 0;

View File

@ -1,3 +1,7 @@
2021-04-12 Mike Frysinger <vapier@gentoo.org>
* interp.c (sim_open): Delete 3rd arg to sim_cpu_alloc_all.
2021-04-02 Mike Frysinger <vapier@gentoo.org>
* aclocal.m4, configure: Regenerate.

View File

@ -404,7 +404,7 @@ sim_open (SIM_OPEN_KIND kind, host_callback *callback,
SIM_ASSERT (STATE_MAGIC (sd) == SIM_MAGIC_NUMBER);
/* The cpu data is kept in a separately allocated chunk of memory. */
if (sim_cpu_alloc_all (sd, 1, /*cgen_cpu_max_extra_bytes ()*/0) != SIM_RC_OK)
if (sim_cpu_alloc_all (sd, 1) != SIM_RC_OK)
{
free_state (sd);
return 0;

View File

@ -1,3 +1,7 @@
2021-04-12 Mike Frysinger <vapier@gentoo.org>
* interp.c (sim_open): Delete 3rd arg to sim_cpu_alloc_all.
2021-04-02 Mike Frysinger <vapier@gentoo.org>
* aclocal.m4, configure: Regenerate.

View File

@ -1349,7 +1349,7 @@ sim_open (SIM_OPEN_KIND kind, host_callback *cb,
SIM_ASSERT (STATE_MAGIC (sd) == SIM_MAGIC_NUMBER);
/* The cpu data is kept in a separately allocated chunk of memory. */
if (sim_cpu_alloc_all (sd, 1, /*cgen_cpu_max_extra_bytes ()*/0) != SIM_RC_OK)
if (sim_cpu_alloc_all (sd, 1) != SIM_RC_OK)
{
free_state (sd);
return 0;

View File

@ -1,3 +1,7 @@
2021-04-12 Mike Frysinger <vapier@gentoo.org>
* interp.c (sim_open): Delete 3rd arg to sim_cpu_alloc_all.
2021-04-02 Mike Frysinger <vapier@gentoo.org>
* aclocal.m4, configure: Regenerate.

View File

@ -393,7 +393,7 @@ sim_open (SIM_OPEN_KIND kind, host_callback *cb,
SIM_ASSERT (STATE_MAGIC (sd) == SIM_MAGIC_NUMBER);
/* The cpu data is kept in a separately allocated chunk of memory. */
if (sim_cpu_alloc_all (sd, 1, /*cgen_cpu_max_extra_bytes ()*/0) != SIM_RC_OK)
if (sim_cpu_alloc_all (sd, 1) != SIM_RC_OK)
{
free_state (sd);
return 0;

View File

@ -1,3 +1,7 @@
2021-04-12 Mike Frysinger <vapier@gentoo.org>
* interp.c (sim_open): Delete 3rd arg to sim_cpu_alloc_all.
2021-04-08 Simon Marchi <simon.marchi@polymtl.ca>
* Makefile.in: Set ASAN_OPTIONS when running igen.

View File

@ -350,7 +350,7 @@ sim_open (SIM_OPEN_KIND kind, host_callback *cb,
SIM_ASSERT (STATE_MAGIC (sd) == SIM_MAGIC_NUMBER);
/* The cpu data is kept in a separately allocated chunk of memory. */
if (sim_cpu_alloc_all (sd, 1, /*cgen_cpu_max_extra_bytes ()*/0) != SIM_RC_OK)
if (sim_cpu_alloc_all (sd, 1) != SIM_RC_OK)
return 0;
cpu = STATE_CPU (sd, 0); /* FIXME */

View File

@ -1,3 +1,7 @@
2021-04-12 Mike Frysinger <vapier@gentoo.org>
* interp.c (sim_open): Delete 3rd arg to sim_cpu_alloc_all.
2021-04-08 Simon Marchi <simon.marchi@polymtl.ca>
* Makefile.in: Set ASAN_OPTIONS when running igen.

View File

@ -93,7 +93,7 @@ sim_open (SIM_OPEN_KIND kind,
SIM_ASSERT (STATE_MAGIC (sd) == SIM_MAGIC_NUMBER);
/* The cpu data is kept in a separately allocated chunk of memory. */
if (sim_cpu_alloc_all (sd, 1, /*cgen_cpu_max_extra_bytes ()*/0) != SIM_RC_OK)
if (sim_cpu_alloc_all (sd, 1) != SIM_RC_OK)
return 0;
/* for compatibility */

View File

@ -1,3 +1,7 @@
2021-04-12 Mike Frysinger <vapier@gentoo.org>
* interp.c (sim_open): Delete 3rd arg to sim_cpu_alloc_all.
2021-04-08 Luis Machado <luis.machado@linaro.org>
* Makefile.in (moxie-gdb.dtb): Add maintainer mode dependency.

View File

@ -1197,7 +1197,7 @@ sim_open (SIM_OPEN_KIND kind, host_callback *cb,
SIM_ASSERT (STATE_MAGIC (sd) == SIM_MAGIC_NUMBER);
/* The cpu data is kept in a separately allocated chunk of memory. */
if (sim_cpu_alloc_all (sd, 1, /*cgen_cpu_max_extra_bytes ()*/0) != SIM_RC_OK)
if (sim_cpu_alloc_all (sd, 1) != SIM_RC_OK)
{
free_state (sd);
return 0;

View File

@ -1,3 +1,7 @@
2021-04-12 Mike Frysinger <vapier@gentoo.org>
* msp430-sim.c (sim_open): Delete 3rd arg to sim_cpu_alloc_all.
2021-04-02 Mike Frysinger <vapier@gentoo.org>
* aclocal.m4, configure: Regenerate.

View File

@ -110,7 +110,7 @@ sim_open (SIM_OPEN_KIND kind,
/* Initialise the simulator. */
if (sim_cpu_alloc_all (sd, 1, /*cgen_cpu_max_extra_bytes ()*/0) != SIM_RC_OK)
if (sim_cpu_alloc_all (sd, 1) != SIM_RC_OK)
{
sim_state_free (sd);
return 0;

View File

@ -1,3 +1,7 @@
2021-04-12 Mike Frysinger <vapier@gentoo.org>
* sim-if.c (sim_open): Delete 3rd arg to sim_cpu_alloc_all.
2021-04-02 Mike Frysinger <vapier@gentoo.org>
* aclocal.m4, configure: Regenerate.

View File

@ -158,7 +158,7 @@ sim_open (SIM_OPEN_KIND kind, host_callback *callback, struct bfd *abfd,
int i;
/* The cpu data is kept in a separately allocated chunk of memory. */
if (sim_cpu_alloc_all (sd, 1, cgen_cpu_max_extra_bytes ()) != SIM_RC_OK)
if (sim_cpu_alloc_all (sd, 1) != SIM_RC_OK)
{
free_state (sd);
return 0;

View File

@ -1,3 +1,7 @@
2021-04-12 Mike Frysinger <vapier@gentoo.org>
* interp.c (sim_open): Delete 3rd arg to sim_cpu_alloc_all.
2021-04-02 Mike Frysinger <vapier@gentoo.org>
* aclocal.m4, configure: Regenerate.

View File

@ -744,7 +744,7 @@ sim_open (SIM_OPEN_KIND kind, host_callback *cb,
SIM_ASSERT (STATE_MAGIC (sd) == SIM_MAGIC_NUMBER);
/* The cpu data is kept in a separately allocated chunk of memory. */
if (sim_cpu_alloc_all (sd, 1, /*cgen_cpu_max_extra_bytes ()*/0) != SIM_RC_OK)
if (sim_cpu_alloc_all (sd, 1) != SIM_RC_OK)
{
free_state (sd);
return 0;

View File

@ -1,3 +1,7 @@
2021-04-12 Mike Frysinger <vapier@gentoo.org>
* interp.c (sim_open): Delete 3rd arg to sim_cpu_alloc_all.
2021-04-02 Mike Frysinger <vapier@gentoo.org>
* aclocal.m4, configure: Regenerate.

View File

@ -61,7 +61,7 @@ sim_open (SIM_OPEN_KIND kind, host_callback *callback,
SIM_DESC sd = sim_state_alloc (kind, callback);
/* The cpu data is kept in a separately allocated chunk of memory. */
if (sim_cpu_alloc_all (sd, 1, /*cgen_cpu_max_extra_bytes ()*/0) != SIM_RC_OK)
if (sim_cpu_alloc_all (sd, 1) != SIM_RC_OK)
{
free_state (sd);
return 0;

View File

@ -1,3 +1,7 @@
2021-04-12 Mike Frysinger <vapier@gentoo.org>
* interp.c (sim_open): Delete 3rd arg to sim_cpu_alloc_all.
2021-04-02 Mike Frysinger <vapier@gentoo.org>
* aclocal.m4, configure: Regenerate.

View File

@ -2361,7 +2361,7 @@ sim_open (SIM_OPEN_KIND kind, host_callback *cb,
SIM_ASSERT (STATE_MAGIC (sd) == SIM_MAGIC_NUMBER);
/* The cpu data is kept in a separately allocated chunk of memory. */
if (sim_cpu_alloc_all (sd, 1, /*cgen_cpu_max_extra_bytes ()*/0) != SIM_RC_OK)
if (sim_cpu_alloc_all (sd, 1) != SIM_RC_OK)
{
free_state (sd);
return 0;

View File

@ -1,3 +1,7 @@
2021-04-12 Mike Frysinger <vapier@gentoo.org>
* interp.c (sim_open): Delete 3rd arg to sim_cpu_alloc_all.
2021-04-08 Simon Marchi <simon.marchi@polymtl.ca>
* Makefile.in: Set ASAN_OPTIONS when running igen.

View File

@ -195,7 +195,7 @@ sim_open (SIM_OPEN_KIND kind,
SIM_ASSERT (STATE_MAGIC (sd) == SIM_MAGIC_NUMBER);
/* The cpu data is kept in a separately allocated chunk of memory. */
if (sim_cpu_alloc_all (sd, 1, /*cgen_cpu_max_extra_bytes ()*/0) != SIM_RC_OK)
if (sim_cpu_alloc_all (sd, 1) != SIM_RC_OK)
return 0;
/* for compatibility */