From 1a7eeaa16b87bcfae7c7043386907d4e2ce05be6 Mon Sep 17 00:00:00 2001 From: Simon Pickartz Date: Sat, 27 Aug 2011 11:20:18 -0700 Subject: [PATCH] testing mail_noise --- arch/x86/scc/iRCCE_mailbox.c | 10 +++++++++- arch/x86/scc/icc.c | 27 ++++++++++++--------------- kernel/tests.c | 2 +- 3 files changed, 22 insertions(+), 17 deletions(-) diff --git a/arch/x86/scc/iRCCE_mailbox.c b/arch/x86/scc/iRCCE_mailbox.c index 0fc20331..4e42b262 100644 --- a/arch/x86/scc/iRCCE_mailbox.c +++ b/arch/x86/scc/iRCCE_mailbox.c @@ -392,6 +392,8 @@ int iRCCE_mail_send( char* payload, // pointer to buffer for header payload int dest // UE that will receive the header ) { + uint32_t flags; + // check for an attempt to send to own mailbox if( dest == RCCE_IAM ) { return iRCCE_MAILBOX_INVALID; @@ -400,13 +402,16 @@ int iRCCE_mail_send( // if dest mailbox is full, check for incoming mail RC_cache_invalidate(); while( iRCCE_mailbox_send[dest]->sent ) { -// iRCCE_mailbox_check(); + iRCCE_mailbox_check(); NOP8; NOP8; NOP8; RC_cache_invalidate(); } + /* disable interrupts */ + flags = irq_nested_disable(); + // check if mailbox is closed RCCE_acquire_lock( dest ); RC_cache_invalidate(); @@ -438,6 +443,9 @@ int iRCCE_mail_send( RCCE_release_lock( dest ); + /* enable interrupts */ + irq_nested_enable(flags); + return iRCCE_SUCCESS; } diff --git a/arch/x86/scc/icc.c b/arch/x86/scc/icc.c index d4d60531..f8cab40b 100644 --- a/arch/x86/scc/icc.c +++ b/arch/x86/scc/icc.c @@ -267,7 +267,10 @@ static inline void icc_mail_check_tag(iRCCE_MAIL_HEADER* mail) { char* recv_buffer; static int count = 0; - if( !mail ) return; + if( !mail ) { + kprintf( "NO MAIL + "); + return; + } switch( mail->tag ) { case iRCCE_ANYLENGTH: @@ -431,11 +434,11 @@ int icc_mail_noise() { int flags; // leave function if not participating - if( (my_ue == CORE_A) /* || (my_ue == CORE_B)*/ ) { +/* if( !((my_ue == 1) || (my_ue == 2) || (my_ue == CORE_A) || (my_ue == CORE_B)) ) { kprintf( "mail_noise: leaving" ); return -1; } - +*/ kprintf( "Hello from icc_mail_noise: my_ue = %d\n", my_ue ); kprintf( "num_ues = %d\n", num_ranks ); @@ -444,7 +447,7 @@ int icc_mail_noise() { if( !(i%1000) ) kprintf( "%d ", i ); /* send a mail to each UE */ for( j=0; j