diff --git a/arch/x86/kernel/irq.c b/arch/x86/kernel/irq.c index 3c4b621f..9e8ca5e8 100644 --- a/arch/x86/kernel/irq.c +++ b/arch/x86/kernel/irq.c @@ -235,7 +235,7 @@ void irq_handler(struct state *s) void (*handler) (struct state * s); // at first, we check our work queues - check_workqueues(); + if( s->int_no == 124 ) check_workqueues(); /* * 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 9c94a600..d0ff8bb2 100644 --- a/arch/x86/scc/icc.c +++ b/arch/x86/scc/icc.c @@ -238,7 +238,7 @@ int icc_mail_ping( void ) uint64_t timer; int remote_rank = (my_ue+1)%2; - if( !my_ue ) { + if( my_ue ) { return 0; } @@ -251,15 +251,16 @@ int icc_mail_ping( void ) iRCCE_mail_send( 0, 1, 0, NULL, remote_rank ); kprintf( "Sent pingrequest to %d ...\n", remote_rank ); + + // wake up receiver + icc_send_irq( remote_rank ); + // wait for response iRCCE_MAIL_HEADER* mail; do { iRCCE_mail_recv( &mail ); } while( !mail ); - timer = timer - rdtsc(); - - kprintf( "Received mail in %d ticks!\n", timer ); // stop timer timer = rdtsc() - timer; @@ -347,16 +348,20 @@ void icc_check(void) void icc_mail_check(void) { + if( !my_ue ) return ; + iRCCE_MAIL_HEADER* header; int res; - + + kprintf( "Hello from icc_mail_check() \n" ); // empty mailbox and interpret headers do { res = iRCCE_mail_recv( &header ); if( header->tag == 1 ) { + kprintf( "Received mail_ping request ...\n" ); iRCCE_mail_send( 0, 2, 0, NULL, header->source ); } - + iRCCE_mail_release( &header ); } while( res == iRCCE_SUCCESS ); } diff --git a/include/metalsvm/tasks.h b/include/metalsvm/tasks.h index ec6ed665..b8822dfa 100644 --- a/include/metalsvm/tasks.h +++ b/include/metalsvm/tasks.h @@ -143,7 +143,7 @@ static inline void check_workqueues(void) uint32_t flags = irq_nested_disable(); #ifdef CONFIG_ROCKCREEK - //icc_check(); +// icc_check(); icc_mail_check(); #endif diff --git a/kernel/mailbox.c b/kernel/mailbox.c index 8b7a8b78..e20e9e36 100644 --- a/kernel/mailbox.c +++ b/kernel/mailbox.c @@ -40,7 +40,6 @@ int STDCALL mail_ping(void* arg) { int mailbox_test_init(void) { char* argv[] = {"/bin/mailbox", NULL}; - kprintf( "### Hello from mailbox_test_init\n" ); create_kernel_task(NULL, mail_ping, argv); return 0; diff --git a/kernel/main.c b/kernel/main.c index f3b7d36f..50894054 100644 --- a/kernel/main.c +++ b/kernel/main.c @@ -114,13 +114,14 @@ int main(void) sleep(5); list_root(); - //test_init(); +// test_init(); kprintf( "calling mailbox test ... \n" ); mailbox_test_init(); kprintf( "mailbox test succeded!\n" ); per_core(current_task)->status = TASK_IDLE; reschedule(); + while(1) { #ifdef CONFIG_ROCKCREEK icc_halt();