Changeset 623ba26c in mainline


Ignore:
Timestamp:
2005-09-01T14:42:09Z (19 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.

Files:
6 edited

Legend:

Unmodified
Added
Removed
  • arch/mips/src/exception.c

    rdb3341e r623ba26c  
    3333#include <arch/types.h>
    3434#include <arch.h>
     35#include <debug.h>
    3536
    3637void exception(void)
     
    4041        __u32 epc_shift = 0;
    4142        pri_t pri;
     43
     44        ASSERT(CPU != NULL);
    4245
    4346        /*
  • include/proc/scheduler.h

    rdb3341e r623ba26c  
    4444};
    4545
    46 extern volatile int nrdy;
     46extern volatile count_t nrdy;
    4747
    4848static thread_t *find_best_thread(void);
  • src/lib/func.c

    rdb3341e r623ba26c  
    4545        haltstate = 1;
    4646        cpu_priority_high();
    47         printf("cpu%d: halted\n", CPU->id);
     47        if (CPU)
     48                printf("cpu%d: halted\n", CPU->id);
     49        else
     50                printf("cpu: halted\n");
    4851        cpu_halt();
    4952}
  • src/mm/vm.c

    rdb3341e r623ba26c  
    6767                        src_ptl0 = (pte_t *) PA2KA((__address) GET_PTL0_ADDRESS());
    6868                        dst_ptl0 = (pte_t *) frame_alloc(FRAME_KA | FRAME_PANIC);
     69
     70                        /* TODO: in theory, it should be only necessary to copy kernel address space... */
    6971                        memcpy((void *)PA2KA((__address) dst_ptl0), (void *)GET_PTL0_ADDRESS() , PAGE_SIZE);
     72
    7073                        m->ptl0 = (pte_t *) KA2PA((__address) dst_ptl0);
    7174                }
  • 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) {
  • src/proc/thread.c

    rdb3341e r623ba26c  
    137137        spinlock_unlock(&r->lock);
    138138
    139         atomic_inc(&nrdy);
     139        atomic_inc((int *) &nrdy);
    140140        avg = nrdy / config.cpu_active;
    141141
Note: See TracChangeset for help on using the changeset viewer.