Optimization in chSchWakeupS().

git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@9172 35acf78f-673a-0410-8e92-d51de3d6d3f4
master
Giovanni Di Sirio 2016-03-27 14:30:20 +00:00
parent 3d82d232b7
commit 307d87bdec
2 changed files with 7 additions and 6 deletions

View File

@ -2,7 +2,7 @@
*** ChibiOS/RT test suite
***
*** Kernel: 4.0.0
*** Compiled: Mar 27 2016 - 12:48:29
*** Compiled: Mar 27 2016 - 16:28:00
*** Compiler: GCC 4.9.3 20150529 (release) [ARM/embedded-4_9-branch revision 227977]
*** Architecture: ARMv7E-M
*** Core Variant: Cortex-M7
@ -93,7 +93,7 @@
--- Result: SUCCESS
----------------------------------------------------------------------------
--- Test Case 11.1 (Benchmark, messages #1)
--- Score : 1018858 msgs/S, 2037716 ctxswc/S
--- Score : 1023687 msgs/S, 2047374 ctxswc/S
--- Result: SUCCESS
----------------------------------------------------------------------------
--- Test Case 11.2 (Benchmark, messages #2)
@ -105,7 +105,7 @@
--- Result: SUCCESS
----------------------------------------------------------------------------
--- Test Case 11.4 (Benchmark, context switch)
--- Score : 4951264 ctxswc/S
--- Score : 5008664 ctxswc/S
--- Result: SUCCESS
----------------------------------------------------------------------------
--- Test Case 11.5 (Benchmark, threads, full cycle)
@ -113,7 +113,7 @@
--- Result: SUCCESS
----------------------------------------------------------------------------
--- Test Case 11.6 (Benchmark, threads, create only)
--- Score : 892556 threads/S
--- Score : 896259 threads/S
--- Result: SUCCESS
----------------------------------------------------------------------------
--- Test Case 11.7 (Benchmark, mass reschedule, 5 threads)

View File

@ -406,6 +406,7 @@ msg_t chSchGoSleepTimeoutS(tstate_t newstate, systime_t time) {
* @sclass
*/
void chSchWakeupS(thread_t *ntp, msg_t msg) {
thread_t *otp = currp;
chDbgCheckClassS();
@ -421,12 +422,12 @@ void chSchWakeupS(thread_t *ntp, msg_t msg) {
one then it is just inserted in the ready list else it made
running immediately and the invoking thread goes in the ready
list instead.*/
if (ntp->prio <= currp->prio) {
if (ntp->prio <= otp->prio) {
(void) chSchReadyI(ntp);
}
else {
thread_t *otp = chSchReadyI(currp);
currp = ntp;
otp = chSchReadyI(otp);
if (otp->prio == IDLEPRIO) {
CH_CFG_IDLE_LEAVE_HOOK();
}