Re: Interrupt handling
Espen Skoglund <[email protected]>
| Newsgroups | gmane.comp.micro-kernel.l4.l4ka.general |
|---|---|
| Message-ID | <[email protected]> |
[Martin Christian]
> int main (void)
> {
> [...]
> hwint_tid = L4_GlobalId( MPSC_INT_RCC, 1 );
> res = L4_AssociateInterrupt( hwint_tid, L4_Myself() );
> if ( !res )
> L4_KDB_Enter( "Couldn't register interrupt." );
> [...]
> echo_tid = start_thread( &echo_server,
> &echo_stack[sizeof(echo_stack) - 1] ); /* taken from SDIOS */
> [...]
> }
> void echo_server (void)
> {
> L4_MsgTag_t tag;
> char c;
> while ( true )
> {
> /* wait for ipc */
> tag = L4_Receive( hwint_tid );
> c = inc();
> if ( c )
> outc( c );
> L4_Reply( hwint_tid );
> }
> }
Looks like echo_server() is a diffrent thread than the main() thread.
Since you've associated the interrupt with the main thread, the
in-kernel interrupt thread will send the interrupts to and expect to
receive acks from the main() thread.
eSk