Manage objfiles with shared_ptr
[deliverable/binutils-gdb.git] / sim / common / cgen-par.c
index baf9f586464b4fdc9bf9eaa0163b0721d60fd770..6ed5c4e7c4573cd7e9ed3e85de5aaf49798b6104 100644 (file)
@@ -1,22 +1,21 @@
 /* Simulator parallel routines for CGEN simulators (and maybe others).
-   Copyright (C) 1999 Free Software Foundation, Inc.
+   Copyright (C) 1999-2019 Free Software Foundation, Inc.
    Contributed by Cygnus Solutions.
 
 This file is part of the GNU instruction set simulator.
 
 This program is free software; you can redistribute it and/or modify
 it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2, or (at your option)
-any later version.
+the Free Software Foundation; either version 3 of the License, or
+(at your option) any later version.
 
 This program is distributed in the hope that it will be useful,
 but WITHOUT ANY WARRANTY; without even the implied warranty of
 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 GNU General Public License for more details.
 
-You should have received a copy of the GNU General Public License along
-with this program; if not, write to the Free Software Foundation, Inc.,
-59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
+You should have received a copy of the GNU General Public License
+along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
 
 #include "sim-main.h"
 #include "cgen-mem.h"
@@ -93,7 +92,7 @@ void sim_queue_fn_si_write (
   SIM_CPU *cpu,
   void (*write_function)(SIM_CPU *cpu, UINT, USI),
   UINT regno,
-  SI value
+  USI value
 )
 {
   CGEN_WRITE_QUEUE *q = CPU_WRITE_QUEUE (cpu);
@@ -105,6 +104,22 @@ void sim_queue_fn_si_write (
   element->kinds.fn_si_write.value = value;
 }
 
+void sim_queue_fn_sf_write (
+  SIM_CPU *cpu,
+  void (*write_function)(SIM_CPU *cpu, UINT, SF),
+  UINT regno,
+  SF value
+)
+{
+  CGEN_WRITE_QUEUE *q = CPU_WRITE_QUEUE (cpu);
+  CGEN_WRITE_QUEUE_ELEMENT *element = CGEN_WRITE_QUEUE_NEXT (q);
+  element->kind = CGEN_FN_SF_WRITE;
+  element->insn_address = CPU_PC_GET (cpu);
+  element->kinds.fn_sf_write.function = write_function;
+  element->kinds.fn_sf_write.regno = regno;
+  element->kinds.fn_sf_write.value = value;
+}
+
 void sim_queue_fn_di_write (
   SIM_CPU *cpu,
   void (*write_function)(SIM_CPU *cpu, UINT, DI),
@@ -364,6 +379,11 @@ cgen_write_queue_element_execute (SIM_CPU *cpu, CGEN_WRITE_QUEUE_ELEMENT *item)
                                        item->kinds.fn_si_write.regno,
                                        item->kinds.fn_si_write.value);
       break;
+    case CGEN_FN_SF_WRITE:
+      item->kinds.fn_sf_write.function (cpu,
+                                       item->kinds.fn_sf_write.regno,
+                                       item->kinds.fn_sf_write.value);
+      break;
     case CGEN_FN_DI_WRITE:
       item->kinds.fn_di_write.function (cpu,
                                        item->kinds.fn_di_write.regno,
This page took 0.024954 seconds and 4 git commands to generate.