[rtems-libbsd commit] Moved rtems-bsd-cyclecount.c to cpu.h

Jennifer Averett jennifer at rtems.org
Wed Apr 18 14:43:22 UTC 2012


Module:    rtems-libbsd
Branch:    master
Commit:    d8c5df73f682881aba1baa5730b4234f8f26c4ab
Changeset: http://git.rtems.org/rtems-libbsd/commit/?id=d8c5df73f682881aba1baa5730b4234f8f26c4ab

Author:    Jennifer Averett <jennifer.averett at oarcorp.com>
Date:      Wed Apr 18 09:46:21 2012 -0500

Moved rtems-bsd-cyclecount.c to cpu.h

---

 Makefile                                           |    1 -
 freebsd-to-rtems.py                                |    3 +--
 freebsd/machine/cpu.h                              |    1 -
 .../machine/cpu.h}                                 |   13 +++++++++----
 4 files changed, 10 insertions(+), 8 deletions(-)

diff --git a/Makefile b/Makefile
index 2d8cd25..c94883e 100644
--- a/Makefile
+++ b/Makefile
@@ -56,7 +56,6 @@ C_FILES += rtemsbsd/src/rtems-bsd-timesupport.c
 C_FILES += rtemsbsd/src/rtems-bsd-newproc.c
 C_FILES += rtemsbsd/src/rtems-bsd-vm_glue.c
 C_FILES += rtemsbsd/src/rtems-bsd-subr.c
-C_FILES += rtemsbsd/src/rtems-bsd-cyclecount.c
 C_FILES += freebsd/kern/subr_eventhandler.c
 C_FILES += freebsd/kern/kern_subr.c
 C_FILES += freebsd/kern/kern_tc.c
diff --git a/freebsd-to-rtems.py b/freebsd-to-rtems.py
index 46055ec..1f47886 100755
--- a/freebsd-to-rtems.py
+++ b/freebsd-to-rtems.py
@@ -497,6 +497,7 @@ rtems.addRTEMSHeaderFiles(
 		'rtems/machine/_stdint.h',
 		'rtems/machine/_types.h',
 		'rtems/machine/ucontext.h',
+		'rtems/machine/cpu.h',
 		'rtems/machine/rtems-bsd-symbols.h',
 		'rtems/machine/rtems-bsd-cache.h',
 		'rtems/machine/rtems-bsd-sysinit.h',
@@ -550,7 +551,6 @@ rtems.addRTEMSSourceFiles(
 		'src/rtems-bsd-newproc.c',
 		'src/rtems-bsd-vm_glue.c',
 		'src/rtems-bsd-subr.c',
-		'src/rtems-bsd-cyclecount.c',
 	]
 )
 rtems.addEmptyHeaderFiles(
@@ -558,7 +558,6 @@ rtems.addEmptyHeaderFiles(
 		'cam/cam_queue.h',
 		'ddb/db_sym.h',
 		'ddb/ddb.h',
-		'machine/cpu.h',
 		'machine/elf.h',
 		'machine/sf_buf.h',
 		'machine/smp.h',
diff --git a/freebsd/machine/cpu.h b/freebsd/machine/cpu.h
deleted file mode 100644
index 936ffd8..0000000
--- a/freebsd/machine/cpu.h
+++ /dev/null
@@ -1 +0,0 @@
-/* EMPTY */
diff --git a/rtemsbsd/src/rtems-bsd-cyclecount.c b/rtemsbsd/freebsd/machine/cpu.h
similarity index 68%
rename from rtemsbsd/src/rtems-bsd-cyclecount.c
rename to rtemsbsd/freebsd/machine/cpu.h
index 4cb9066..625cd96 100644
--- a/rtemsbsd/src/rtems-bsd-cyclecount.c
+++ b/rtemsbsd/freebsd/machine/cpu.h
@@ -15,15 +15,20 @@
  * http://www.rtems.com/license/LICENSE.
  */
 
+#ifndef _MACHINE_CPU_H_
+#define _MACHINE_CPU_H_
+
+
 #include <string.h>
 #include <stdio.h>
 #include <rtems.h>
 
-u_int64_t
+#ifdef _KERNEL
+static __inline u_int64_t
 get_cyclecount(void)
 {
-  u_int64_t value;
-  value = rtems_clock_get_ticks_since_boot();
-  return value;
+  return rtems_clock_get_ticks_since_boot();
 }
+#endif /* _KERNEL */
 
+#endif /* !MACHINE_CPU_H */




More information about the vc mailing list