From 8f4349ee5191c34e00977e8913e9024a38a1f035 Mon Sep 17 00:00:00 2001 From: Stefan Lankes Date: Sun, 9 Oct 2011 21:03:31 -0700 Subject: [PATCH] minor optimizations --- arch/x86/kernel/irq.c | 8 +------- arch/x86/scc/icc.c | 29 ++++++++++++++++------------- include/metalsvm/tasks.h | 14 +++++++++++--- 3 files changed, 28 insertions(+), 23 deletions(-) diff --git a/arch/x86/kernel/irq.c b/arch/x86/kernel/irq.c index 91692f4b..053cfa89 100644 --- a/arch/x86/kernel/irq.c +++ b/arch/x86/kernel/irq.c @@ -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 diff --git a/arch/x86/scc/icc.c b/arch/x86/scc/icc.c index 7cd2bf80..65d7ef62 100644 --- a/arch/x86/scc/icc.c +++ b/arch/x86/scc/icc.c @@ -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; } diff --git a/include/metalsvm/tasks.h b/include/metalsvm/tasks.h index fa3b395f..cc5f59f1 100644 --- a/include/metalsvm/tasks.h +++ b/include/metalsvm/tasks.h @@ -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