[PATCH 02/23] Remove libcpu/mips/clock - unused code

Joel Sherrill joel.sherrill at oarcorp.com
Mon Oct 13 14:18:09 UTC 2014


This code was only referenced for r46xx CPU models. There are
no BSPs currently in the tree with this CPU model. The r46xx
was the original target for the MIPS port and it is likely that
the code has not been used on actual hardware in many years.

All MIPS BSPs successfully built after this was removed.
---
 c/src/lib/libcpu/mips/Makefile.am    |  12 ---
 c/src/lib/libcpu/mips/clock/ckinit.c | 173 -----------------------------------
 c/src/lib/libcpu/mips/clock/clock.S  |  43 ---------
 c/src/lib/libcpu/mips/clock/clock.h  |  23 -----
 c/src/lib/libcpu/mips/configure.ac   |   5 +-
 5 files changed, 1 insertion(+), 255 deletions(-)
 delete mode 100644 c/src/lib/libcpu/mips/clock/ckinit.c
 delete mode 100644 c/src/lib/libcpu/mips/clock/clock.S
 delete mode 100644 c/src/lib/libcpu/mips/clock/clock.h

diff --git a/c/src/lib/libcpu/mips/Makefile.am b/c/src/lib/libcpu/mips/Makefile.am
index e4dd7ca..be4d2c0 100644
--- a/c/src/lib/libcpu/mips/Makefile.am
+++ b/c/src/lib/libcpu/mips/Makefile.am
@@ -56,18 +56,6 @@ include_libcpu_HEADERS += au1x00/include/au1x00.h
 
 endif
 
-if r46xx
-noinst_PROGRAMS += r46xx/timer.rel
-r46xx_timer_rel_SOURCES = timer/timer.c timer/gettime.S
-r46xx_timer_rel_CPPFLAGS = $(AM_CPPFLAGS)
-r46xx_timer_rel_LDFLAGS = $(RTEMS_RELLDFLAGS)
-
-noinst_PROGRAMS += r46xx/clock.rel
-r46xx_clock_rel_SOURCES = clock/ckinit.c clock/clock.S clock/clock.h
-r46xx_clock_rel_CPPFLAGS = $(AM_CPPFLAGS)
-r46xx_clock_rel_LDFLAGS = $(RTEMS_RELLDFLAGS)
-endif
-
 if rm52xx
 include_libcpu_HEADERS += rm52xx/include/rm5231.h
 
