aboutsummaryrefslogtreecommitdiffstats
path: root/os/rt
diff options
context:
space:
mode:
authorGiovanni Di Sirio <gdisirio@gmail.com>2017-11-27 10:22:40 +0000
committerGiovanni Di Sirio <gdisirio@gmail.com>2017-11-27 10:22:40 +0000
commit71ccd7eb14c4cb3cc4362feda7adc19ec2fd0ff8 (patch)
treee136d0d671a42cf67fd79853385bd6a100468b61 /os/rt
parent56a33f50edb32b44b68125c961ae9125431b7965 (diff)
downloadChibiOS-71ccd7eb14c4cb3cc4362feda7adc19ec2fd0ff8.tar.gz
ChibiOS-71ccd7eb14c4cb3cc4362feda7adc19ec2fd0ff8.tar.bz2
ChibiOS-71ccd7eb14c4cb3cc4362feda7adc19ec2fd0ff8.zip
Renamed thread field "preempt" in "ticks" for clearness.
git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@11079 35acf78f-673a-0410-8e92-d51de3d6d3f4
Diffstat (limited to 'os/rt')
-rw-r--r--os/rt/include/chschd.h4
-rw-r--r--os/rt/include/chvt.h6
-rw-r--r--os/rt/src/chregistry.c2
-rw-r--r--os/rt/src/chschd.c10
-rw-r--r--os/rt/src/chsys.c4
-rw-r--r--os/rt/src/chthreads.c2
6 files changed, 14 insertions, 14 deletions
diff --git a/os/rt/include/chschd.h b/os/rt/include/chschd.h
index f62f6d709..c5cc00b22 100644
--- a/os/rt/include/chschd.h
+++ b/os/rt/include/chschd.h
@@ -181,7 +181,7 @@ struct ch_thread {
* @brief Number of ticks remaining to this thread.
*/
#if (CH_CFG_TIME_QUANTUM > 0) || defined(__DOXYGEN__)
- tslices_t preempt;
+ tslices_t ticks;
#endif
#if (CH_DBG_THREADS_PROFILING == TRUE) || defined(__DOXYGEN__)
/**
@@ -694,7 +694,7 @@ static inline void chSchPreemption(void) {
tprio_t p2 = currp->prio;
#if CH_CFG_TIME_QUANTUM > 0
- if (currp->preempt > (tslices_t)0) {
+ if (currp->ticks > (tslices_t)0) {
if (p1 > p2) {
chSchDoRescheduleAhead();
}
diff --git a/os/rt/include/chvt.h b/os/rt/include/chvt.h
index 2102df345..412540c07 100644
--- a/os/rt/include/chvt.h
+++ b/os/rt/include/chvt.h
@@ -45,9 +45,9 @@
"be zero or greater than one"
#endif
-#if (CH_CFG_ST_TIMEDELTA > 0) && (CH_CFG_TIME_QUANTUM > 0)
-#error "CH_CFG_TIME_QUANTUM not supported in tickless mode"
-#endif
+//#if (CH_CFG_ST_TIMEDELTA > 0) && (CH_CFG_TIME_QUANTUM > 0)
+//#error "CH_CFG_TIME_QUANTUM not supported in tickless mode"
+//#endif
#if (CH_CFG_ST_TIMEDELTA > 0) && (CH_DBG_THREADS_PROFILING == TRUE)
#error "CH_DBG_THREADS_PROFILING not supported in tickless mode"
diff --git a/os/rt/src/chregistry.c b/os/rt/src/chregistry.c
index 7be0939c8..217e47bfd 100644
--- a/os/rt/src/chregistry.c
+++ b/os/rt/src/chregistry.c
@@ -108,7 +108,7 @@ ROMCONST chdebug_t ch_debug = {
(uint8_t)0,
#endif
#if CH_CFG_TIME_QUANTUM > 0
- (uint8_t)_offsetof(thread_t, preempt),
+ (uint8_t)_offsetof(thread_t, ticks),
#else
(uint8_t)0,
#endif
diff --git a/os/rt/src/chschd.c b/os/rt/src/chschd.c
index 62ca81d50..2efc14329 100644
--- a/os/rt/src/chschd.c
+++ b/os/rt/src/chschd.c
@@ -297,7 +297,7 @@ void chSchGoSleepS(tstate_t newstate) {
#if CH_CFG_TIME_QUANTUM > 0
/* The thread is renouncing its remaining time slices so it will have a new
time quantum when it will wakeup.*/
- otp->preempt = (tslices_t)CH_CFG_TIME_QUANTUM;
+ otp->ticks = (tslices_t)CH_CFG_TIME_QUANTUM;
#endif
/* Next thread in ready list becomes current.*/
@@ -485,7 +485,7 @@ bool chSchIsPreemptionRequired(void) {
if the first thread on the ready queue has a higher priority.
Otherwise, if the running thread has used up its time quantum, reschedule
if the first thread on the ready queue has equal or higher priority.*/
- return (currp->preempt > (tslices_t)0) ? (p1 > p2) : (p1 >= p2);
+ return (currp->ticks > (tslices_t)0) ? (p1 > p2) : (p1 >= p2);
#else
/* If the round robin preemption feature is not enabled then performs a
simpler comparison.*/
@@ -518,7 +518,7 @@ void chSchDoRescheduleBehind(void) {
#if CH_CFG_TIME_QUANTUM > 0
/* It went behind peers so it gets a new time quantum.*/
- otp->preempt = (tslices_t)CH_CFG_TIME_QUANTUM;
+ otp->ticks = (tslices_t)CH_CFG_TIME_QUANTUM;
#endif
/* Placing in ready list behind peers.*/
@@ -582,14 +582,14 @@ void chSchDoReschedule(void) {
#if CH_CFG_TIME_QUANTUM > 0
/* If CH_CFG_TIME_QUANTUM is enabled then there are two different scenarios
to handle on preemption: time quantum elapsed or not.*/
- if (currp->preempt == (tslices_t)0) {
+ if (currp->ticks == (tslices_t)0) {
/* The thread consumed its time quantum so it is enqueued behind threads
with same priority level, however, it acquires a new time quantum.*/
otp = chSchReadyI(otp);
/* The thread being swapped out receives a new time quantum.*/
- otp->preempt = (tslices_t)CH_CFG_TIME_QUANTUM;
+ otp->ticks = (tslices_t)CH_CFG_TIME_QUANTUM;
}
else {
/* The thread didn't consume all its time quantum so it is put ahead of
diff --git a/os/rt/src/chsys.c b/os/rt/src/chsys.c
index 624c478ac..94b4d51c4 100644
--- a/os/rt/src/chsys.c
+++ b/os/rt/src/chsys.c
@@ -344,9 +344,9 @@ void chSysTimerHandlerI(void) {
#if CH_CFG_TIME_QUANTUM > 0
/* Running thread has not used up quantum yet? */
- if (currp->preempt > (tslices_t)0) {
+ if (currp->ticks > (tslices_t)0) {
/* Decrement remaining quantum.*/
- currp->preempt--;
+ currp->ticks--;
}
#endif
#if CH_DBG_THREADS_PROFILING == TRUE
diff --git a/os/rt/src/chthreads.c b/os/rt/src/chthreads.c
index 84a062b86..fcd6aefe3 100644
--- a/os/rt/src/chthreads.c
+++ b/os/rt/src/chthreads.c
@@ -91,7 +91,7 @@ thread_t *_thread_init(thread_t *tp, const char *name, tprio_t prio) {
tp->state = CH_STATE_WTSTART;
tp->flags = CH_FLAG_MODE_STATIC;
#if CH_CFG_TIME_QUANTUM > 0
- tp->preempt = (tslices_t)CH_CFG_TIME_QUANTUM;
+ tp->ticks = (tslices_t)CH_CFG_TIME_QUANTUM;
#endif
#if CH_CFG_USE_MUTEXES == TRUE
tp->realprio = prio;