From 5fc58f14515839a543a8d4e8d59b12a45634eb74 Mon Sep 17 00:00:00 2001 From: Petr Benes Date: Tue, 3 May 2011 12:23:26 +0200 Subject: [PATCH] Added RTEMS patch --- rtems-patches/290411.diff | 145 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 145 insertions(+) create mode 100644 rtems-patches/290411.diff diff --git a/rtems-patches/290411.diff b/rtems-patches/290411.diff new file mode 100644 index 0000000..9a7da60 --- /dev/null +++ b/rtems-patches/290411.diff @@ -0,0 +1,145 @@ +diff --git a/cpukit/score/include/rtems/score/scheduler.h b/cpukit/score/include/rtems/score/scheduler.h +index 0d07a9a..a241768 100644 +--- a/cpukit/score/include/rtems/score/scheduler.h ++++ b/cpukit/score/include/rtems/score/scheduler.h +@@ -74,6 +74,10 @@ typedef struct { + + /** extract a thread from the ready set */ + void ( *extract )(Thread_Control *); ++ ++ /** compares two priorities (returns 1 for p1>p2, 0 for p1==p2 ++ * and -1 for p1 p2) return 1; ++ else if (p1 < p2) return -1; ++ else return 0; ++} ++ ++ ++ + /**@}*/ + + #endif +diff --git a/cpukit/score/src/coremutexseize.c b/cpukit/score/src/coremutexseize.c +index b692d0f..0f62659 100644 +--- a/cpukit/score/src/coremutexseize.c ++++ b/cpukit/score/src/coremutexseize.c +@@ -61,7 +61,7 @@ void _CORE_mutex_Seize_interrupt_blocking( + + executing = _Thread_Executing; + if ( _CORE_mutex_Is_inherit_priority( &the_mutex->Attributes ) ) { +- if ( the_mutex->holder->current_priority > executing->current_priority ) { ++ if ( _Scheduler_Priority_compare(the_mutex->holder->current_priority, executing->current_priority) == 1 ) { + _Thread_Change_priority( + the_mutex->holder, + executing->current_priority, +diff --git a/cpukit/score/src/schedulerpriorityprioritycompare.c b/cpukit/score/src/schedulerpriorityprioritycompare.c +new file mode 100644 +index 0000000..8bf86d4 +--- /dev/null ++++ b/cpukit/score/src/schedulerpriorityprioritycompare.c +@@ -0,0 +1,28 @@ ++/* Scheduler Simple Handler / Priority compare ++ * ++ * COPYRIGHT (c) 2011. ++ * On-Line Applications Research Corporation (OAR). ++ * ++ * The license and distribution terms for this file may be ++ * found in the file LICENSE in this distribution or at ++ * http://www.rtems.com/license/LICENSE. ++ * ++ * $Id: schedulerpriorityprioritycompare.c,v 1.2 2011/02/28 00:10:38 joel Exp $ ++ */ ++ ++#if HAVE_CONFIG_H ++#include "config.h" ++#endif ++ ++#include ++#include ++#include ++#include ++ ++void _Scheduler_priority_Priority_compare( ++ Priority_Control p1, ++ Priority_Control p2 ++) ++{ ++ _Scheduler_priority_Priority_compare_body( p1, p2 ); ++} -- 2.39.2