mirror of
https://github.com/espressif/binutils-gdb.git
synced 2025-06-22 19:09:31 +08:00
sim: bfin: invert sim_cpu storage
This commit is contained in:
@ -643,8 +643,6 @@ free_state (SIM_DESC sd)
|
|||||||
static void
|
static void
|
||||||
bfin_initialize_cpu (SIM_DESC sd, SIM_CPU *cpu)
|
bfin_initialize_cpu (SIM_DESC sd, SIM_CPU *cpu)
|
||||||
{
|
{
|
||||||
memset (&cpu->state, 0, sizeof (cpu->state));
|
|
||||||
|
|
||||||
PROFILE_TOTAL_INSN_COUNT (CPU_PROFILE_DATA (cpu)) = 0;
|
PROFILE_TOTAL_INSN_COUNT (CPU_PROFILE_DATA (cpu)) = 0;
|
||||||
|
|
||||||
bfin_model_cpu_init (sd, cpu);
|
bfin_model_cpu_init (sd, cpu);
|
||||||
@ -674,7 +672,8 @@ sim_open (SIM_OPEN_KIND kind, host_callback *callback,
|
|||||||
current_target_byte_order = BFD_ENDIAN_LITTLE;
|
current_target_byte_order = BFD_ENDIAN_LITTLE;
|
||||||
|
|
||||||
/* The cpu data is kept in a separately allocated chunk of memory. */
|
/* The cpu data is kept in a separately allocated chunk of memory. */
|
||||||
if (sim_cpu_alloc_all (sd, 1) != SIM_RC_OK)
|
if (sim_cpu_alloc_all_extra (sd, 1, sizeof (struct bfin_cpu_state))
|
||||||
|
!= SIM_RC_OK)
|
||||||
{
|
{
|
||||||
free_state (sd);
|
free_state (sd);
|
||||||
return 0;
|
return 0;
|
||||||
|
@ -21,6 +21,8 @@
|
|||||||
#ifndef _BFIN_MAIN_SIM_H_
|
#ifndef _BFIN_MAIN_SIM_H_
|
||||||
#define _BFIN_MAIN_SIM_H_
|
#define _BFIN_MAIN_SIM_H_
|
||||||
|
|
||||||
|
#define SIM_HAVE_COMMON_SIM_CPU
|
||||||
|
|
||||||
#include "sim-basics.h"
|
#include "sim-basics.h"
|
||||||
#include "arch.h"
|
#include "arch.h"
|
||||||
#include "sim-base.h"
|
#include "sim-base.h"
|
||||||
@ -29,13 +31,7 @@
|
|||||||
|
|
||||||
#include "machs.h"
|
#include "machs.h"
|
||||||
|
|
||||||
struct _sim_cpu {
|
#define BFIN_CPU_STATE (*(struct bfin_cpu_state *) CPU_ARCH_DATA (cpu))
|
||||||
/* ... simulator specific members ... */
|
|
||||||
struct bfin_cpu_state state;
|
|
||||||
sim_cpu_base base;
|
|
||||||
};
|
|
||||||
#define BFIN_CPU_STATE ((cpu)->state)
|
|
||||||
|
|
||||||
#define STATE_BOARD_DATA(sd) ((struct bfin_board_data *) STATE_ARCH_DATA (sd))
|
#define STATE_BOARD_DATA(sd) ((struct bfin_board_data *) STATE_ARCH_DATA (sd))
|
||||||
|
|
||||||
#include "sim-config.h"
|
#include "sim-config.h"
|
||||||
|
Reference in New Issue
Block a user