/* run front end support for arm
- Copyright (C) 1995-2015 Free Software Foundation, Inc.
+ Copyright (C) 1995-2016 Free Software Foundation, Inc.
This file is part of ARM SIM.
int i;
float f;
} upper;
-
+
union
{
int i;
{
ARMul_EmulateInit ();
state = ARMul_NewState ();
- state->bigendSig = (CURRENT_TARGET_BYTE_ORDER == BIG_ENDIAN ? HIGH : LOW);
+ state->bigendSig = (CURRENT_TARGET_BYTE_ORDER == BFD_ENDIAN_BIG ? HIGH : LOW);
ARMul_MemoryInit (state, mem_size);
ARMul_OSInit (state);
state->verbose = 0;
}
}
-ARMword
-ARMul_Debug (ARMul_State * state ATTRIBUTE_UNUSED,
- ARMword pc ATTRIBUTE_UNUSED,
- ARMword instr ATTRIBUTE_UNUSED)
-{
- return 0;
-}
-
int
sim_write (SIM_DESC sd ATTRIBUTE_UNUSED,
SIM_ADDR addr,
}
}
-int
-sim_store_register (SIM_DESC sd ATTRIBUTE_UNUSED,
- int rn,
- unsigned char *memory,
- int length)
+static int
+arm_reg_store (SIM_CPU *cpu, int rn, unsigned char *memory, int length)
{
init ();
return length;
}
-int
-sim_fetch_register (SIM_DESC sd ATTRIBUTE_UNUSED,
- int rn,
- unsigned char *memory,
- int length)
+static int
+arm_reg_fetch (SIM_CPU *cpu, int rn, unsigned char *memory, int length)
{
ARMword regval;
int len = length;
len -= 4;
memory += 4;
regval = 0;
- }
+ }
return length;
}
trace = 1;
continue;
}
-
+
if (strcmp (ptr, "-z") == 0)
{
/* Remove this option from the argv array. */
trace_funcs = 1;
continue;
}
-
+
if (strcmp (ptr, "-d") == 0)
{
/* Remove this option from the argv array. */
for (arg = i; arg < argc; arg ++)
argv[arg] = argv[arg + 1];
argc --;
-
+
ptr = argv[i];
}
else
ptr += sizeof SWI_SWITCH;
swi_mask = 0;
-
+
while (* ptr)
{
int i;
if (* ptr != 0)
fprintf (stderr, "Ignoring swi options: %s\n", ptr);
-
+
/* Remove this option from the argv array. */
for (arg = i; arg < argc; arg ++)
argv[arg] = argv[arg + 1];
static void
sim_target_parse_arg_array (char ** argv)
{
- int i;
-
- for (i = 0; argv[i]; i++)
- ;
-
- sim_target_parse_command_line (i, argv);
+ sim_target_parse_command_line (countargv (argv), argv);
}
static sim_cia
return 0;
}
- /* getopt will print the error message so we just have to exit if this fails.
- FIXME: Hmmm... in the case of gdb we need getopt to call
- print_filtered. */
+ /* The parser will print an error message for us, so we silently return. */
if (sim_parse_args (sd, argv) != SIM_RC_OK)
{
free_state (sd);
{
SIM_CPU *cpu = STATE_CPU (sd, i);
+ CPU_REG_FETCH (cpu) = arm_reg_fetch;
+ CPU_REG_STORE (cpu) = arm_reg_store;
CPU_PC_FETCH (cpu) = arm_pc_get;
CPU_PC_STORE (cpu) = arm_pc_set;
}
"Missing argument to -m option\n");
return NULL;
}
-
}
}
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,