From d9e838b8825d8d306195b2d0fb726bcccb099e1d Mon Sep 17 00:00:00 2001 From: Jennifer Averett Date: Mon, 16 Apr 2012 12:39:58 -0500 Subject: [PATCH] Added get_cyclecount() method. --- Makefile | 3 ++- freebsd-to-rtems.py | 1 + rtemsbsd/src/rtems-bsd-cyclecount.c | 29 +++++++++++++++++++++++++++++ 3 files changed, 32 insertions(+), 1 deletion(-) create mode 100644 rtemsbsd/src/rtems-bsd-cyclecount.c diff --git a/Makefile b/Makefile index 5ec31225..5632da70 100644 --- a/Makefile +++ b/Makefile @@ -395,7 +395,8 @@ C_FILES += \ rtemsbsd/src/rtems-bsd-timesupport.c \ rtemsbsd/src/rtems-bsd-timeout.c \ rtemsbsd/src/rtems-bsd-newproc.c \ - rtemsbsd/src/rtems-bsd-vm_glue.c + rtemsbsd/src/rtems-bsd-vm_glue.c \ + rtemsbsd/src/rtems-bsd-cyclecount.c ifeq ($(RTEMS_CPU),arm) C_FILES += \ diff --git a/freebsd-to-rtems.py b/freebsd-to-rtems.py index 59bb8e15..a3be1c11 100755 --- a/freebsd-to-rtems.py +++ b/freebsd-to-rtems.py @@ -535,6 +535,7 @@ rtems_sourceFiles = [ 'src/rtems-bsd-timeout.c', 'src/rtems-bsd-newproc.c', 'src/rtems-bsd-vm_glue.c', + 'src/rtems-bsd-cyclecount.c', ] # RTEMS files handled separately from modules # rtems = Module('rtems') diff --git a/rtemsbsd/src/rtems-bsd-cyclecount.c b/rtemsbsd/src/rtems-bsd-cyclecount.c new file mode 100644 index 00000000..e0c6605d --- /dev/null +++ b/rtemsbsd/src/rtems-bsd-cyclecount.c @@ -0,0 +1,29 @@ +/** + * @file + * + * @ingroup rtems_bsd_rtems + * + * @brief TODO. + */ + +/* + * COPYRIGHT (c) 1989-2012. + * 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.com/license/LICENSE. + */ + +#include +#include +#include + +u_int64_t +get_cyclecount(void) +{ + u_int64_t value; + value = rtems_clock_get_ticks_since_boot(); + return value; +} +