minor optimizations

This commit is contained in:
Stefan Lankes 2011-10-09 21:03:31 -07:00
parent 8e6b00b42e
commit 8f4349ee51
3 changed files with 28 additions and 23 deletions

View file

@ -234,13 +234,7 @@ void irq_handler(struct state *s)
/* This is a blank function pointer */
void (*handler) (struct state * s);
#ifdef CONFIG_ROCKCREEK
// evaluate only irq status register if int_no = 124
if( s->int_no != 124 )
check_workqueues();
#else
check_workqueues();
#endif
check_workqueues_with_irq(s->int_no);
/*
* Find out if we have a custom handler to run for this

View file

@ -133,21 +133,24 @@ static void icc_handler(struct state *s)
rckemacif_handler(s, status_low);
#endif
/* determine interrupt sources */
status = status_low;
status >>= 6; // shift emac bits
if ((status_low >> 6) || status_high)
{
/* determine interrupt sources */
status = status_low;
status >>= 6; // shift emac bits
for (source=0; status!=0; status >>= 1, ++source) {
if ( (status & 0x1) != 0 ) {
iRCCE_mail_check(source);
for (source=0; status!=0; status >>= 1, ++source) {
if ( (status & 0x1) != 0 ) {
iRCCE_mail_check(source);
}
}
}
for (source=26, status=status_high; status!=0; status >>= 1, ++source) {
if ( (status & 0x1) != 0 ) {
iRCCE_mail_check(source);
for (source=26, status=status_high; status!=0; status >>= 1, ++source) {
if ( (status & 0x1) != 0 ) {
iRCCE_mail_check(source);
}
}
}
} else iRCCE_mail_check(iRCCE_MAILBOX_ALL);
tmp=ReadConfigReg(CRB_OWN + (z==0 ? GLCFG0 : GLCFG1));
tmp &= ~2;
@ -293,9 +296,9 @@ int icc_init(void)
int icc_halt(void)
{
icc_mail_check();
NOP1;
//NOP1;
//HALT;
HALT;
return 0;
}

View file

@ -200,12 +200,20 @@ uint32_t get_highest_priority(void);
*/
void reschedule(void);
static inline void check_workqueues(void)
static inline void check_workqueues_with_irq(int irq)
{
#ifdef CONFIG_ROCKCREEK
icc_mail_check();
if (irq != 124)
icc_mail_check();
#endif
check_scheduling();
if (irq < 0)
check_scheduling();
}
static inline void check_workqueues(void)
{
// call with invalid interrupt number
check_workqueues_with_irq(-1);
}
#ifdef __cplusplus