From bb22a3f3af86c00d70f51b4a3531640c0808261a Mon Sep 17 00:00:00 2001 From: Sebastian Huber Date: Wed, 21 Mar 2018 06:27:24 +0100 Subject: 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. --- c/src/lib/libcpu/powerpc/ppc403/timer/timer.c | 73 --------------------------- 1 file changed, 73 deletions(-) delete mode 100644 c/src/lib/libcpu/powerpc/ppc403/timer/timer.c (limited to 'c/src/lib/libcpu/powerpc/ppc403/timer/timer.c') 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 - * - * 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 -#include -#include - -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; -} -- cgit v1.2.3