diff --git a/c/src/lib/libcpu/mips/clock/ckinit.c b/c/src/lib/libcpu/mips/clock/ckinit.c
deleted file mode 100644
index 3152263..0000000
--- a/c/src/lib/libcpu/mips/clock/ckinit.c
+++ /dev/null
@@ -1,173 +0,0 @@
-/*
- *  This file contains the clock driver initialization for the IDT 4650.
- */
-
-/*
- *  Author:     Craig Lebakken <craigl at transition.com>
- *
- *  COPYRIGHT (c) 1996 by Transition Networks Inc.
- *
- *  To anyone who acknowledges that this file is provided "AS IS"
- *  without any express or implied warranty:
- *      permission to use, copy, modify, and distribute this file
- *      for any purpose is hereby granted without fee, provided that
- *      the above copyright notice and this notice appears in all
- *      copies, and that the name of Transition Networks not be used in
- *      advertising or publicity pertaining to distribution of the
- *      software without specific, written prior permission.
- *      Transition Networks makes no representations about the suitability
- *      of this software for any purpose.
- *
- *  Derived from c/src/lib/libbsp/no_cpu/no_bsp/clock/ckinit.c:
- *
- *  COPYRIGHT (c) 1989-1999.
- *  On-Line Applications Research Corporation (OAR).
- *
- *  The license and distribution terms for this file may be
- *  found in the file LICENSE in this distribution or at
- *  http://www.rtems.org/license/LICENSE.
- */
-
-/*
- *  Rather than deleting this, it is commented out to (hopefully) help
- *  the submitter send updates.
- */
-
-#include <stdlib.h>
-
-#include <rtems.h>
-#include <rtems/clockdrv.h>
-
-#define EXT_INT5    0x8000  /* external interrupt 5 */
-
-#include "clock.h"
-
-extern uint32_t bsp_clicks_per_microsecond;
-
-/* to avoid including the bsp */
-mips_isr_entry set_vector( rtems_isr_entry, rtems_vector_number, int );
-
-/*
- *  The interrupt vector number associated with the clock tick device
- *  driver.
- */
-#define CLOCK_VECTOR_MASK    EXT_INT5
-#define CLOCK_VECTOR         0x7
-
-/*
- *  Clock_driver_ticks is a monotonically increasing counter of the
- *  number of clock ticks since the driver was initialized.
- */
-volatile uint32_t   Clock_driver_ticks;
-
-/*
- *  Clock_isrs is the number of clock ISRs until the next invocation of
- *  the RTEMS clock tick routine.  The clock tick device driver
- *  gets an interrupt once a millisecond and counts down until the
- *  length of time between the user configured microseconds per tick
- *  has passed.
- */
-uint32_t   Clock_isrs;              /* ISRs until next tick */
-
-/*
- *  The previous ISR on this clock tick interrupt vector.
- */
-rtems_isr_entry  Old_ticker;
-
-static uint32_t   mips_timer_rate = 0;
-
-/*
- *  Isr Handler
- */
-static rtems_isr Clock_isr(
-  rtems_vector_number vector
-)
-{
-/*
-   * bump the number of clock driver ticks since initialization
-   *
-   * determine if it is time to announce the passing of tick as configured
-   * to RTEMS through the rtems_clock_tick directive
-   *
-   * perform any timer dependent tasks
-   */
-
-  /* refresh the internal CPU timer */
-  mips_set_timer( mips_timer_rate );
-
-  Clock_driver_ticks += 1;
-
-  rtems_clock_tick();
-}
-
-/* User callback shell (set from Clock_Control) */
-static void (*user_callback)(void);
-
-rtems_isr User_Clock_isr(
-  rtems_vector_number vector
-)
-{
-   /* refresh the internal CPU timer */
-   mips_set_timer( mips_timer_rate );
-
-   if (user_callback)
-      user_callback();
-}
-
-/*
- *  Install_clock
- *
- *  Install a clock tick handleR and reprograms the chip.  This
- *  is used to initially establish the clock tick.
- */
-static void Install_clock(
-  rtems_isr_entry clock_isr
-)
-{
-  /*
-   *  Initialize the clock tick device driver variables
-   */
-
-  Clock_driver_ticks = 0;
-  Clock_isrs = rtems_configuration_get_milliseconds_per_tick();
-
-  Old_ticker = (rtems_isr_entry) set_vector( clock_isr, CLOCK_VECTOR, 1 );
-
-  /*
-   *  Hardware specific initialize goes here
-   */
-  mips_timer_rate = rtems_configuration_get_microseconds_per_tick() *
-     bsp_clicks_per_microsecond;
-  mips_set_timer( mips_timer_rate );
-  mips_enable_in_interrupt_mask(CLOCK_VECTOR_MASK);
-
-  /*
-   *  Schedule the clock cleanup routine to execute if the application exits.
-   */
-  atexit( Clock_exit );
-}
-
-/*
- *  Clean up before the application exits
- */
-void Clock_exit( void )
-{
-  /* mips: turn off the timer interrupts */
-  mips_disable_in_interrupt_mask(CLOCK_VECTOR_MASK);
-}
-
-/*
- *  Clock_initialize
- *
- *  Device driver entry point for clock tick driver initialization.
- */
-rtems_device_driver Clock_initialize(
-  rtems_device_major_number major,
-  rtems_device_minor_number minor,
-  void *pargp
-)
-{
-  Install_clock( Clock_isr );
-
-  return RTEMS_SUCCESSFUL;
-}
diff --git a/c/src/lib/libcpu/mips/clock/clock.S b/c/src/lib/libcpu/mips/clock/clock.S
deleted file mode 100644
index 2e9ff1e..0000000
--- a/c/src/lib/libcpu/mips/clock/clock.S
+++ /dev/null
@@ -1,43 +0,0 @@
-/*  clock.s
- *
- *  This file contains the assembly code for the IDT 4650 clock driver.
- *
- *  Author:     Craig Lebakken <craigl at transition.com>
- *
- *  COPYRIGHT (c) 1996 by Transition Networks Inc.
- *
- *  To anyone who acknowledges that this file is provided "AS IS"
- *  without any express or implied warranty:
- *      permission to use, copy, modify, and distribute this file
- *      for any purpose is hereby granted without fee, provided that
- *      the above copyright notice and this notice appears in all
- *      copies, and that the name of Transition Networks not be used in
- *      advertising or publicity pertaining to distribution of the
- *      software without specific, written prior permission.
- *      Transition Networks makes no representations about the suitability
- *      of this software for any purpose.
- */
-/* @(#)clock.S       08/20/96     1.2 */
-
-#include <rtems/mips/iregdef.h>
-#include <rtems/mips/idtcpu.h>
-#include <rtems/asm.h>
-
-FRAME(mips_set_timer,sp,0,ra)
-	.set noreorder
-        mfc0 t0,C0_COUNT
-        nop
-        addu t0,a0,t0
-        mtc0 t0,C0_COMPARE
-        j ra
-	nop
-	.set reorder
-ENDFRAME(mips_set_timer)
-
-FRAME(mips_get_timer,sp,0,ra)
-	.set noreorder
-        mfc0 v0,C0_COUNT
-        j ra
-	nop
-	.set reorder
-ENDFRAME(mips_get_timer)
diff --git a/c/src/lib/libcpu/mips/clock/clock.h b/c/src/lib/libcpu/mips/clock/clock.h
deleted file mode 100644
index 7b2fc92..0000000
--- a/c/src/lib/libcpu/mips/clock/clock.h
+++ /dev/null
@@ -1,23 +0,0 @@
-/*  clock.s
- *
- *  This file contains the assembly code for the IDT 4650 clock driver.
- *
- *  Author:     Craig Lebakken <craigl at transition.com>
- *
- *  COPYRIGHT (c) 1996 by Transition Networks Inc.
- *
- *  To anyone who acknowledges that this file is provided "AS IS"
- *  without any express or implied warranty:
- *      permission to use, copy, modify, and distribute this file
- *      for any purpose is hereby granted without fee, provided that
- *      the above copyright notice and this notice appears in all
- *      copies, and that the name of Transition Networks not be used in
- *      advertising or publicity pertaining to distribution of the
- *      software without specific, written prior permission.
- *      Transition Networks makes no representations about the suitability
- *      of this software for any purpose.
- */
-
-/* @(#)clock.h       08/20/96     1.2 */
-
-extern void mips_set_timer( uint32_t   timer_clock_interval );
diff --git a/c/src/lib/libcpu/mips/configure.ac b/c/src/lib/libcpu/mips/configure.ac
index 9bc3ebe..97157fc 100644
--- a/c/src/lib/libcpu/mips/configure.ac
+++ b/c/src/lib/libcpu/mips/configure.ac
@@ -2,7 +2,7 @@
 
 AC_PREREQ([2.69])
 AC_INIT([rtems-c-src-lib-libcpu-mips],[_RTEMS_VERSION],[http://www.rtems.org/bugzilla])
-AC_CONFIG_SRCDIR([clock])
+AC_CONFIG_SRCDIR([tx39])
 RTEMS_TOP([../../../../..],[../../..])
 
 RTEMS_CANONICAL_TARGET_CPU
@@ -19,9 +19,6 @@ AM_PROG_CC_C_O
 RTEMS_CANONICALIZE_TOOLS
 RTEMS_PROG_CCAS
 
-AM_CONDITIONAL(r46xx, test "$RTEMS_CPU_MODEL" = "R4600" \
-|| test "$RTEMS_CPU_MODEL" = "R4650" )
-
 AM_CONDITIONAL(tx39, test "$RTEMS_CPU_MODEL" = "tx3904")
 
 AM_CONDITIONAL(tx49, test "$RTEMS_CPU_MODEL" = "tx4925" \
-- 
1.9.3




More information about the devel mailing list