From 0d4ff65bcbdab4b20cb355bed7e85129b82e328d Mon Sep 17 00:00:00 2001 From: Generic account for RWTHAachen Students Date: Wed, 24 Aug 2011 04:25:10 -0700 Subject: [PATCH] fix irq reset --- arch/x86/kernel/irq.c | 2 +- arch/x86/scc/iRCCE_mailbox.c | 3 --- arch/x86/scc/icc.c | 46 ++++++++++++++++++------------------ kernel/tests.c | 2 +- 4 files changed, 25 insertions(+), 28 deletions(-) diff --git a/arch/x86/kernel/irq.c b/arch/x86/kernel/irq.c index 6d98a769..8246a2e5 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); // evaluate only irq status register if int_no = 124 - if( s->int_no == 124 ) { + if( s->int_no == 124 ) { check_workqueues_rem_irq(); } else { diff --git a/arch/x86/scc/iRCCE_mailbox.c b/arch/x86/scc/iRCCE_mailbox.c index 3f7ec2a6..67fd45d7 100644 --- a/arch/x86/scc/iRCCE_mailbox.c +++ b/arch/x86/scc/iRCCE_mailbox.c @@ -317,9 +317,6 @@ int iRCCE_mail_recv( // no mail queued *header = NULL; - /* enable interrupts */ - irq_nested_enable(flags); - return iRCCE_MAILBOX_EMPTY; } diff --git a/arch/x86/scc/icc.c b/arch/x86/scc/icc.c index ee7493c2..e0d814cd 100644 --- a/arch/x86/scc/icc.c +++ b/arch/x86/scc/icc.c @@ -230,7 +230,7 @@ int icc_halt(void) #define ROUNDS 10000 #define CORE_A 0 // sender -#define CORE_B 4 // receiver +#define CORE_B 1 // receiver int icc_send_gic_irq(int core_num) { @@ -362,15 +362,16 @@ int icc_mail_ping( void ) int icc_mail_ping_irq( void ) { + kprintf( "Hello from mail_ping_irq ... \n" ); /* return if not core A */ if( my_ue != CORE_A ) return 0; + uint32_t flags; uint64_t timer = 0; int i; int res; iRCCE_MAIL_HEADER* recv_header = NULL; - kprintf( "Hello from mail_ping_irq ... \n" ); kprintf( "my_rank = %d\n", my_ue ); kprintf( "rem_rank = %d\n", CORE_B ); kprintf( "rounds = %d\n", ROUNDS ); @@ -411,48 +412,49 @@ int icc_mail_ping_irq( void ) } +#define _iRQ_NOISE_ 0 + int icc_mail_noise() { int i, j, res; int num_ranks = RCCE_num_ues(); iRCCE_MAIL_HEADER* recv_mail = NULL; int flags; - +/* // leave function if not participating - if( (my_ue == CORE_A) /* || (my_ue == CORE_B) */ || (my_ue > 25) ) { + if( (my_ue == CORE_A) || (my_ue == CORE_B) || (my_ue > 25) ) { kprintf( "mail_noise: leaving" ); return -1; } - +*/ + if( !((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 ); int count = 0; for( i=0; i<100000 ;++i ) { /* send a mail to each UE */ for( j=0; j 25) ) + if( !((j == CORE_A) || (j == CORE_B)) ) continue; /* send noise mail */ iRCCE_mail_send(0, NOISE, 1, NULL, j); - +#ifdef _IRQ_NOISE_ icc_send_gic_irq(j); - - NOP8; - NOP8; - NOP8; - +#endif } - - /* read some mails - if( !(i%1000) ) { - iRCCE_mail_send(0, NOISE, 0, NULL, j); - } - + +#ifndef _IRQ_NOISE_ + iRCCE_mail_check(iRCCE_MAILBOX_ALL); +#endif + /* read some mails */ while( iRCCE_mail_recv(&recv_mail) == iRCCE_SUCCESS ) { icc_mail_check_tag(recv_mail); iRCCE_mail_release(&recv_mail); } -*/ } @@ -505,12 +507,10 @@ void icc_mail_check(int irq) } /* empty mail queue */ - i=0; -// while( (i<10) && (res = iRCCE_mail_recv(&header)) == iRCCE_SUCCESS) { - iRCCE_mail_recv(&header); + while( iRCCE_mail_recv(&header) == iRCCE_SUCCESS ) { icc_mail_check_tag(header); iRCCE_mail_release( &header ); -// } + } /* enable interrupts */ irq_nested_enable(flags); diff --git a/kernel/tests.c b/kernel/tests.c index 92297e67..370af074 100644 --- a/kernel/tests.c +++ b/kernel/tests.c @@ -280,7 +280,7 @@ int test_init(void) //create_kernel_task(NULL, producer, NULL); //create_kernel_task(NULL, consumer, NULL); create_kernel_task(NULL, mail_ping, NULL); - create_kernel_task(NULL, mail_noise, NULL); +// create_kernel_task(NULL, mail_noise, NULL); //create_user_task(NULL, "/bin/hello", argv); //create_user_task(NULL, "/bin/tests", argv); //create_user_task(NULL, "/bin/jacobi", argv);