summaryrefslogtreecommitdiffstats
path: root/c/src/lib/libcpu/powerpc/ppc403/timer/timer.c
diff options
context:
space:
mode:
authorSebastian Huber <sebastian.huber@embedded-brains.de>2018-03-21 06:27:24 +0100
committerSebastian Huber <sebastian.huber@embedded-brains.de>2018-03-22 07:01:36 +0100
commitbb22a3f3af86c00d70f51b4a3531640c0808261a (patch)
tree11cfc463d71bd86bd28bd1d01e1bd6c15636e893 /c/src/lib/libcpu/powerpc/ppc403/timer/timer.c
parentbsps/powerpc: Remove bsp_timer_internal_clock (diff)
downloadrtems-bb22a3f3af86c00d70f51b4a3531640c0808261a.tar.bz2
bsp/powerpc: Move libcpu timer to bsps
Use only one timer driver variant based on the standard PowerPC time base. This patch is a part of the BSP source reorganization. Update #3285.
Diffstat (limited to '')
-rw-r--r--c/src/lib/libcpu/powerpc/ppc403/timer/timer.c73
1 files changed, 0 insertions, 73 deletions
diff --git a/c/src/lib/libcpu/powerpc/ppc403/timer/timer.c b/c/src/lib/libcpu/powerpc/ppc403/timer/timer.c
deleted file mode 100644
index f883facb80..0000000000
--- a/c/src/lib/libcpu/powerpc/ppc403/timer/timer.c
+++ /dev/null
@@ -1,73 +0,0 @@
-/**
- * @file
- * @brief Timer Driver for the PowerPC 405.
- *
- * This file manages the interval timer on the PowerPC 405.
- * We shall use the bottom 32 bits of the timebase register,
- */
-
-/*
- * Author: Andrew Bray <andy@i-cubed.co.uk>
- *
- * COPYRIGHT (c) 1995 by i-cubed ltd.
- *
- * 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 i-cubed limited not be used in
- * advertising or publicity pertaining to distribution of the
- * software without specific, written prior permission.
- * i-cubed limited makes no representations about the suitability
- * of this software for any purpose.
- *
- * Derived from c/src/lib/libcpu/hppa1.1/timer/timer.c:
- *
- * COPYRIGHT (c) 1989-2007.
- * 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.
- *
- * Modifications for PPC405GP by Dennis Ehlin
- *
- * Further mods for PPC405EX/EXr by Michael Hamel
- *
- */
-
-#include <rtems.h>
-#include <rtems/btimer.h>
-#include <libcpu/powerpc-utility.h>
-
-extern uint32_t bsp_timer_least_valid;
-extern uint32_t bsp_timer_average_overhead;
-
-static volatile uint32_t startedAt;
-static bool subtractOverhead;
-
-void benchmark_timer_initialize(void)
-{
- /* We are going to rely on clock.c to sort out where the clock comes from */
- startedAt = ppc_time_base();
-}
-
-benchmark_timer_t benchmark_timer_read(void)
-{
- uint32_t clicks, total;
-
- clicks = ppc_time_base();
- total = clicks - startedAt;
- if ( ! subtractOverhead )
- return total; /* in XXX microsecond units */
- else if ( total < bsp_timer_least_valid )
- return 0; /* below timer resolution */
- else
- return (total - bsp_timer_average_overhead);
-}
-
-void benchmark_timer_disable_subtracting_average_overhead(bool find_flag)
-{
- subtractOverhead = find_flag;
-}