bug fix in mail_ping

This commit is contained in:
Generic account for RWTHAachen Students 2011-06-07 05:53:16 -07:00
parent 262e9f085a
commit bba87c8e27
5 changed files with 15 additions and 10 deletions

View file

@ -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

View file

@ -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 );
}

View file

@ -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

View file

@ -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;

View file

@ -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();