]> xenbits.xensource.com Git - people/aperard/mini-os.git/commitdiff
Mini-OS: drop in_callback variable
authorJuergen Gross <jgross@suse.com>
Wed, 13 Dec 2023 09:49:54 +0000 (10:49 +0100)
committerJan Beulich <jbeulich@suse.com>
Wed, 13 Dec 2023 09:49:54 +0000 (10:49 +0100)
Now that do_hypervisor_callback() is always called with interrupts off
the in_callback variable meant to handle recursive calls of
do_hypervisor_callback() can be dropped.

Signed-off-by: Juergen Gross <jgross@suse.com>
Reviewed-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
hypervisor.c
include/hypervisor.h
sched.c

index 5309daa3486bea3c290eb340a550027b98877060..6facce3e26d58f0b282298e6422a0594e0fe3f8a 100644 (file)
@@ -37,8 +37,6 @@ EXPORT_SYMBOL(hypercall_page);
     ((sh)->evtchn_pending[idx] &                \
      ~(sh)->evtchn_mask[idx])
 
-int in_callback;
-
 #ifndef CONFIG_PARAVIRT
 extern shared_info_t shared_info;
 
@@ -104,8 +102,6 @@ void do_hypervisor_callback(struct pt_regs *regs)
 
     BUG_ON(!irqs_disabled());
 
-    in_callback = 1;
-   
     vcpu_info->evtchn_upcall_pending = 0;
     /* NB x86. No need for a barrier here -- XCHG is a barrier on x86. */
 #if !defined(__i386__) && !defined(__x86_64__)
@@ -127,8 +123,6 @@ void do_hypervisor_callback(struct pt_regs *regs)
             do_event(port, regs);
         }
     }
-
-    in_callback = 0;
 }
 
 void force_evtchn_callback(void)
index 1d092719d849328abe0a21055b7e225a627c23b7..b852a42ae0dbd719dc15bb98bea3bbaec830085c 100644 (file)
@@ -50,6 +50,4 @@ void mask_evtchn(uint32_t port);
 void unmask_evtchn(uint32_t port);
 void clear_evtchn(uint32_t port);
 
-extern int in_callback;
-
 #endif /* __HYPERVISOR_H__ */
diff --git a/sched.c b/sched.c
index e162cb60cfe7466106b76819a7e41790e7fc7eb4..3335efa044a2bb3c6b9379521f479aec6e482493 100644 (file)
--- a/sched.c
+++ b/sched.c
@@ -76,11 +76,6 @@ void schedule(void)
     prev = current;
     local_irq_save(flags); 
 
-    if (in_callback) {
-        printk("Must not call schedule() from a callback\n");
-        BUG();
-    }
-
     do {
         /* Examine all threads.
            Find a runnable thread, but also wake up expired ones and find the
@@ -151,15 +146,12 @@ struct thread* create_thread(char *name, void (*function)(void *), void *data)
 EXPORT_SYMBOL(create_thread);
 
 #ifdef HAVE_LIBC
-static struct _reent callback_reent;
 struct _reent *__getreent(void)
 {
     struct _reent *_reent;
 
     if (!threads_started)
         _reent = _impure_ptr;
-    else if (in_callback)
-        _reent = &callback_reent;
     else
         _reent = &get_current()->reent;
 
@@ -246,9 +238,6 @@ void init_sched(void)
 {
     printk("Initialising scheduler\n");
 
-#ifdef HAVE_LIBC
-    _REENT_INIT_PTR((&callback_reent))
-#endif
     idle_thread = create_thread("Idle", idle_thread_fn, NULL);
 }