[aarch64] Remove handling of ADR/ADRP from prologue analyzer
[binutils-gdb.git] / sim / cris / traps.c
index f92bb7cdebe2b63d2bac51567ebedc0af2bb679d..8750c4d4e3c65b4d777616cf6367c1faf558eddc 100644 (file)
@@ -1,5 +1,5 @@
 /* CRIS exception, interrupt, and trap (EIT) support
-   Copyright (C) 2004-2021 Free Software Foundation, Inc.
+   Copyright (C) 2004-2022 Free Software Foundation, Inc.
    Contributed by Axis Communications.
 
 This file is part of the GNU simulators.
@@ -803,7 +803,7 @@ dump_statistics (SIM_CPU *current_cpu)
   SIM_DESC sd = CPU_STATE (current_cpu);
   CRIS_MISC_PROFILE *profp
     = CPU_CRIS_MISC_PROFILE (current_cpu);
-  unsigned64 total = profp->basic_cycle_count;
+  uint64_t total = profp->basic_cycle_count;
 
   /* Historically, these messages have gone to stderr, so we'll keep it
      that way.  It's also easier to then tell it from normal program
@@ -929,8 +929,10 @@ is_mapped_only (SIM_DESC sd ATTRIBUTE_UNUSED,
   return 0;
 }
 
-/* Debug helper; to be run from gdb.  */
+/* Provide a prototype to silence -Wmissing-prototypes.  */
+void cris_dump_map (SIM_CPU *current_cpu);
 
+/* Debug helper; to be run from gdb.  */
 void
 cris_dump_map (SIM_CPU *current_cpu)
 {
@@ -1070,36 +1072,6 @@ sim_engine_invalid_insn (SIM_CPU *current_cpu, IADDR cia, SEM_PC vpc)
   return vpc;
 }
 
-/* Handlers from the CGEN description that should not be called.  */
-
-USI
-cris_bmod_handler (SIM_CPU *current_cpu ATTRIBUTE_UNUSED,
-                  UINT srcreg ATTRIBUTE_UNUSED,
-                  USI dstreg ATTRIBUTE_UNUSED)
-{
-  SIM_DESC sd = CPU_STATE (current_cpu);
-  abort ();
-}
-
-void
-h_supr_set_handler (SIM_CPU *current_cpu ATTRIBUTE_UNUSED,
-                   UINT index ATTRIBUTE_UNUSED,
-                   USI page ATTRIBUTE_UNUSED,
-                   USI newval ATTRIBUTE_UNUSED)
-{
-  SIM_DESC sd = CPU_STATE (current_cpu);
-  abort ();
-}
-
-USI
-h_supr_get_handler (SIM_CPU *current_cpu ATTRIBUTE_UNUSED,
-                   UINT index ATTRIBUTE_UNUSED,
-                   USI page ATTRIBUTE_UNUSED)
-{
-  SIM_DESC sd = CPU_STATE (current_cpu);
-  abort ();
-}
-
 /* Swap one context for another.  */
 
 static void
@@ -1470,8 +1442,8 @@ cris_break_13_handler (SIM_CPU *current_cpu, USI callnum, USI arg1,
       sim_engine_halt (sd, current_cpu, NULL, pc, sim_exited, arg1);
     }
 
-  s.p1 = (PTR) sd;
-  s.p2 = (PTR) current_cpu;
+  s.p1 = sd;
+  s.p2 = current_cpu;
   s.read_mem = sim_syscall_read_mem;
   s.write_mem = sim_syscall_write_mem;
 
@@ -3336,6 +3308,12 @@ cris_time (host_callback *cb ATTRIBUTE_UNUSED)
   return TARGET_TIME (current_cpu_for_cb_callback);
 }
 
+static int
+cris_getpid (host_callback *cb ATTRIBUTE_UNUSED)
+{
+  return TARGET_PID;
+}
+
 /* Set target-specific callback data. */
 
 void
@@ -3345,6 +3323,8 @@ cris_set_callbacks (host_callback *cb)
   cb->syscall_map = (CB_TARGET_DEFS_MAP *) syscall_map;
   cb->errno_map = (CB_TARGET_DEFS_MAP *) errno_map;
 
+  cb->getpid = cris_getpid;
+
   /* The kernel stat64 layout.  If we see a file > 2G, the "long"
      parameter to cb_store_target_endian will make st_size negative.
      Similarly for st_ino.  FIXME: Find a 64-bit type, and use it