[PATCH 5/7] score: Simplify <rtems/score/scheduler.h>

Sebastian Huber sebastian.huber at embedded-brains.de
Thu Jun 25 13:17:15 UTC 2015


Drop the <rtems/score/percpu.h> include since this file exposes a lot of
implementation details.
---
 c/src/lib/libbsp/powerpc/mvme5500/vectors/exceptionhandler.c | 1 +
 c/src/lib/libbsp/shared/clockdrv_shell.h                     | 1 +
 c/src/lib/libbsp/sparc/shared/timer/tlib_ckinit.c            | 1 +
 c/src/lib/libcpu/bfin/clock/clock.c                          | 1 +
 c/src/lib/libcpu/powerpc/mpc6xx/clock/c_clock.c              | 1 +
 c/src/lib/libcpu/powerpc/mpc6xx/mmu/pte121.c                 | 1 +
 cpukit/libcsupport/src/sync.c                                | 1 +
 cpukit/libmisc/cpuuse/cpuusagereset.c                        | 2 +-
 cpukit/sapi/include/confdefs.h                               | 1 +
 cpukit/sapi/src/profilingiterate.c                           | 1 +
 cpukit/score/cpu/arm/arm_exc_handler_high.c                  | 1 +
 cpukit/score/cpu/i386/cpu.c                                  | 1 +
 cpukit/score/include/rtems/score/scheduler.h                 | 7 ++++---
 cpukit/score/include/rtems/score/schedulersmp.h              | 2 +-
 14 files changed, 17 insertions(+), 5 deletions(-)

diff --git a/c/src/lib/libbsp/powerpc/mvme5500/vectors/exceptionhandler.c b/c/src/lib/libbsp/powerpc/mvme5500/vectors/exceptionhandler.c
index 4bd5a8a..67cd07f 100644
--- a/c/src/lib/libbsp/powerpc/mvme5500/vectors/exceptionhandler.c
+++ b/c/src/lib/libbsp/powerpc/mvme5500/vectors/exceptionhandler.c
@@ -52,6 +52,7 @@
 #include <libcpu/spr.h>
 #include <bsp/pci.h>
 #include <rtems/bspIo.h>
+#include <rtems/score/percpu.h>
 
 #include <bsp/bspException.h>
 
diff --git a/c/src/lib/libbsp/shared/clockdrv_shell.h b/c/src/lib/libbsp/shared/clockdrv_shell.h
index 628ba58..d546fb8 100644
--- a/c/src/lib/libbsp/shared/clockdrv_shell.h
+++ b/c/src/lib/libbsp/shared/clockdrv_shell.h
@@ -19,6 +19,7 @@
 
 #include <bsp.h>
 #include <rtems/clockdrv.h>
+#include <rtems/score/percpu.h>
 
 #ifdef Clock_driver_nanoseconds_since_last_tick
 #error "Update driver to use the timecounter instead of nanoseconds extension"
diff --git a/c/src/lib/libbsp/sparc/shared/timer/tlib_ckinit.c b/c/src/lib/libbsp/sparc/shared/timer/tlib_ckinit.c
index 103e9cf..b29f140 100644
--- a/c/src/lib/libbsp/sparc/shared/timer/tlib_ckinit.c
+++ b/c/src/lib/libbsp/sparc/shared/timer/tlib_ckinit.c
@@ -13,6 +13,7 @@
 
 #include <rtems.h>
 #include <rtems/timecounter.h>
+#include <rtems/score/percpu.h>
 #include <stdlib.h>
 #include <bsp.h>
 #include <bsp/tlib.h>
diff --git a/c/src/lib/libcpu/bfin/clock/clock.c b/c/src/lib/libcpu/bfin/clock/clock.c
index 787dcd6..5660f2a 100644
--- a/c/src/lib/libcpu/bfin/clock/clock.c
+++ b/c/src/lib/libcpu/bfin/clock/clock.c
@@ -14,6 +14,7 @@
 #include <rtems.h>
 #include <stdlib.h>
 #include <rtems/libio.h>
+#include <rtems/score/percpu.h>
 #include <bsp.h>
 
 #include <libcpu/cecRegs.h>
diff --git a/c/src/lib/libcpu/powerpc/mpc6xx/clock/c_clock.c b/c/src/lib/libcpu/powerpc/mpc6xx/clock/c_clock.c
index 0cb0544..e8dd30e 100644
--- a/c/src/lib/libcpu/powerpc/mpc6xx/clock/c_clock.c
+++ b/c/src/lib/libcpu/powerpc/mpc6xx/clock/c_clock.c
@@ -30,6 +30,7 @@
 #include <rtems/bspIo.h>                /* for printk() */
 #include <libcpu/powerpc-utility.h>
 #include <rtems/timecounter.h>
+#include <rtems/score/percpu.h>
 
 #include <bspopts.h>   /* for CLOCK_DRIVER_USE_FAST_IDLE */
 
diff --git a/c/src/lib/libcpu/powerpc/mpc6xx/mmu/pte121.c b/c/src/lib/libcpu/powerpc/mpc6xx/mmu/pte121.c
index 1e0c665..f6e9f42 100644
--- a/c/src/lib/libcpu/powerpc/mpc6xx/mmu/pte121.c
+++ b/c/src/lib/libcpu/powerpc/mpc6xx/mmu/pte121.c
@@ -63,6 +63,7 @@
 #ifndef DEBUG_MAIN
 #include <rtems.h>
 #include <rtems/bspIo.h>
+#include <rtems/score/percpu.h>
 #include <libcpu/cpuIdent.h>
 #include <libcpu/spr.h>
 #ifdef	DEBUG_EXC
