[gdb/testsuite] Add PR number to KFAIL in gdb.opt/inline-cmds.exp
[deliverable/binutils-gdb.git] / sim / m68hc11 / dv-m68hc11sio.c
index df493d642c019a8566b81e618d179c28b24d0015..0a5d97ef02b1f8440041e9c27a17745bae3bd0c5 100644 (file)
@@ -1,5 +1,5 @@
 /*  dv-m68hc11sio.c -- Simulation of the 68HC11 serial device.
-    Copyright (C) 1999, 2000 Free Software Foundation, Inc.
+    Copyright (C) 1999-2020 Free Software Foundation, Inc.
     Written by Stephane Carrez (stcarrez@worldnet.fr)
     (From a driver model Contributed by Cygnus Solutions.)
 
@@ -7,17 +7,16 @@
     
     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
+    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.
+    along with this program.  If not, see <http://www.gnu.org/licenses/>.
     
     */
 
@@ -118,7 +117,7 @@ static void
 attach_m68hc11sio_regs (struct hw *me,
                         struct m68hc11sio *controller)
 {
-  hw_attach_address (hw_parent (me), 0, io_map,
+  hw_attach_address (hw_parent (me), M6811_IO_LEVEL, io_map,
                      M6811_SCI_FIRST_REG,
                      M6811_SCI_LAST_REG - M6811_SCI_FIRST_REG + 1,
                     me);
@@ -143,7 +142,6 @@ m68hc11sio_finish (struct hw *me)
   struct m68hc11sio *controller;
 
   controller = HW_ZALLOC (me, struct m68hc11sio);
-  me->overlap_mode_hw = 1;
   set_hw_data (me, controller);
   set_hw_io_read_buffer (me, m68hc11sio_io_read_buffer);
   set_hw_io_write_buffer (me, m68hc11sio_io_write_buffer);
@@ -242,7 +240,7 @@ m68hc11sio_port_event (struct hw *me,
 }
 
 
-void
+static void
 m68hc11sio_rx_poll (struct hw *me, void *data)
 {
   SIM_DESC sd;
@@ -315,13 +313,12 @@ m68hc11sio_rx_poll (struct hw *me, void *data)
 }
 
 
-void
+static void
 m68hc11sio_tx_poll (struct hw *me, void *data)
 {
   SIM_DESC sd;
   struct m68hc11sio *controller;
   sim_cpu *cpu;
-  int check_interrupt = 0;
   
   controller = hw_data (me);
   sd         = hw_system (me);
@@ -330,13 +327,12 @@ m68hc11sio_tx_poll (struct hw *me, void *data)
   cpu->ios[M6811_SCSR] |= M6811_TDRE;
   cpu->ios[M6811_SCSR] |= M6811_TC;
   
-  /* Transmitter is enabled and we have something to sent.  */
+  /* Transmitter is enabled and we have something to send.  */
   if ((cpu->ios[M6811_SCCR2] & M6811_TE) && controller->tx_has_char)
     {
       cpu->ios[M6811_SCSR] &= ~M6811_TDRE;
       cpu->ios[M6811_SCSR] &= ~M6811_TC;
       controller->tx_has_char = 0;
-      check_interrupt = 1;
       switch (controller->backend)
         {
         case sio_tcp:
@@ -372,8 +368,7 @@ m68hc11sio_tx_poll (struct hw *me, void *data)
                                                            NULL);
     }
 
-  if (check_interrupt)
-      interrupts_update_pending (&cpu->cpu_interrupts);
+  interrupts_update_pending (&cpu->cpu_interrupts);
 }
 
 /* Descriptions of the SIO I/O ports.  These descriptions are only used to
@@ -466,16 +461,17 @@ m68hc11sio_info (struct hw *me)
       t = hw_event_remain_time (me, controller->tx_poll_event);
       n = (clock_cycle - t) / controller->baud_cycle;
       n = controller->data_length - n;
-      sim_io_printf (sd, "  Transmit finished in %ld cycles (%d bit%s)\n",
-                    (long) t, n, (n > 1 ? "s" : ""));
+      sim_io_printf (sd, "  Transmit finished in %s (%d bit%s)\n",
+                    cycle_to_string (cpu, t, PRINT_TIME | PRINT_CYCLE),
+                     n, (n > 1 ? "s" : ""));
     }
   if (controller->rx_poll_event)
     {
       signed64 t;
 
       t = hw_event_remain_time (me, controller->rx_poll_event);
-      sim_io_printf (sd, "  Receive finished in %ld cycles\n",
-                    (long) t);
+      sim_io_printf (sd, "  Receive finished in %s\n",
+                    cycle_to_string (cpu, t, PRINT_TIME | PRINT_CYCLE));
     }
   
 }
@@ -658,7 +654,8 @@ m68hc11sio_io_write_buffer (struct hw *me,
 
 
 const struct hw_descriptor dv_m68hc11sio_descriptor[] = {
-  { "m68hc11sio", m68hc11sio_finish, },
+  { "m68hc11sio", m68hc11sio_finish },
+  { "m68hc12sio", m68hc11sio_finish },
   { NULL },
 };
 
This page took 0.025677 seconds and 4 git commands to generate.