This is the mail archive of the gdb-patches@sources.redhat.com mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

[PATCH]: Preliminary support for 68HC12


Hi!

I've comitted the following patch for a first step in supporting 68HC12
in the simulator.

	Stephane

2000-11-26  Stephane Carrez  <Stephane.Carrez@worldnet.fr>

	* dv-m68hc11.c (m68hc11cpu_io_read_buffer): Use attach_size
	instead of a hard-coded value.
	(m68hc11cpu_io_write_buffer): Likewise.
	(dv_m68hc11_descriptor): Define a 68hc12 device.
	* dv-m68hc11eepr.c (dv_m68hc11eepr_descriptor): Likewise.
	* dv-m68hc11tim.c (dv_m68hc11tim_descriptor): Likewise.
	* dv-m68hc11spi.c (dv_m68hc11spi_descriptor): Likewise.
	* dv-m68hc11sio.c (dv_m68hc11sio_descriptor): Likewise.
Index: dv-m68hc11.c
===================================================================
RCS file: /cvs/src/src/sim/m68hc11/dv-m68hc11.c,v
retrieving revision 1.3
diff -p -r1.3 dv-m68hc11.c
*** dv-m68hc11.c	2000/11/26 20:53:11	1.3
--- dv-m68hc11.c	2000/11/26 21:38:18
***************
*** 1,4 ****
! /*  dv-m68hc11.c -- CPU 68HC11 as a device.
      Copyright (C) 1999, 2000 Free Software Foundation, Inc.
      Written by Stephane Carrez (stcarrez@worldnet.fr)
      (From a driver model Contributed by Cygnus Solutions.)
--- 1,4 ----
! /*  dv-m68hc11.c -- CPU 68HC11&68HC12 as a device.
      Copyright (C) 1999, 2000 Free Software Foundation, Inc.
      Written by Stephane Carrez (stcarrez@worldnet.fr)
      (From a driver model Contributed by Cygnus Solutions.)
***************
*** 26,37 ****
  /* DEVICE
  
          m68hc11cpu - m68hc11 cpu virtual device
! 
     
     DESCRIPTION
  
!         Implements the external m68hc11 functionality.  This includes the
!         delivery of of interrupts generated from other devices and the
          handling of device specific registers.
  
  
--- 26,37 ----
  /* DEVICE
  
          m68hc11cpu - m68hc11 cpu virtual device
!         m68hc12cpu - m68hc12 cpu virtual device
     
     DESCRIPTION
  
!         Implements the external m68hc11/68hc12 functionality.  This includes
!         the delivery of of interrupts generated from other devices and the
          handling of device specific registers.
  
  
***************
*** 39,45 ****
  
     reg <base> <size>
  
!         Register base (should be 0x1000 0x03f).
  
     clock <hz>
  
--- 39,45 ----
  
     reg <base> <size>
  
!         Register base (should be 0x1000 0x03f for C11, 0x0000 0x3ff for HC12).
  
     clock <hz>
  
*************** m68hc11cpu_finish (struct hw *me)
*** 272,279 ****
    attach_m68hc11_regs (me, controller);
  }
  
- 
- 
  /* An event arrives on an interrupt port.  */
  
  static void
