diff --git a/arch/x86/scc/icc.c b/arch/x86/scc/icc.c index 80b8b78a..de6d4bea 100644 --- a/arch/x86/scc/icc.c +++ b/arch/x86/scc/icc.c @@ -164,9 +164,6 @@ static void icc_handler(struct state *s) while( iRCCE_mail_recv(&header) == iRCCE_SUCCESS ) { icc_mail_check_tag(header); iRCCE_mail_release(&header); - NOP8; - NOP8; - NOP8; } } @@ -495,7 +492,7 @@ int icc_mail_noise(void) { void icc_mail_check(void) { - iRCCE_MAIL_HEADER* header = NULL; + iRCCE_MAIL_HEADER* header = NULL; uint32_t flags; /* disable interrupts */ @@ -507,9 +504,6 @@ void icc_mail_check(void) while( iRCCE_mail_recv(&header) == iRCCE_SUCCESS ) { icc_mail_check_tag(header); iRCCE_mail_release( &header ); - NOP8; - NOP8; - NOP8; } /* enable interrupts */ @@ -519,26 +513,26 @@ void icc_mail_check(void) void icc_wait(int tag) { iRCCE_MAIL_HEADER* header = NULL; - uint32_t flags, done = 0; + uint32_t flags; /* disable interrupts */ flags = irq_nested_disable(); - do { - iRCCE_mail_check(iRCCE_MAILBOX_ALL); +retry: + iRCCE_mail_check(iRCCE_MAILBOX_ALL); - /* empty mail queue */ - while( iRCCE_mail_recv(&header) == iRCCE_SUCCESS ) { - icc_mail_check_tag(header); - if (header->tag == tag) - done = 1; + /* empty mail queue */ + while( iRCCE_mail_recv(&header) == iRCCE_SUCCESS ) { + icc_mail_check_tag(header); + if (header->tag == tag) { iRCCE_mail_release( &header ); - NOP8; - NOP8; - NOP8; - } - } while(!done); + goto out; + } else iRCCE_mail_release( &header ); + } + goto retry; + +out: /* enable interrupts */ irq_nested_enable(flags); }