bug-hurd
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH 3/5 gnumach] sched_prim.c: Add missing MACH_HOST pset conditional


From: Damien Zammit
Subject: [PATCH 3/5 gnumach] sched_prim.c: Add missing MACH_HOST pset conditionals
Date: Wed, 16 Aug 2023 01:49:14 +0000

---
 kern/sched_prim.c | 29 +++++++++++++++++++----------
 1 file changed, 19 insertions(+), 10 deletions(-)

diff --git a/kern/sched_prim.c b/kern/sched_prim.c
index 5ee0791b..5def77d4 100644
--- a/kern/sched_prim.c
+++ b/kern/sched_prim.c
@@ -510,6 +510,13 @@ static thread_t thread_select(
        processor_t myprocessor)
 {
        thread_t thread;
+       processor_set_t pset;
+
+#if    MACH_HOST
+       pset = myprocessor->processor_set;
+#else  /* MACH_HOST */
+       pset = &default_pset;
+#endif /* MACH_HOST */
 
        myprocessor->first_quantum = TRUE;
        /*
@@ -520,13 +527,6 @@ static thread_t thread_select(
                thread = choose_thread(myprocessor);
        }
        else {
-               processor_set_t pset;
-
-#if    MACH_HOST
-               pset = myprocessor->processor_set;
-#else  /* MACH_HOST */
-               pset = &default_pset;
-#endif /* MACH_HOST */
                simple_lock(&pset->runq.lock);
 #if    DEBUG
                checkrq(&pset->runq, "thread_select");
@@ -1259,7 +1259,11 @@ void thread_setrun(
            /*
             *  Not bound, any processor in the processor set is ok.
             */
+#if    MACH_HOST
            pset = th->processor_set;
+#else
+           pset = &default_pset;
+#endif /* MACH_HOST */
 #if    HW_FOOTPRINT
            /*
             *  But first check the last processor it ran on.
@@ -1543,9 +1547,11 @@ thread_t choose_thread(
            /*NOTREACHED*/
        }
        simple_unlock(&runq->lock);
-
+#if    MACH_HOST
        pset = myprocessor->processor_set;
-
+#else
+       pset = &default_pset;
+#endif
        simple_lock(&pset->runq.lock);
        return choose_pset_thread(myprocessor,pset);
 }
@@ -1752,8 +1758,11 @@ retry:
                }
                else if (state == PROCESSOR_IDLE) {
                        processor_set_t pset;
-
+#if    MACH_HOST
                        pset = myprocessor->processor_set;
+#else
+                       pset = &default_pset;
+#endif /* MACH_HOST */
                        simple_lock(&pset->idle_lock);
                        if (myprocessor->state != PROCESSOR_IDLE) {
                                /*
-- 
2.40.1





reply via email to

[Prev in Thread] Current Thread [Next in Thread]