--- 272,277 ----
*************** m68hc11cpu_io_read_buffer (struct hw *me
*** 442,448 ****
    
    while (nr_bytes)
      {
!       if (base >= 0x3F)
  	break;
  
        memcpy (dest, &cpu->ios[base], 1);
--- 440,446 ----
    
    while (nr_bytes)
      {
!       if (base >= controller->attach_size)
  	break;
  
        memcpy (dest, &cpu->ios[base], 1);
*************** m68hc11cpu_io_write_buffer (struct hw *m
*** 574,580 ****
    while (nr_bytes)
      {
        uint8 val;
!       if (base >= 0x3F)
  	break;
  
        val = *((uint8*) source);
--- 572,578 ----
    while (nr_bytes)
      {
        uint8 val;
!       if (base >= controller->attach_size)
  	break;
  
        val = *((uint8*) source);
*************** m68hc11cpu_io_write_buffer (struct hw *m
*** 588,594 ****
  }
  
  const struct hw_descriptor dv_m68hc11_descriptor[] = {
!   { "m68hc11", m68hc11cpu_finish, },
    { NULL },
  };
  
--- 586,593 ----
  }
  
  const struct hw_descriptor dv_m68hc11_descriptor[] = {
!   { "m68hc11", m68hc11cpu_finish },
!   { "m68hc12", m68hc11cpu_finish },
    { NULL },
  };
  
Index: dv-m68hc11eepr.c
===================================================================
RCS file: /cvs/src/src/sim/m68hc11/dv-m68hc11eepr.c,v
retrieving revision 1.3
diff -p -r1.3 dv-m68hc11eepr.c
*** dv-m68hc11eepr.c	2000/11/24 20:53:35	1.3
--- dv-m68hc11eepr.c	2000/11/26 21:38:19
*************** m68hc11eepr_io_write_buffer (struct hw *
*** 621,627 ****
  }
  
  const struct hw_descriptor dv_m68hc11eepr_descriptor[] = {
!   { "m68hc11eepr", m68hc11eepr_finish, },
    { NULL },
  };
  
--- 621,628 ----
  }
  
  const struct hw_descriptor dv_m68hc11eepr_descriptor[] = {
!   { "m68hc11eepr", m68hc11eepr_finish },
!   { "m68hc12eepr", m68hc11eepr_finish },
    { NULL },
  };
  
Index: dv-m68hc11sio.c
===================================================================
RCS file: /cvs/src/src/sim/m68hc11/dv-m68hc11sio.c,v
retrieving revision 1.3
diff -p -r1.3 dv-m68hc11sio.c
*** dv-m68hc11sio.c	2000/09/09 21:00:39	1.3
--- dv-m68hc11sio.c	2000/11/26 21:38:21
*************** m68hc11sio_io_write_buffer (struct hw *m
*** 657,663 ****
  
  
  const struct hw_descriptor dv_m68hc11sio_descriptor[] = {
!   { "m68hc11sio", m68hc11sio_finish, },
    { NULL },
  };
  
--- 657,664 ----
  
  
  const struct hw_descriptor dv_m68hc11sio_descriptor[] = {
!   { "m68hc11sio", m68hc11sio_finish },
!   { "m68hc12sio", m68hc11sio_finish },
    { NULL },
  };
  
Index: dv-m68hc11spi.c
===================================================================
RCS file: /cvs/src/src/sim/m68hc11/dv-m68hc11spi.c,v
retrieving revision 1.4
diff -p -r1.4 dv-m68hc11spi.c
*** dv-m68hc11spi.c	2000/09/09 21:00:39	1.4
--- dv-m68hc11spi.c	2000/11/26 21:38:21
*************** m68hc11spi_io_write_buffer (struct hw *m
*** 527,533 ****
  
  
  const struct hw_descriptor dv_m68hc11spi_descriptor[] = {
!   { "m68hc11spi", m68hc11spi_finish, },
    { NULL },
  };
  
--- 527,534 ----
  
  
  const struct hw_descriptor dv_m68hc11spi_descriptor[] = {
!   { "m68hc11spi", m68hc11spi_finish },
!   { "m68hc12spi", m68hc11spi_finish },
    { NULL },
  };
  
Index: dv-m68hc11tim.c
===================================================================
RCS file: /cvs/src/src/sim/m68hc11/dv-m68hc11tim.c,v
retrieving revision 1.4
diff -p -r1.4 dv-m68hc11tim.c
*** dv-m68hc11tim.c	2000/09/09 21:00:39	1.4
--- dv-m68hc11tim.c	2000/11/26 21:38:21
*************** attach_m68hc11tim_regs (struct hw *me,
*** 111,117 ****
  		     me);
  }
  
- 
  static void
  m68hc11tim_finish (struct hw *me)
  {
--- 111,116 ----
*************** m68hc11tim_finish (struct hw *me)
*** 128,134 ****
  #else
    me->to_ioctl = m68hc11tim_ioctl;
  #endif
! 
    /* Preset defaults.  */
    controller->clock_prescaler = 1;
    controller->tcnt_adjust = 0;
--- 127,133 ----
  #else
    me->to_ioctl = m68hc11tim_ioctl;
  #endif
!   
    /* Preset defaults.  */
    controller->clock_prescaler = 1;
    controller->tcnt_adjust = 0;
*************** m68hc11tim_io_write_buffer (struct hw *m
*** 688,694 ****
  
  
  const struct hw_descriptor dv_m68hc11tim_descriptor[] = {
!   { "m68hc11tim", m68hc11tim_finish, },
    { NULL },
  };
  
--- 687,694 ----
  
  
  const struct hw_descriptor dv_m68hc11tim_descriptor[] = {
!   { "m68hc11tim", m68hc11tim_finish },
!   { "m68hc12tim", m68hc11tim_finish },
    { NULL },
  };
  

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]