summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authordufault <dufault@FreeBSD.org>1998-03-04 10:25:03 +0000
committerdufault <dufault@FreeBSD.org>1998-03-04 10:25:03 +0000
commit324217201dfb78235f56aa6d4c31dae81584ed51 (patch)
tree6a827ae8825cba5dbec493b37aa2cd2bb999e0cb
parent544e71fc32aa58d68443fad3718cd218fedd8b72 (diff)
downloadFreeBSD-src-324217201dfb78235f56aa6d4c31dae81584ed51.zip
FreeBSD-src-324217201dfb78235f56aa6d4c31dae81584ed51.tar.gz
Reviewed by: msmith, bde long ago
Fix for RTPRIO scheduler to eliminate invalid context switches.
-rw-r--r--sys/amd64/amd64/cpu_switch.S16
-rw-r--r--sys/amd64/amd64/swtch.s16
-rw-r--r--sys/i386/i386/swtch.s16
3 files changed, 39 insertions, 9 deletions
diff --git a/sys/amd64/amd64/cpu_switch.S b/sys/amd64/amd64/cpu_switch.S
index 74ee53c..7a63d34 100644
--- a/sys/amd64/amd64/cpu_switch.S
+++ b/sys/amd64/amd64/cpu_switch.S
@@ -33,10 +33,11 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: swtch.s,v 1.67 1998/02/04 22:32:11 eivind Exp $
+ * $Id: swtch.s,v 1.68 1998/02/06 12:13:10 eivind Exp $
*/
#include "npx.h"
+#include "opt_posix4.h"
#include "opt_user_ldt.h"
#include "opt_vm86.h"
@@ -112,7 +113,11 @@ set1:
movzwl P_RTPRIO_PRIO(%eax),%edx
- cmpw $RTP_PRIO_REALTIME,P_RTPRIO_TYPE(%eax) /* realtime priority? */
+ cmpw $RTP_PRIO_REALTIME,P_RTPRIO_TYPE(%eax) /* RR realtime priority? */
+#ifdef POSIX4
+ je set_rt /* RT priority */
+ cmpw $RTP_PRIO_FIFO,P_RTPRIO_TYPE(%eax) /* FIFO realtime priority? */
+#endif
jne set_id /* must be idle priority */
set_rt:
@@ -164,9 +169,14 @@ ENTRY(remrq)
movzwl P_RTPRIO_PRIO(%eax),%edx
- cmpw $RTP_PRIO_REALTIME,P_RTPRIO_TYPE(%eax) /* normal priority process? */
+ cmpw $RTP_PRIO_REALTIME,P_RTPRIO_TYPE(%eax) /* realtime priority process? */
+#ifdef POSIX4
+ je rem0rt
+ cmpw $RTP_PRIO_FIFO,P_RTPRIO_TYPE(%eax) /* FIFO realtime priority process? */
+#endif
jne rem_id
+rem0rt:
btrl %edx,_whichrtqs /* clear full bit, panic if clear already */
jb rem1rt
pushl $rem3rt
diff --git a/sys/amd64/amd64/swtch.s b/sys/amd64/amd64/swtch.s
index 74ee53c..7a63d34 100644
--- a/sys/amd64/amd64/swtch.s
+++ b/sys/amd64/amd64/swtch.s
@@ -33,10 +33,11 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: swtch.s,v 1.67 1998/02/04 22:32:11 eivind Exp $
+ * $Id: swtch.s,v 1.68 1998/02/06 12:13:10 eivind Exp $
*/
#include "npx.h"
+#include "opt_posix4.h"
#include "opt_user_ldt.h"
#include "opt_vm86.h"
@@ -112,7 +113,11 @@ set1:
movzwl P_RTPRIO_PRIO(%eax),%edx
- cmpw $RTP_PRIO_REALTIME,P_RTPRIO_TYPE(%eax) /* realtime priority? */
+ cmpw $RTP_PRIO_REALTIME,P_RTPRIO_TYPE(%eax) /* RR realtime priority? */
+#ifdef POSIX4
+ je set_rt /* RT priority */
+ cmpw $RTP_PRIO_FIFO,P_RTPRIO_TYPE(%eax) /* FIFO realtime priority? */
+#endif
jne set_id /* must be idle priority */
set_rt:
@@ -164,9 +169,14 @@ ENTRY(remrq)
movzwl P_RTPRIO_PRIO(%eax),%edx
- cmpw $RTP_PRIO_REALTIME,P_RTPRIO_TYPE(%eax) /* normal priority process? */
+ cmpw $RTP_PRIO_REALTIME,P_RTPRIO_TYPE(%eax) /* realtime priority process? */
+#ifdef POSIX4
+ je rem0rt
+ cmpw $RTP_PRIO_FIFO,P_RTPRIO_TYPE(%eax) /* FIFO realtime priority process? */
+#endif
jne rem_id
+rem0rt:
btrl %edx,_whichrtqs /* clear full bit, panic if clear already */
jb rem1rt
pushl $rem3rt
diff --git a/sys/i386/i386/swtch.s b/sys/i386/i386/swtch.s
index 74ee53c..7a63d34 100644
--- a/sys/i386/i386/swtch.s
+++ b/sys/i386/i386/swtch.s
@@ -33,10 +33,11 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: swtch.s,v 1.67 1998/02/04 22:32:11 eivind Exp $
+ * $Id: swtch.s,v 1.68 1998/02/06 12:13:10 eivind Exp $
*/
#include "npx.h"
+#include "opt_posix4.h"
#include "opt_user_ldt.h"
#include "opt_vm86.h"
@@ -112,7 +113,11 @@ set1:
movzwl P_RTPRIO_PRIO(%eax),%edx
- cmpw $RTP_PRIO_REALTIME,P_RTPRIO_TYPE(%eax) /* realtime priority? */
+ cmpw $RTP_PRIO_REALTIME,P_RTPRIO_TYPE(%eax) /* RR realtime priority? */
+#ifdef POSIX4
+ je set_rt /* RT priority */
+ cmpw $RTP_PRIO_FIFO,P_RTPRIO_TYPE(%eax) /* FIFO realtime priority? */
+#endif
jne set_id /* must be idle priority */
set_rt:
@@ -164,9 +169,14 @@ ENTRY(remrq)
movzwl P_RTPRIO_PRIO(%eax),%edx
- cmpw $RTP_PRIO_REALTIME,P_RTPRIO_TYPE(%eax) /* normal priority process? */
+ cmpw $RTP_PRIO_REALTIME,P_RTPRIO_TYPE(%eax) /* realtime priority process? */
+#ifdef POSIX4
+ je rem0rt
+ cmpw $RTP_PRIO_FIFO,P_RTPRIO_TYPE(%eax) /* FIFO realtime priority process? */
+#endif
jne rem_id
+rem0rt:
btrl %edx,_whichrtqs /* clear full bit, panic if clear already */
jb rem1rt
pushl $rem3rt
OpenPOWER on IntegriCloud