Merge with e92b4ff4b901e1ccf3540eb3b323196bea877f10

This commit is contained in:
Jens Kehne 2010-07-13 12:57:06 +02:00
commit bf8fce9cc1
2 changed files with 51 additions and 42 deletions

View File

@ -496,8 +496,12 @@ bool intctrl_t::unmask(word_t irq)
irq -= INT_LEVEL_UIC2_MIN ;
intMask = 1 << (31 - irq) ;
//Check if interrupt was already pending
if ((mfdcr(UIC2_SR) & intMask) > 0) {
mtdcr(UIC2_SR, intMask); /* clear pending interrupts */
mtdcr(UIC0_SR, uic2_dchain_mask); /* clear pending dchain */
return true;
} else {
/*
* enable the interrupt level
@ -513,7 +517,8 @@ bool intctrl_t::unmask(word_t irq)
mtdcr(UIC0_ER, uic2_dchain_mask | mfdcr(UIC0_ER));
lock.unlock(); /* re-enable interrupts */
return false;
}
}
else if (irq > INT_LEVEL_UIC0_MAX) /* For UIC1 */
#else
@ -522,8 +527,13 @@ bool intctrl_t::unmask(word_t irq)
{
irq -= INT_LEVEL_UIC1_MIN ;
intMask = 1 << (31 - irq) ;
//Check if interrupt was already pending
if ((mfdcr(UIC1_SR) & intMask) > 0) {
mtdcr(UIC1_SR, intMask); /* clear pending interrupts */
mtdcr(UIC0_SR, uic1_dchain_mask); /* clear pending dchain */
return true;
} else {
/*
* enable the interrupt level
@ -539,12 +549,18 @@ bool intctrl_t::unmask(word_t irq)
mtdcr(UIC0_ER, uic1_dchain_mask | mfdcr(UIC0_ER));
lock.unlock(); /* re-enable interrupts */
return false;
}
}
else
{
intMask = 1 << (31 - irq) ;
//Check if interrupt was already pending
if ((mfdcr(UIC0_SR) & intMask) > 0) {
mtdcr(UIC0_SR, intMask); /* clear pending interrupts */
return true;
} else {
/*
* enable the interrupt level
@ -557,10 +573,10 @@ bool intctrl_t::unmask(word_t irq)
mtdcr(UIC0_ER, intMask | mfdcr(UIC0_ER));
lock.unlock(); /* re-enable interrupts */
return false;
}
}
return true;
}
bool intctrl_t::is_masked(word_t irq) {

View File

@ -180,12 +180,6 @@ public:
*/
void handle_irq(word_t cpu);
//noncritical interrupt handler
void sysUicIntHandler(void);
//critical interrupt handler;
void sysUicCrtIntHandler(void);
/* map routine provided by glue */
void map();
@ -225,7 +219,6 @@ private:
return cpu * 8 + ipi;
}
//common interrupt handler, should not be called directly.
void sysUicIntHandlerCommon(bool intIsCritical);
void raise_irq(word_t irq);
};