sim: ppc: inline common sim-fpu.c logic
[binutils-gdb.git] / sim / cris / sim-if.c
index c183856fa4c8ae929a24ecc3075cc656c2c70d7a..2d7e9221505ab82e012bd510d8ccb37e34428f7e 100644 (file)
@@ -32,6 +32,7 @@ along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
 #include <errno.h>
 #include <unistd.h>
 #include "sim-options.h"
+#include "sim-hw.h"
 #include "dis-asm.h"
 #include "environ.h"
 
@@ -478,7 +479,7 @@ aux_ent_entry (struct bfd *ebfd)
    interp_load_addr offset.  */
 
 static int
-cris_write_interp (SIM_DESC sd, SIM_ADDR mem, unsigned char *buf, int length)
+cris_write_interp (SIM_DESC sd, SIM_ADDR mem, const unsigned char *buf, int length)
 {
   return sim_write (sd, mem + interp_load_addr, buf, length);
 }
@@ -607,6 +608,8 @@ cris_handle_interpreter (SIM_DESC sd, struct bfd *abfd)
   return ok;
 }
 
+extern const SIM_MACH * const cris_sim_machs[];
+
 /* Create an instance of the simulator.  */
 
 SIM_DESC
@@ -655,6 +658,8 @@ sim_open (SIM_OPEN_KIND kind, host_callback *callback, struct bfd *abfd,
   bfd_byte sp_init[4] = {0, 0, 0, 0};
 
   /* Set default options before parsing user options.  */
+  STATE_MACHS (sd) = cris_sim_machs;
+  STATE_MODEL_NAME (sd) = "crisv32";
   current_target_byte_order = BFD_ENDIAN_LITTLE;
 
   /* The cpu data is kept in a separately allocated chunk of memory.  */
@@ -917,7 +922,7 @@ sim_open (SIM_OPEN_KIND kind, host_callback *callback, struct bfd *abfd,
        CPU_CRIS_MISC_PROFILE (cpu)->flags = STATE_TRACE_FLAGS (sd)[0];
 
        /* Set SP to the stack we allocated above.  */
-       (* CPU_REG_STORE (cpu)) (cpu, H_GR_SP, (char *) sp_init, 4);
+       (* CPU_REG_STORE (cpu)) (cpu, H_GR_SP, (unsigned char *) sp_init, 4);
 
        /* Set the simulator environment data.  */
        cpu->highest_mmapped_page = NULL;