Update copyright notices to add year 2010.
[deliverable/binutils-gdb.git] / sim / common / dv-glue.c
index 070b6384be0e67661cea6b7abc474288dd250ff1..40d294f2fcdcb2a4917ec8893ab64ace5ff84fe7 100644 (file)
@@ -1,26 +1,26 @@
-/*  This file is part of the program psim.
-    
-    Copyright (C) 1994-1996,1998 Andrew Cagney <cagney@highland.com.au>
-    
-    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 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.
-    
-    */
-
-
-#include "sim-main.h"
-#include "hw-base.h"
+/* The common simulator framework for GDB, the GNU Debugger.
+
+   Copyright 2002, 2007, 2008, 2009, 2010 Free Software Foundation, Inc.
+
+   Contributed by Andrew Cagney and Red Hat.
+
+   This file is part of GDB.
+
+   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 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, see <http://www.gnu.org/licenses/>.  */
+
+
+#include "hw-main.h"
 
 #ifdef HAVE_STRING_H
 #include <string.h>
@@ -183,9 +183,9 @@ struct hw_glue {
 };
 
 
-static hw_io_read_buffer_callback hw_glue_io_read_buffer;
-static hw_io_write_buffer_callback hw_glue_io_write_buffer;
-static hw_port_event_callback hw_glue_port_event;
+static hw_io_read_buffer_method hw_glue_io_read_buffer;
+static hw_io_write_buffer_method hw_glue_io_write_buffer;
+static hw_port_event_method hw_glue_port_event;
 const static struct hw_port_descriptor hw_glue_ports[];
 
 static void
@@ -219,8 +219,8 @@ hw_glue_finish (struct hw *me)
     if (glue->sizeof_output == 0)
       hw_abort (me, "at least one reg property size must be nonzero");
     if (glue->sizeof_output % sizeof (unsigned_word) != 0)
-      hw_abort (me, "reg property size must be %d aligned",
-               sizeof (unsigned_word));
+      hw_abort (me, "reg property size must be %ld aligned",
+               (long) sizeof (unsigned_word));
     /* and the address */
     hw_unit_address_to_attach_address (hw_parent (me),
                                       &unit.address,
@@ -228,8 +228,8 @@ hw_glue_finish (struct hw *me)
                                       &glue->address,
                                       me);
     if (glue->address % (sizeof (unsigned_word) * max_nr_ports) != 0)
-      hw_abort (me, "reg property address must be %d aligned",
-               sizeof (unsigned_word) * max_nr_ports);
+      hw_abort (me, "reg property address must be %ld aligned",
+               (long) (sizeof (unsigned_word) * max_nr_ports));
     glue->nr_outputs = glue->sizeof_output / sizeof (unsigned_word);
     glue->output = hw_zalloc (me, glue->sizeof_output);
   }
@@ -277,9 +277,7 @@ hw_glue_io_read_buffer (struct hw *me,
                        void *dest,
                        int space,
                        unsigned_word addr,
-                       unsigned nr_bytes,
-                       sim_cpu *cpu,
-                       sim_cia cia)
+                       unsigned nr_bytes)
 {
   struct hw_glue *glue = (struct hw_glue *) hw_data (me);
   int reg = ((addr - glue->address) / sizeof (unsigned_word)) % glue->nr_outputs;
@@ -299,9 +297,7 @@ hw_glue_io_write_buffer (struct hw *me,
                         const void *source,
                         int space,
                         unsigned_word addr,
-                        unsigned nr_bytes,
-                        sim_cpu *cpu,
-                        sim_cia cia)
+                        unsigned nr_bytes)
 {
   struct hw_glue *glue = (struct hw_glue *) hw_data (me);
   int reg = ((addr - glue->address) / sizeof (unsigned_word)) % max_nr_ports;
@@ -312,7 +308,7 @@ hw_glue_io_write_buffer (struct hw *me,
   glue->output[reg] = H2BE_4 (*(unsigned_word*)source);
   HW_TRACE ((me, "write - port %d (0x%lx), level %d",
             reg, (unsigned long) addr, glue->output[reg]));
-  hw_port_event (me, reg, glue->output[reg], cpu, cia);
+  hw_port_event (me, reg, glue->output[reg]);
   return nr_bytes;
 }
 
@@ -321,9 +317,7 @@ hw_glue_port_event (struct hw *me,
                    int my_port,
                    struct hw *source,
                    int source_port,
-                   int level,
-                   sim_cpu *cpu,
-                   sim_cia cia)
+                   int level)
 {
   struct hw_glue *glue = (struct hw_glue *) hw_data (me);
   int i;
@@ -350,7 +344,7 @@ hw_glue_port_event (struct hw *me,
          glue->output[0] &= glue->input[i];
        HW_TRACE ((me, "and - port %d, level %d arrived - output %d",
                   my_port, level, glue->output[0]));
-       hw_port_event (me, 0, glue->output[0], cpu, cia);
+       hw_port_event (me, 0, glue->output[0]);
        break;
       }
     default:
@@ -368,7 +362,7 @@ static const struct hw_port_descriptor hw_glue_ports[] = {
 };
 
 
-const struct hw_device_descriptor dv_glue_descriptor[] = {
+const struct hw_descriptor dv_glue_descriptor[] = {
   { "glue", hw_glue_finish, },
   { "glue-and", hw_glue_finish, },
   { "glue-nand", hw_glue_finish, },
This page took 0.030754 seconds and 4 git commands to generate.