diff --git a/cpukit/libcsupport/src/sync.c b/cpukit/libcsupport/src/sync.c
index 9f6e31b..214e42c 100644
--- a/cpukit/libcsupport/src/sync.c
+++ b/cpukit/libcsupport/src/sync.c
@@ -29,6 +29,7 @@ int fdatasync(int);        /* still not always prototyped */
 #include <stdio.h>
 
 #include <rtems.h>
+#include <rtems/score/percpu.h>
 
 /* XXX check standards -- Linux version appears to be void */
 void _fwalk(struct _reent *, void *);
diff --git a/cpukit/libmisc/cpuuse/cpuusagereset.c b/cpukit/libmisc/cpuuse/cpuusagereset.c
index e6c429e..8e9fe54 100644
--- a/cpukit/libmisc/cpuuse/cpuusagereset.c
+++ b/cpukit/libmisc/cpuuse/cpuusagereset.c
@@ -19,7 +19,7 @@
 #endif
 
 #include <rtems/cpuuse.h>
-#include <rtems/score/thread.h>
+#include <rtems/score/percpu.h>
 #include <rtems/score/todimpl.h>
 #include <rtems/score/watchdogimpl.h>
 
diff --git a/cpukit/sapi/include/confdefs.h b/cpukit/sapi/include/confdefs.h
index 70ad854..8115a85 100644
--- a/cpukit/sapi/include/confdefs.h
+++ b/cpukit/sapi/include/confdefs.h
@@ -27,6 +27,7 @@
  */
 #include <rtems.h>
 #include <rtems/score/apimutex.h>
+#include <rtems/score/percpu.h>
 #include <rtems/score/wkspace.h>
 
 #ifdef CONFIGURE_DISABLE_BSP_SETTINGS
diff --git a/cpukit/sapi/src/profilingiterate.c b/cpukit/sapi/src/profilingiterate.c
index 0fd96fa..9ec46fc 100644
--- a/cpukit/sapi/src/profilingiterate.c
+++ b/cpukit/sapi/src/profilingiterate.c
@@ -18,6 +18,7 @@
 
 #include <rtems/profiling.h>
 #include <rtems/counter.h>
+#include <rtems/score/percpu.h>
 #include <rtems/score/smplock.h>
 #include <rtems.h>
 
diff --git a/cpukit/score/cpu/arm/arm_exc_handler_high.c b/cpukit/score/cpu/arm/arm_exc_handler_high.c
index dda49db..27500f1 100644
--- a/cpukit/score/cpu/arm/arm_exc_handler_high.c
+++ b/cpukit/score/cpu/arm/arm_exc_handler_high.c
@@ -32,6 +32,7 @@
 #include <rtems/score/isr.h>
 #include <rtems/score/wkspace.h>
 #include <rtems/score/thread.h>
+#include <rtems/score/percpu.h>
 #include <rtems/score/cpu.h>
 
 #ifdef ARM_MULTILIB_ARCH_V4
diff --git a/cpukit/score/cpu/i386/cpu.c b/cpukit/score/cpu/i386/cpu.c
index 38b84e6..436c822 100644
--- a/cpukit/score/cpu/i386/cpu.c
+++ b/cpukit/score/cpu/i386/cpu.c
@@ -24,6 +24,7 @@
 #include <rtems/score/idtr.h>
 
 #include <rtems/bspIo.h>
+#include <rtems/score/percpu.h>
 #include <rtems/score/thread.h>
 
 #define I386_ASSERT_OFFSET(field, off) \
diff --git a/cpukit/score/include/rtems/score/scheduler.h b/cpukit/score/include/rtems/score/scheduler.h
index 67c6e25..5296644 100644
--- a/cpukit/score/include/rtems/score/scheduler.h
+++ b/cpukit/score/include/rtems/score/scheduler.h
@@ -19,7 +19,6 @@
 #ifndef _RTEMS_SCORE_SCHEDULER_H
 #define _RTEMS_SCORE_SCHEDULER_H
 
-#include <rtems/score/percpu.h>
 #include <rtems/score/priority.h>
 #include <rtems/score/thread.h>
 #if defined(__RTEMS_HAVE_SYS_CPUSET_H__) && defined(RTEMS_SMP)
@@ -30,6 +29,8 @@
 extern "C" {
 #endif
 
+struct Per_CPU_Control;
+
 /**
  *  @defgroup ScoreScheduler Scheduler Handler
  *
@@ -148,7 +149,7 @@ typedef struct {
   void ( *start_idle )(
     const Scheduler_Control *,
     Thread_Control *,
-    Per_CPU_Control *
+    struct Per_CPU_Control *
   );
 
 #if defined(__RTEMS_HAVE_SYS_CPUSET_H__) && defined(RTEMS_SMP)
@@ -505,7 +506,7 @@ void _Scheduler_default_Tick(
 void _Scheduler_default_Start_idle(
   const Scheduler_Control *scheduler,
   Thread_Control          *the_thread,
-  Per_CPU_Control         *cpu
+  struct Per_CPU_Control  *cpu
 );
 
 #if defined(__RTEMS_HAVE_SYS_CPUSET_H__) && defined(RTEMS_SMP)
diff --git a/cpukit/score/include/rtems/score/schedulersmp.h b/cpukit/score/include/rtems/score/schedulersmp.h
index 9e11488..c85445d 100644
--- a/cpukit/score/include/rtems/score/schedulersmp.h
+++ b/cpukit/score/include/rtems/score/schedulersmp.h
@@ -115,7 +115,7 @@ typedef struct {
 void _Scheduler_SMP_Start_idle(
   const Scheduler_Control *scheduler,
   Thread_Control *thread,
-  Per_CPU_Control *cpu
+  struct Per_CPU_Control *cpu
 );
 
 /** @} */
-- 
1.8.4.5




More information about the devel mailing list