]> git.kernelconcepts.de Git - karo-tx-redboot.git/blobdiff - packages/kernel/v2_0/include/mlqueue.hxx
unified MX27, MX25, MX37 trees
[karo-tx-redboot.git] / packages / kernel / v2_0 / include / mlqueue.hxx
index 88d07976cc4c0f7c59fc2fdb45e3600d5af94c20..f83e82f731a826cf5c91eeeb177cc0d8186ec19f 100644 (file)
@@ -180,8 +180,6 @@ protected:
     static cyg_ucount32 timeslice_count[CYGNUM_KERNEL_CPU_MAX]
                                         CYGBLD_ANNOTATE_VARIABLE_SCHED;
 
-    static void reset_timeslice_count();
-
 #endif
 
     Cyg_Scheduler_Implementation();     // Constructor
@@ -237,14 +235,6 @@ inline void Cyg_Scheduler_Implementation::set_need_reschedule()
     need_reschedule[CYG_KERNEL_CPU_THIS()] = true;
 }
 
-#ifdef CYGSEM_KERNEL_SCHED_TIMESLICE
-
-inline void Cyg_Scheduler_Implementation::reset_timeslice_count()
-{
-    timeslice_count[CYG_KERNEL_CPU_THIS()] = CYGNUM_KERNEL_SCHED_TIMESLICE_TICKS;
-}
-
-#endif
 
 // -------------------------------------------------------------------------
 // Scheduler thread implementation.
@@ -278,6 +268,16 @@ protected:
                                         // of its queue (not necessarily
                                         // a scheduler queue)
 
+#ifdef CYGSEM_KERNEL_SCHED_TIMESLICE
+
+    cyg_ucount32 timeslice_count;
+        
+    void timeslice_save();
+
+    void timeslice_restore();
+    
+    void timeslice_reset();
+
 #ifdef CYGSEM_KERNEL_SCHED_TIMESLICE_ENABLE
 
     // This defines whether this thread is subject to timeslicing.
@@ -291,6 +291,14 @@ public:
 
     void timeslice_disable();
     
+#endif
+
+#else
+
+    inline void timeslice_save() {};
+    inline void timeslice_restore() {};
+    inline void timeslice_reset() {};
+    
 #endif    
        
 };
@@ -298,6 +306,23 @@ public:
 // -------------------------------------------------------------------------
 // Cyg_SchedThread_Implementation inlines.
 
+#ifdef CYGSEM_KERNEL_SCHED_TIMESLICE
+
+inline void Cyg_SchedThread_Implementation::timeslice_save()
+{
+    timeslice_count = Cyg_Scheduler_Implementation::timeslice_count[CYG_KERNEL_CPU_THIS()];
+}
+
+inline void Cyg_SchedThread_Implementation::timeslice_restore()
+{
+    Cyg_Scheduler_Implementation::timeslice_count[CYG_KERNEL_CPU_THIS()] = timeslice_count;
+}
+
+inline void Cyg_SchedThread_Implementation::timeslice_reset()
+{
+    timeslice_count = CYGNUM_KERNEL_SCHED_TIMESLICE_TICKS;
+}
+
 #ifdef CYGSEM_KERNEL_SCHED_TIMESLICE_ENABLE
 
 inline void Cyg_SchedThread_Implementation::timeslice_enable()
@@ -312,6 +337,8 @@ inline void Cyg_SchedThread_Implementation::timeslice_disable()
 
 #endif
 
+#endif
+
 
 // -------------------------------------------------------------------------
 #endif // ifndef CYGONCE_KERNEL_MLQUEUE_HXX