Changeset 623ba26c in mainline for src/proc/scheduler.c


Ignore:
Timestamp:
2005-09-01T14:42:09Z (20 years ago)
Author:
Jakub Jermar <jakub@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
e83a9f7
Parents:
db3341e
Message:

Add couple of assertions CPU != NULL.

Change type of nrdy from int to count_t.

Rewrite halt() to avoid page fault when CPU == NULL.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/proc/scheduler.c

    rdb3341e r623ba26c  
    4747#include <mm/frame.h>
    4848#include <mm/heap.h>
    49 
    50 
    51 volatile int nrdy;
     49#include <debug.h>
     50
     51volatile count_t nrdy;
    5252
    5353
     
    9090        runq_t *r;
    9191        int i, n;
     92
     93        ASSERT(CPU != NULL);
    9294
    9395loop:
     
    148150                spinlock_unlock(&CPU->lock);
    149151
    150                 atomic_dec(&nrdy);
     152                atomic_dec((int *) &nrdy);
    151153                r->n--;
    152154
     
    230232        volatile pri_t pri;
    231233
     234        ASSERT(CPU != NULL);
     235
    232236        pri = cpu_priority_high();
    233237
     
    292296{
    293297        int priority;
     298
     299        ASSERT(CPU != NULL);
    294300
    295301        if (THREAD) {
Note: See TracChangeset for help on using the changeset viewer.