]> rtime.felk.cvut.cz Git - arc.git/commitdiff
Merge with 16ca58066fba6a270838b7833397c094ec097f43
authormaek <devnull@localhost>
Wed, 20 Oct 2010 15:27:44 +0000 (17:27 +0200)
committermaek <devnull@localhost>
Wed, 20 Oct 2010 15:27:44 +0000 (17:27 +0200)
1  2 
boards/board_common.mk
system/kernel/isr.c

Simple merge
index 1788618e2aa938547af180629afbebf521d90019,7a7560151ae0615f1f792bbca0b9f2c892f2fb62..de3bdd1914dadff6897169fdd83e2cb8f450ae21
@@@ -107,39 -118,39 +118,41 @@@ void *Os_Isr( void *stack, void *isr_p 
  
        os_sys.int_nest_cnt++;
  
-       // Save info for preempted pcb
-       preempted_pcb = get_curr_pcb();
-       preempted_pcb->stack.curr = stack;
-       preempted_pcb->state = ST_READY;
-       OS_DEBUG(D_TASK,"Preempted %s\n",preempted_pcb->name);
-       Os_StackPerformCheck(preempted_pcb);
+       /* Check if we interrupted a task or ISR */
+       if( os_sys.int_nest_cnt == 1 ) {
+               /* We interrupted a task */
+               POSTTASKHOOK();
  
-       POSTTASKHOOK();
+               /* Save info for preempted pcb */
+               pPtr = get_curr_pcb();
+               pPtr->stack.curr = stack;
+               pPtr->state = ST_READY;
+               OS_DEBUG(D_TASK,"Preempted %s\n",pPtr->name);
  
-       pcb = (struct OsPcb *)pcb_p;
-       pcb->state = ST_RUNNING;
-       set_curr_pcb(pcb);
+               Os_StackPerformCheck(pPtr);
+       } else {
+               /* We interrupted an ISR */
+       }
  
-       PRETASKHOOK();
+       /* Grab the ISR "pcb" */
+       isrPtr = (struct OsPcb *)isr_p;
+       isrPtr->state = ST_RUNNING;
  
-       // We should not get here if we're NON
-       if( pcb->scheduling == NON) {
-               // TODO:
-               // assert(0);
-               while(1);
+       if( isrPtr->proc_type & ( PROC_EXTENDED | PROC_BASIC ) ) {
+               assert(0);
        }
  
 +      Irq_SOI();
 +
  #ifndef CFG_HCS12D
        Irq_Enable();
-       pcb->entry();
+       isrPtr->entry();
        Irq_Disable();
  #else
-       pcb->entry();
+       isrPtr->entry();
  #endif
  
+       /* Check so that ISR2 haven't disabled the interrupts */
        /** @req OS368 */
        if( Os_IrqAnyDisabled() ) {
                Os_IrqClearAll();