summaryrefslogtreecommitdiffstats
path: root/c/src/lib/libcpu
diff options
context:
space:
mode:
authorJoel Sherrill <joel.sherrill@oarcorp.com>2014-09-04 08:59:49 -0500
committerJoel Sherrill <joel.sherrill@oarcorp.com>2014-09-16 16:09:12 -0500
commit8fbe2e69b544479feb5a361c6aebeae53eb827c8 (patch)
treead4e97466a3c29c6fd5f3505a8dbbb51558a3d33 /c/src/lib/libcpu
parentor1k: New cache manager. (diff)
downloadrtems-8fbe2e69b544479feb5a361c6aebeae53eb827c8.tar.bz2
Use correct prototype of benchmark_timer_read()
This change starts with removing the effectively empty file timerdrv.h. The prototypes for benchmark_timer_XXX() were in btimer.h which was not universally used. Thus every use of timerdrv.h had to be changed to btimer.h. Then the prototypes for benchmark_timer_read() had to be adjusted to return benchmark_timer_t rather than int or uint32_t. I took this opportunity to also correct the file headers to separate the copyright from the file description comments which is needed to ensure the copyright isn't propagated into Doxygen output.
Diffstat (limited to 'c/src/lib/libcpu')
-rw-r--r--c/src/lib/libcpu/arm/at91rm9200/timer/timer.c25
-rw-r--r--c/src/lib/libcpu/arm/lpc22xx/timer/timer.c34
-rw-r--r--c/src/lib/libcpu/arm/mc9328mxl/timer/timer.c23
-rw-r--r--c/src/lib/libcpu/arm/pxa255/timer/timer.c25
-rw-r--r--c/src/lib/libcpu/arm/s3c24xx/timer/timer.c31
-rw-r--r--c/src/lib/libcpu/bfin/timer/timer.c22
-rw-r--r--c/src/lib/libcpu/m68k/mcf5206/timer/timer.c12
-rw-r--r--c/src/lib/libcpu/m68k/mcf5206/timer/timerisr.S11
-rw-r--r--c/src/lib/libcpu/m68k/mcf5272/timer/timer.c11
-rw-r--r--c/src/lib/libcpu/m68k/mcf5272/timer/timerisr.S12
-rw-r--r--c/src/lib/libcpu/mips/timer/timer.c30
-rw-r--r--c/src/lib/libcpu/powerpc/mpc505/timer/timer.c15
-rw-r--r--c/src/lib/libcpu/powerpc/mpc5xx/timer/timer.c20
-rw-r--r--c/src/lib/libcpu/powerpc/mpc6xx/timer/timer.c17
-rw-r--r--c/src/lib/libcpu/powerpc/mpc8260/timer/timer.c19
-rw-r--r--c/src/lib/libcpu/powerpc/mpc8xx/timer/timer.c18
-rw-r--r--c/src/lib/libcpu/powerpc/ppc403/timer/timer.c16
-rw-r--r--c/src/lib/libcpu/sh/sh7032/timer/timer.c18
-rw-r--r--c/src/lib/libcpu/sh/sh7045/timer/timer.c18
-rw-r--r--c/src/lib/libcpu/sh/sh7750/timer/timer.c18
20 files changed, 186 insertions, 209 deletions
diff --git a/c/src/lib/libcpu/arm/at91rm9200/timer/timer.c b/c/src/lib/libcpu/arm/at91rm9200/timer/timer.c
index 2ae7bb6517..c65dd8096a 100644
--- a/c/src/lib/libcpu/arm/at91rm9200/timer/timer.c
+++ b/c/src/lib/libcpu/arm/at91rm9200/timer/timer.c
@@ -1,26 +1,21 @@
-/*
- * Cogent CSB337 Timer driver
+/**
+ * @file
+ * @brief Cogent CSB337 Timer driver
*
* This uses timer 0 for timing measurments.
- *
- * Copyright (c) 2004 by Jay Monkman <jtm@lopingdog.com>
+ */
+
+/*
+ * Copyright (c) 2004 by Jay Monkman <jtm@lopingdog.com>
*
* 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.
- *
- * Notes:
- * This file manages the benchmark timer used by the RTEMS Timing Test
- * Suite. Each measured time period is demarcated by calls to
- * benchmark_timer_initialize() and benchmark_timer_read(). benchmark_timer_read() usually returns
- * the number of microseconds since benchmark_timer_initialize() exitted.
- *
- * It is important that the timer start/stop overhead be determined
- * when porting or modifying this code.
*/
-#include <rtems.h>
#include <bsp.h>
+#include <rtems.h>
+#include <rtems/btimer.h>
#include <at91rm9200.h>
#include <at91rm9200_pmc.h>
@@ -63,7 +58,7 @@ void benchmark_timer_initialize( void )
/* This value is in microseconds. */
#define LEAST_VALID 1 /* Don't trust a clicks value lower than this */
-int benchmark_timer_read( void )
+benchmark_timer_t benchmark_timer_read( void )
{
uint16_t t;
uint32_t total;
diff --git a/c/src/lib/libcpu/arm/lpc22xx/timer/timer.c b/c/src/lib/libcpu/arm/lpc22xx/timer/timer.c
index 10449ee87f..ad73aeda3c 100644
--- a/c/src/lib/libcpu/arm/lpc22xx/timer/timer.c
+++ b/c/src/lib/libcpu/arm/lpc22xx/timer/timer.c
@@ -1,28 +1,24 @@
-/*
- * RTL22xx board Timer driver
+/**
+ * @file
+ * @brief RTL22xx board Timer driver
*
* This uses Timer1 for timing measurments.
+ */
+
+/*
+ * By Ray Xu <rayx.cn@gmail.com>, modify form Mc9328mxl RTEMS DSP
*
- * By Ray xu<rayx.cn@gmail.com>, modify form Mc9328mxl RTEMS DSP
- *
- * 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.
- *
- * Notes:
- * This file manages the benchmark timer used by the RTEMS Timing Test
- * Suite. Each measured time period is demarcated by calls to
- * benchmark_timer_initialize() and benchmark_timer_read(). benchmark_timer_read() usually returns
- * the number of microseconds since benchmark_timer_initialize() exitted.
- *
- * It is important that the timer start/stop overhead be determined
- * when porting or modifying this code.
-*/
+ * 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.
+ */
-#include <rtems.h>
#include <bsp.h>
+#include <rtems.h>
+#include <rtems/btimer.h>
#include <lpc22xx.h>
#include "lpc_timer.h"
+
uint32_t g_start;
uint32_t g_freq;
@@ -52,7 +48,7 @@ void benchmark_timer_initialize( void )
/* This value is in microseconds. */
#define LEAST_VALID 1 /* Don't trust a clicks value lower than this */
-int benchmark_timer_read( void )
+benchmark_timer_t benchmark_timer_read( void )
{
return (T0TC/(LPC22xx_Fpclk/1000000));
/*
diff --git a/c/src/lib/libcpu/arm/mc9328mxl/timer/timer.c b/c/src/lib/libcpu/arm/mc9328mxl/timer/timer.c
index 4ddd289e83..66ff4a0bf4 100644
--- a/c/src/lib/libcpu/arm/mc9328mxl/timer/timer.c
+++ b/c/src/lib/libcpu/arm/mc9328mxl/timer/timer.c
@@ -1,27 +1,22 @@
-/*
- * Cogent CSB336 Timer driver
+/**
+ * @file
+ * @brief Cogent CSB336 Timer driver
*
* This uses timer 2 for timing measurments.
- *
+ */
+
+/*
* Copyright (c) 2004 Cogent Computer Systems
* Written by Jay Monkman <jtm@lopingdog.com>
*
* 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.
- *
- * Notes:
- * This file manages the benchmark timer used by the RTEMS Timing Test
- * Suite. Each measured time period is demarcated by calls to
- * benchmark_timer_initialize() and benchmark_timer_read(). benchmark_timer_read() usually returns
- * the number of microseconds since benchmark_timer_initialize() exitted.
- *
- * It is important that the timer start/stop overhead be determined
- * when porting or modifying this code.
-*/
+ */
#include <rtems.h>
#include <bsp.h>
+#include <rtems/btimer.h>
#include <mc9328mxl.h>
uint32_t g_start;
@@ -62,7 +57,7 @@ void benchmark_timer_initialize( void )
/* This value is in microseconds. */
#define LEAST_VALID 1 /* Don't trust a clicks value lower than this */
-int benchmark_timer_read( void )
+benchmark_timer_t benchmark_timer_read( void )
{
uint32_t t;
unsigned long long total;
diff --git a/c/src/lib/libcpu/arm/pxa255/timer/timer.c b/c/src/lib/libcpu/arm/pxa255/timer/timer.c
index de555b4587..7eb3d5b811 100644
--- a/c/src/lib/libcpu/arm/pxa255/timer/timer.c
+++ b/c/src/lib/libcpu/arm/pxa255/timer/timer.c
@@ -1,23 +1,20 @@
+/**
+ * @file
+ * @brief PXA255 timer
+ */
+
/*
* PXA255 timer by Yang Xi <hiyangxi@gmail.com>
* Copyright (c) 2004 by Jay Monkman <jtm@lopingdog.com>
*
- * Notes:
- * This file manages the benchmark timer used by the RTEMS Timing Test
- * Suite. Each measured time period is demarcated by calls to
- * Timer_initialize() and Read_timer(). Read_timer() usually returns
- * the number of microseconds since Timer_initialize() exitted.
- *
- * It is important that the timer start/stop overhead be determined
- * when porting or modifying this code.
- *
- * 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.
+ * 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.
*/
-#include <rtems.h>
#include <bsp.h>
+#include <rtems.h>
+#include <rtems/btimer.h>
#include <pxa255.h>
uint32_t tstart;
@@ -51,7 +48,7 @@ void benchmark_timer_initialize(void)
/* This value is in microseconds. */
#define LEAST_VALID 1 /* Don't trust a clicks value lower than this */
-int benchmark_timer_read(void)
+benchmark_timer_t benchmark_timer_read(void)
{
uint32_t total;
diff --git a/c/src/lib/libcpu/arm/s3c24xx/timer/timer.c b/c/src/lib/libcpu/arm/s3c24xx/timer/timer.c
index 6166c745eb..2bc599df75 100644
--- a/c/src/lib/libcpu/arm/s3c24xx/timer/timer.c
+++ b/c/src/lib/libcpu/arm/s3c24xx/timer/timer.c
@@ -1,24 +1,19 @@
-/*
- * S3C2400 Timer driver
+/**
+ * @file
+ * @brief S3C2400 Timer driver
*
* This uses timer 1 for timing measurments.
- *
- * 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.
- *
- * Notes:
- * This file manages the benchmark timer used by the RTEMS Timing Test
- * Suite. Each measured time period is demarcated by calls to
- * benchmark_timer_initialize() and benchmark_timer_read(). benchmark_timer_read() usually returns
- * the number of microseconds since benchmark_timer_initialize() exitted.
- *
- * It is important that the timer start/stop overhead be determined
- * when porting or modifying this code.
-*/
+ */
+
+/*
+ * 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.
+ */
-#include <rtems.h>
#include <bsp.h>
+#include <rtems.h>
+#include <rtems/btimer.h>
#include <s3c24xx.h>
uint32_t g_start;
@@ -69,7 +64,7 @@ void benchmark_timer_initialize( void )
/* This value is in microseconds. */
#define LEAST_VALID 1 /* Don't trust a clicks value lower than this */
-int benchmark_timer_read( void )
+benchmark_timer_t benchmark_timer_read( void )
{
uint32_t t;
unsigned long long total;
diff --git a/c/src/lib/libcpu/bfin/timer/timer.c b/c/src/lib/libcpu/bfin/timer/timer.c
index a5155f5302..02540fe2ce 100644
--- a/c/src/lib/libcpu/bfin/timer/timer.c
+++ b/c/src/lib/libcpu/bfin/timer/timer.c
@@ -1,10 +1,15 @@
-/* Timer for Blackfin
+/**
+ * @file
+ * @brief Timer for Blackfin
*
* This file manages the benchmark timer used by the RTEMS Timing Test
* Suite. Each measured time period is demarcated by calls to
- * benchmark_timer_initialize() and benchmark_timer_read(). benchmark_timer_read() usually returns
- * the number of microseconds since benchmark_timer_initialize() exitted.
- *
+ * benchmark_timer_initialize() and benchmark_timer_read().
+ * benchmark_timer_read() usually returns the number of microseconds
+ * since benchmark_timer_initialize() exitted.
+ */
+
+/*
* Copyright (c) 2006 by Atos Automacao Industrial Ltda.
* written by Alain Schaefer <alain.schaefer@easc.ch>
* and Antonio Giovanini <antonio@atos.com.br>
@@ -14,13 +19,12 @@
* http://www.rtems.org/license/LICENSE.
*/
-
#include <rtems.h>
#include <bsp.h>
+#include <rtems/btimer.h>
-
-uint32_t Timer_interrupts;
-bool benchmark_timer_find_average_overhead;
+uint32_t Timer_interrupts;
+bool benchmark_timer_find_average_overhead;
/*
* benchmark_timer_initialize
@@ -56,7 +60,7 @@ void benchmark_timer_initialize( void )
/* This value is in microseconds. */
#define LEAST_VALID 1 /* Don't trust a clicks value lower than this */
-int benchmark_timer_read( void )
+benchmark_timer_t benchmark_timer_read( void )
{
uint32_t clicks;
uint32_t total;
diff --git a/c/src/lib/libcpu/m68k/mcf5206/timer/timer.c b/c/src/lib/libcpu/m68k/mcf5206/timer/timer.c
index a95521bb77..dbeebc80e0 100644
--- a/c/src/lib/libcpu/m68k/mcf5206/timer/timer.c
+++ b/c/src/lib/libcpu/m68k/mcf5206/timer/timer.c
@@ -1,8 +1,11 @@
-/*
- * Timer Init
+/**
+ * @file
+ * @brief Timer Init
*
* This module initializes TIMER 2 for on the MCF5206E for benchmarks.
- *
+ */
+
+/*
* Copyright (C) 2000 OKTET Ltd., St.-Petersburg, Russia
* Author: Victor V. Vengerov <vvv@oktet.ru>
*
@@ -21,6 +24,7 @@
#include <rtems.h>
#include <bsp.h>
+#include <rtems/btimer.h>
#include "mcf5206/mcf5206e.h"
#define TRR2_VAL 65530
@@ -99,7 +103,7 @@ benchmark_timer_initialize(void)
* RETURNS:
* number of microseconds since timer has been started
*/
-int
+benchmark_timer_t
benchmark_timer_read( void )
{
uint16_t clicks;
diff --git a/c/src/lib/libcpu/m68k/mcf5206/timer/timerisr.S b/c/src/lib/libcpu/m68k/mcf5206/timer/timerisr.S
index 2d4c5bc24d..bbcf6e2d6a 100644
--- a/c/src/lib/libcpu/m68k/mcf5206/timer/timerisr.S
+++ b/c/src/lib/libcpu/m68k/mcf5206/timer/timerisr.S
@@ -1,5 +1,6 @@
-/*
- * Handle MCF5206 TIMER2 interrupts.
+/**
+ * @file
+ * @brief Handle MCF5206 TIMER2 interrupts
*
* All code in this routine is pure overhead which can perturb the
* accuracy of RTEMS' timing test suite.
@@ -11,7 +12,9 @@
* occur during the measured time period.
*
* An external counter, Timer_interrupts, is incremented.
- *
+ */
+
+/*
* Copyright (C) 2000 OKTET Ltd., St.-Petersburg, Russia
* Author: Victor V. Vengerov <vvv@oktet.ru>
*
@@ -29,7 +32,7 @@
*/
#include <rtems/asm.h>
-#include "bsp.h"
+#include <bsp.h>
#include "mcf5206/mcf5206e.h"
BEGIN_CODE
diff --git a/c/src/lib/libcpu/m68k/mcf5272/timer/timer.c b/c/src/lib/libcpu/m68k/mcf5272/timer/timer.c
index 0788456f84..812310fbea 100644
--- a/c/src/lib/libcpu/m68k/mcf5272/timer/timer.c
+++ b/c/src/lib/libcpu/m68k/mcf5272/timer/timer.c
@@ -1,8 +1,10 @@
-/*
- * Timer Init
+/**
+ * @file
*
* This module initializes TIMER 2 for on the MCF5272 for benchmarks.
- *
+ */
+
+/*
* Copyright (C) 2000 OKTET Ltd., St.-Petersburg, Russia
* Author: Victor V. Vengerov <vvv@oktet.ru>
*
@@ -22,6 +24,7 @@
#include <rtems.h>
#include <bsp.h>
#include <mcf5272/mcf5272.h>
+#include <rtems/btimer.h>
#define TRR2_VAL 65530
@@ -102,7 +105,7 @@ benchmark_timer_initialize(void)
* RETURNS:
* number of microseconds since timer has been started
*/
-int
+benchmark_timer_t
benchmark_timer_read( void )
{
uint16_t clicks;
diff --git a/c/src/lib/libcpu/m68k/mcf5272/timer/timerisr.S b/c/src/lib/libcpu/m68k/mcf5272/timer/timerisr.S
index 2e36c34262..b9c28921c4 100644
--- a/c/src/lib/libcpu/m68k/mcf5272/timer/timerisr.S
+++ b/c/src/lib/libcpu/m68k/mcf5272/timer/timerisr.S
@@ -1,5 +1,6 @@
-/*
- * Handle MCF5272 TIMER2 interrupts.
+/**
+ * @file
+ * @brief Handle MCF5272 TIMER2 interrupts.
*
* All code in this routine is pure overhead which can perturb the
* accuracy of RTEMS' timing test suite.
@@ -11,7 +12,9 @@
* occur during the measured time period.
*
* An external counter, Timer_interrupts, is incremented.
- *
+ */
+
+/*
* Copyright (C) 2000 OKTET Ltd., St.-Petersburg, Russia
* Author: Victor V. Vengerov <vvv@oktet.ru>
*
@@ -30,9 +33,6 @@
#include <rtems/asm.h>
#include <bsp.h>
-/*
-#include "mcf5272/mcf5272.h"
-*/
BEGIN_CODE
PUBLIC(timerisr)
diff --git a/c/src/lib/libcpu/mips/timer/timer.c b/c/src/lib/libcpu/mips/timer/timer.c
index 4cb66e3b4c..da5291a48a 100644
--- a/c/src/lib/libcpu/mips/timer/timer.c
+++ b/c/src/lib/libcpu/mips/timer/timer.c
@@ -1,7 +1,12 @@
-/* timer.c
- *
- * This file contains the initialization code for the IDT 4650 timer driver.
+/**
+ * @file
+ * @brief IDT 4650 Timer Driver.
*
+ * This file manages the benchmark timer used by the RTEMS Timing Test
+ * Suite.
+ */
+
+/*
* Author: Craig Lebakken <craigl@transition.com>
*
* COPYRIGHT (c) 1996 by Transition Networks Inc.
@@ -19,14 +24,6 @@
*
* derived from src/lib/libbsp/no_cpu/no_bsp/timer/timer.c
*
- * This file manages the benchmark timer used by the RTEMS Timing Test
- * Suite. Each measured time period is demarcated by calls to
- * benchmark_timer_initialize() and benchmark_timer_read(). benchmark_timer_read() usually returns
- * the number of microseconds since benchmark_timer_initialize() exitted.
- *
- * NOTE: It is important that the timer start/stop overhead be
- * determined when porting or modifying this code.
- *
* COPYRIGHT (c) 1989-1999.
* On-Line Applications Research Corporation (OAR).
*
@@ -35,15 +32,8 @@
* http://www.rtems.org/license/LICENSE.
*/
-/*
- * Rather than deleting this, it is commented out to (hopefully) help
- * the submitter send updates.
- *
- * static char _sccsid[] = "@(#)timer.c 08/20/96 1.5\n";
- */
-
-
#include <rtems.h>
+#include <rtems/btimer.h>
#define CLOCKS_PER_MICROSECOND ( CPU_CLOCK_RATE_MHZ )
#define TIMER_MAX_VALUE 0xffffffff
@@ -78,7 +68,7 @@ void benchmark_timer_initialize( void )
/* This value is in cycles. */
#define LEAST_VALID 1 /* Don't trust a clicks value lower than this */
-int benchmark_timer_read( void )
+benchmark_timer_t benchmark_timer_read( void )
{
uint64_t clicks;
uint32_t total;
diff --git a/c/src/lib/libcpu/powerpc/mpc505/timer/timer.c b/c/src/lib/libcpu/powerpc/mpc505/timer/timer.c
index b353be440c..17bc2afba2 100644
--- a/c/src/lib/libcpu/powerpc/mpc505/timer/timer.c
+++ b/c/src/lib/libcpu/powerpc/mpc505/timer/timer.c
@@ -1,18 +1,23 @@
-/* timer.c
+/**
+ * @file
*
* This file manages the benchmark timer used by the RTEMS Timing Test
* Suite. Each measured time period is demarcated by calls to
- * benchmark_timer_initialize() and benchmark_timer_read(). benchmark_timer_read() usually returns
- * the number of microseconds since benchmark_timer_initialize() exitted.
+ * benchmark_timer_initialize() and benchmark_timer_read().
+ * benchmark_timer_read() usually returns the number of microseconds
+ * since benchmark_timer_initialize() exitted.
*
* NOTE: It is important that the timer start/stop overhead be
* determined when porting or modifying this code.
- *
+ */
+
+/*
* COPYRIGHT (c) 1989, 1990, 1991, 1992, 1993, 1994.
* On-Line Applications Research Corporation (OAR).
*/
#include <rtems.h>
+#include <rtems/btimer.h>
bool benchmark_timer_find_average_overhead;
@@ -38,7 +43,7 @@ void benchmark_timer_initialize( void )
/* This value is in microseconds. */
#define LEAST_VALID 1 /* Don't trust a clicks value lower than this */
-int benchmark_timer_read( void )
+benchmark_timer_t benchmark_timer_read( void )
{
uint32_t value;
__asm__ volatile ( " mftb %0": "=r" (value) );
diff --git a/c/src/lib/libcpu/powerpc/mpc5xx/timer/timer.c b/c/src/lib/libcpu/powerpc/mpc5xx/timer/timer.c
index 699c8493e1..65deae961e 100644
--- a/c/src/lib/libcpu/powerpc/mpc5xx/timer/timer.c
+++ b/c/src/lib/libcpu/powerpc/mpc5xx/timer/timer.c
@@ -1,16 +1,13 @@
-/* timer.c
+/**
+ * @file
+ * @brief Timer Driver for the PowerPC MPC5xx.
*
* This file manages the interval timer on the PowerPC MPC5xx.
- * NOTE: This is not the PIT, but rather the RTEMS interval
- * timer
+ * @noe This is not the PIT, but rather the RTEMS interval timer.
* We shall use the bottom 32 bits of the timebase register,
- *
- * The following was in the 403 version of this file. I don't
- * know what it means. JTM 5/19/98
- * NOTE: It is important that the timer start/stop overhead be
- * determined when porting or modifying this code.
- *
- *
+ */
+
+/*
* MPC5xx port sponsored by Defence Research and Development Canada - Suffield
* Copyright (C) 2004, Real-Time Systems Inc. (querbach@realtime.bc.ca)
*
@@ -47,6 +44,7 @@
*/
#include <rtems.h>
+#include <rtems/btimer.h>
#include <mpc5xx.h>
static volatile uint32_t Timer_starting;
@@ -80,7 +78,7 @@ void benchmark_timer_initialize(void)
Timer_starting = get_itimer();
}
-int benchmark_timer_read(void)
+benchmark_timer_t benchmark_timer_read(void)
{
uint32_t clicks;
uint32_t total;
diff --git a/c/src/lib/libcpu/powerpc/mpc6xx/timer/timer.c b/c/src/lib/libcpu/powerpc/mpc6xx/timer/timer.c
index fcd179aaa7..ee6e9a9659 100644
--- a/c/src/lib/libcpu/powerpc/mpc6xx/timer/timer.c
+++ b/c/src/lib/libcpu/powerpc/mpc6xx/timer/timer.c
@@ -1,9 +1,11 @@
-/* timer.c
+/**
+ * @file
+ * @brief
*
* This file implements a benchmark timer using the PPC Timebase
- *
- * Notes: NONE
- *
+ */
+
+/*
* COPYRIGHT (c) 1989-2000.
* On-Line Applications Research Corporation (OAR).
*
@@ -12,10 +14,11 @@
* http://www.rtems.org/license/LICENSE.
*/
+#include <bsp.h>
+#include <rtems.h>
#include <rtems/system.h>
+#include <rtems/btimer.h>
#include <assert.h>
-#include <rtems.h>
-#include <bsp.h>
#include <libcpu/powerpc-utility.h>
@@ -58,7 +61,7 @@ void benchmark_timer_initialize(void)
* benchmark_timer_read
*/
-int benchmark_timer_read(void)
+benchmark_timer_t benchmark_timer_read(void)
{
uint64_t total64;
uint32_t total;
diff --git a/c/src/lib/libcpu/powerpc/mpc8260/timer/timer.c b/c/src/lib/libcpu/powerpc/mpc8260/timer/timer.c
index 85b36308fb..c20fdc5cca 100644
--- a/c/src/lib/libcpu/powerpc/mpc8260/timer/timer.c
+++ b/c/src/lib/libcpu/powerpc/mpc8260/timer/timer.c
@@ -1,15 +1,13 @@
-/* timer.c
+/**
+ * @file
+ * @brief Timer for the PowerPC MPC860
*
- * This file manages the interval timer on the PowerPC MPC860.
- * NOTE: This is not the PIT, but rather the RTEMS interval
- * timer
* We shall use the bottom 32 bits of the timebase register,
*
- * The following was in the 403 version of this file. I don't
- * know what it means. JTM 5/19/98
- * NOTE: It is important that the timer start/stop overhead be
- * determined when porting or modifying this code.
- *
+ * @note This is not the PIT, but rather the RTEMS interval timer.
+ */
+
+/*
* Author: Andy Dachs <a.dachs@sstl.co.uk>
* Surrey Satellite Technlogy Limited
* Modified for MPC8260
@@ -46,6 +44,7 @@
*/
#include <rtems.h>
+#include <rtems/btimer.h>
#include <mpc8260.h>
static volatile uint32_t Timer_starting;
@@ -78,7 +77,7 @@ void benchmark_timer_initialize(void)
extern uint32_t bsp_timer_least_valid;
extern uint32_t bsp_timer_average_overhead;
-int benchmark_timer_read(void)
+benchmark_timer_t benchmark_timer_read(void)
{
uint32_t clicks;
uint32_t total;
diff --git a/c/src/lib/libcpu/powerpc/mpc8xx/timer/timer.c b/c/src/lib/libcpu/powerpc/mpc8xx/timer/timer.c
index 7d4ed1d424..b82d76497d 100644
--- a/c/src/lib/libcpu/powerpc/mpc8xx/timer/timer.c
+++ b/c/src/lib/libcpu/powerpc/mpc8xx/timer/timer.c
@@ -1,15 +1,14 @@
-/* timer.c
+/**
+ * @file
+ * @brief Timer Driver for the PowerPC MPC8xx.
*
* This file manages the interval timer on the PowerPC MPC8xx.
- * NOTE: This is not the PIT, but rather the RTEMS interval
- * timer
* We shall use the bottom 32 bits of the timebase register,
*
- * The following was in the 403 version of this file. I don't
- * know what it means. JTM 5/19/98
- * NOTE: It is important that the timer start/stop overhead be
- * determined when porting or modifying this code.
- *
+ * @note This is not the PIT, but rather the RTEMS interval timer
+ */
+
+/*
* Author: Jay Monkman (jmonkman@frasca.com)
* Copywright (C) 1998 by Frasca International, Inc.
*
@@ -41,6 +40,7 @@
*/
#include <rtems.h>
+#include <rtems/btimer.h>
#include <mpc8xx.h>
static volatile uint32_t Timer_starting;
@@ -69,7 +69,7 @@ void benchmark_timer_initialize(void)
Timer_starting = get_itimer();
}
-int benchmark_timer_read(void)
+benchmark_timer_t benchmark_timer_read(void)
{
uint32_t clicks;
uint32_t total;
diff --git a/c/src/lib/libcpu/powerpc/ppc403/timer/timer.c b/c/src/lib/libcpu/powerpc/ppc403/timer/timer.c
index 5ee5ff42e5..f883facb80 100644
--- a/c/src/lib/libcpu/powerpc/ppc403/timer/timer.c
+++ b/c/src/lib/libcpu/powerpc/ppc403/timer/timer.c
@@ -1,12 +1,13 @@
-/* timer.c
+/**
+ * @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,
- *
- * NOTE: It is important that the timer start/stop overhead be
- * determined when porting or modifying this code.
- *
- * Author: Andrew Bray <andy@i-cubed.co.uk>
+ */
+
+/*
+ * Author: Andrew Bray <andy@i-cubed.co.uk>
*
* COPYRIGHT (c) 1995 by i-cubed ltd.
*
@@ -37,6 +38,7 @@
*/
#include <rtems.h>
+#include <rtems/btimer.h>
#include <libcpu/powerpc-utility.h>
extern uint32_t bsp_timer_least_valid;
@@ -51,7 +53,7 @@ void benchmark_timer_initialize(void)
startedAt = ppc_time_base();
}
-int benchmark_timer_read(void)
+benchmark_timer_t benchmark_timer_read(void)
{
uint32_t clicks, total;
diff --git a/c/src/lib/libcpu/sh/sh7032/timer/timer.c b/c/src/lib/libcpu/sh/sh7032/timer/timer.c
index f9750adf3d..94a834cb1e 100644
--- a/c/src/lib/libcpu/sh/sh7032/timer/timer.c
+++ b/c/src/lib/libcpu/sh/sh7032/timer/timer.c
@@ -1,14 +1,9 @@
+/**
+ * @file
+ * @brief Timer for the Hitachi SH 703X
+ */
+
/*
- * timer for the Hitachi SH 703X
- *
- * This file manages the benchmark timer used by the RTEMS Timing Test
- * Suite. Each measured time period is demarcated by calls to
- * benchmark_timer_initialize() and benchmark_timer_read(). benchmark_timer_read() usually returns
- * the number of microseconds since benchmark_timer_initialize() exitted.
- *
- * NOTE: It is important that the timer start/stop overhead be
- * determined when porting or modifying this code.
- *
* Authors: Ralf Corsepius (corsepiu@faw.uni-ulm.de) and
* Bernd Becker (becker@faw.uni-ulm.de)
*
@@ -27,6 +22,7 @@
*/
#include <rtems.h>
+#include <rtems/btimer.h>
#include <rtems/score/sh_io.h>
#include <rtems/score/ispsh7032.h>
@@ -147,7 +143,7 @@ void benchmark_timer_initialize( void )
/* This value is in microseconds. */
#define LEAST_VALID 0 /* 20 */ /* Don't trust a clicks value lower than this */
-int benchmark_timer_read( void )
+benchmark_timer_t benchmark_timer_read( void )
{
uint32_t cclicks;
uint32_t total ;
diff --git a/c/src/lib/libcpu/sh/sh7045/timer/timer.c b/c/src/lib/libcpu/sh/sh7045/timer/timer.c
index 86031cda61..152c99b1aa 100644
--- a/c/src/lib/libcpu/sh/sh7045/timer/timer.c
+++ b/c/src/lib/libcpu/sh/sh7045/timer/timer.c
@@ -1,14 +1,9 @@
+/**
+ * @file
+ * @brief Timer for the Hitachi SH 704X
+ */
+
/*
- * timer for the Hitachi SH 704X
- *
- * This file manages the benchmark timer used by the RTEMS Timing Test
- * Suite. Each measured time period is demarcated by calls to
- * benchmark_timer_initialize() and benchmark_timer_read(). benchmark_timer_read() usually returns
- * the number of microseconds since benchmark_timer_initialize() exitted.
- *
- * NOTE: It is important that the timer start/stop overhead be
- * determined when porting or modifying this code.
- *
* Authors: Ralf Corsepius (corsepiu@faw.uni-ulm.de) and
* Bernd Becker (becker@faw.uni-ulm.de)
*
@@ -27,6 +22,7 @@
*/
#include <rtems.h>
+#include <rtems/btimer.h>
#include <rtems/score/sh_io.h>
#include <rtems/score/iosh7045.h>
@@ -143,7 +139,7 @@ void benchmark_timer_initialize( void )
/* This value is in microseconds. */
#define LEAST_VALID 0 /* 20 */ /* Don't trust a clicks value lower than this */
-int benchmark_timer_read( void )
+benchmark_timer_t benchmark_timer_read( void )
{
uint32_t clicks;
uint32_t total ;
diff --git a/c/src/lib/libcpu/sh/sh7750/timer/timer.c b/c/src/lib/libcpu/sh/sh7750/timer/timer.c
index fcdf8f5178..ef462c780c 100644
--- a/c/src/lib/libcpu/sh/sh7750/timer/timer.c
+++ b/c/src/lib/libcpu/sh/sh7750/timer/timer.c
@@ -1,14 +1,9 @@
+/**
+ * @file
+ * @brief Timer driver for the Hitachi SH 7750
+ */
+
/*
- * timer driver for the Hitachi SH 7750
- *
- * This file manages the benchmark timer used by the RTEMS Timing Test
- * Suite. Each measured time period is demarcated by calls to
- * benchmark_timer_initialize() and benchmark_timer_read(). benchmark_timer_read() usually returns
- * the number of microseconds since benchmark_timer_initialize() exitted.
- *
- * NOTE: It is important that the timer start/stop overhead be
- * determined when porting or modifying this code.
- *
* Copyright (C) 2001 OKTET Ltd., St.-Petersburg, Russia
* Author: Victor V. Vengerov <vvv@oktet.ru>
*
@@ -21,6 +16,7 @@
*/
#include <rtems.h>
+#include <rtems/btimer.h>
#include <rtems/score/sh_io.h>
#include <rtems/score/iosh7750.h>
@@ -198,7 +194,7 @@ benchmark_timer_initialize(void)
* RETURNS:
* number of microseconds since timer has been started
*/
-int
+benchmark_timer_t
benchmark_timer_read(void)
{
uint32_t clicks;