]> Zhao Yanbai Git Server - minix.git/commitdiff
intr_disabled() tests removed
authorTomas Hruby <tom@minix3.org>
Tue, 9 Feb 2010 15:29:58 +0000 (15:29 +0000)
committerTomas Hruby <tom@minix3.org>
Tue, 9 Feb 2010 15:29:58 +0000 (15:29 +0000)
- we don't need to test this in kernel as we always have interrupts
  disabled

- if interrupts are enabled in kernel, it is only at very carefully
  chosen places. There are no such places now.

kernel/debug.c
kernel/debug.h
kernel/proc.c
kernel/proc.h
kernel/system/do_irqctl.c
kernel/vm.h

index 6dd91e1accd5f7ad4ae3d5f908cdcfff6ea059b6..8d9d21489ca989f61c82f278bcb4ffb1f12552cd 100644 (file)
@@ -21,10 +21,6 @@ check_runqueues_f(char *file, int line)
   int q, l = 0;
   register struct proc *xp;
 
-  if(!intr_disabled()) {
-       minix_panic("check_runqueues called with interrupts enabled", NO_NUM);
-  }
-
   FIXME("check_runqueues being done");
 
 #define MYPANIC(msg) {         \
index 9ba7a119d67e6f1ff9f648a21b50ec9e65bdd094..866e342118a1d1b3413889ce8110c3cd4b970332 100644 (file)
@@ -52,7 +52,6 @@
        varname = ENTERED;
 
 #define NOREC_RETURN(varname, v) do {                          \
-       vmassert(intr_disabled());                              \
        vmassert(magictest == MAGICTEST);                       \
        vmassert(varname == ENTERED || varname == NOTENTERED);  \
        varname = NOTENTERED;                                   \
index 01e878ef51420e99fa1191b8d2dd8fbb90f0cd9f..5e957767f88abe9b882c33e2166f5a6fa663dd6a 100644 (file)
@@ -154,7 +154,6 @@ PUBLIC struct proc * schedcheck(void)
         * to be scheduled again.
         */
        NOREC_ENTER(schedch);
-       vmassert(intr_disabled());
 
        /*
         * if the current process is still runnable check the misc flags and let
@@ -784,8 +783,6 @@ endpoint_t dst_e;                   /* which process to notify */
   int r;
   int dst_p;
 
-  vmassert(intr_disabled());
-
   if (!isokendpt(dst_e, &dst_p)) {
        util_stacktrace();
        kprintf("mini_notify: bogus endpoint %d\n", dst_e);
@@ -1178,7 +1175,6 @@ register struct proc *rp; /* this process is now runnable */
   NOREC_ENTER(enqueuefunc);
 
 #if DEBUG_SCHED_CHECK
-  if(!intr_disabled()) { minix_panic("enqueue with interrupts enabled", NO_NUM); }
   if (rp->p_ready) minix_panic("enqueue already ready process", NO_NUM);
 #endif
 
@@ -1238,7 +1234,6 @@ PRIVATE void enqueue_head(struct proc *rp)
   int q;                                       /* scheduling queue to use */
 
 #if DEBUG_SCHED_CHECK
-  if(!intr_disabled()) { minix_panic("enqueue with interrupts enabled", NO_NUM); }
   if (rp->p_ready) minix_panic("enqueue already ready process", NO_NUM);
 #endif
 
@@ -1292,7 +1287,6 @@ register struct proc *rp; /* this process is no longer runnable */
 #endif
 
 #if DEBUG_SCHED_CHECK
-  if(!intr_disabled()) { minix_panic("dequeue with interrupts enabled", NO_NUM); }
   if (! rp->p_ready) minix_panic("dequeue() already unready process", NO_NUM);
 #endif
 
@@ -1404,8 +1398,6 @@ timer_t *tp;                                      /* watchdog timer pointer */
   clock_t next_period;                         /* time of next period  */
   int ticks_added = 0;                         /* total time added */
 
-  vmassert(!intr_disabled());
-
   for (rp=BEG_PROC_ADDR; rp<END_PROC_ADDR; rp++) {
       if (! isemptyp(rp)) {                            /* check slot use */
          if (rp->p_priority > rp->p_max_priority) {    /* update priority? */
index 7c2f1a58afebd42d876fc8026b65a3694176d424..467bfbe8b94b5bef452d49da6652e80414e7315f 100644 (file)
@@ -163,23 +163,19 @@ struct proc {
 /* Set flag and dequeue if the process was runnable. */
 #define RTS_SET(rp, f)                                                 \
        do {                                                            \
-               vmassert(intr_disabled());                              \
                if(proc_is_runnable(rp)) { dequeue(rp); }               \
                (rp)->p_rts_flags |=  (f);                              \
-               vmassert(intr_disabled());                              \
        } while(0)
 
 /* Clear flag and enqueue if the process was not runnable but is now. */
 #define RTS_UNSET(rp, f)                                               \
        do {                                                            \
                int rts;                                                \
-               vmassert(intr_disabled());                              \
                rts = (rp)->p_rts_flags;                                \
                (rp)->p_rts_flags &= ~(f);                              \
                if(!rts_f_is_runnable(rts) && proc_is_runnable(rp)) {   \
                        enqueue(rp);                                    \
                }                                                       \
-               vmassert(intr_disabled());                              \
        } while(0)
 
 /* Set flags to this value. */
index 75f31c39bc053da2ccd706ebb240843f9be3ae97..c165075706677ff1a268db76c77b5c52b0cd0019 100644 (file)
@@ -137,8 +137,6 @@ irq_hook_t *hook;
  */
   int proc_nr;
 
-  vmassert(intr_disabled());
-
   /* As a side-effect, the interrupt handler gathers random information by 
    * timestamping the interrupt events. This is used for /dev/random.
    */
@@ -158,7 +156,6 @@ irq_hook_t *hook;
   priv(proc_addr(proc_nr))->s_int_pending |= (1 << hook->notify_id);
 
   /* Build notification message and return. */
-  vmassert(intr_disabled());
   mini_notify(proc_addr(HARDWARE), hook->proc_nr_e);
   return(hook->policy & IRQ_REENABLE);
 }
index 5587ef76ca37dbe77a69a14d2a83edc0df51f75a..43461e68f2f9926c778de90dea43bdfc64ad9cd7 100644 (file)
@@ -10,7 +10,6 @@
 #define FIXLINMSG(prp) { prp->p_delivermsg_lin = umap_local(prp, D, prp->p_delivermsg_vir, sizeof(message)); }
 
 #define PHYS_COPY_CATCH(src, dst, size, a) {   \
-       vmassert(intr_disabled());              \
        catch_pagefaults++;                     \
        a = phys_copy(src, dst, size);          \
        catch_pagefaults--;                     \