Search
lxdream.org :: lxdream/src/sh4/intc.c :: diff
lxdream 0.9.1
released Jun 29
Download Now
filename src/sh4/intc.c
changeset 20:3ffb66aa25c7
prev19:9da7a8e38f9d
next31:495e480360d7
author nkeynes
date Thu Dec 22 13:28:16 2005 +0000 (14 years ago)
permissions -rw-r--r--
last change Add scif.c (oops)
Convert interrupts to be level-triggered rather than edge-triggered
(although shouldn't be any visible difference)
file annotate diff log raw
1.1 --- a/src/sh4/intc.c Thu Dec 22 07:38:12 2005 +0000
1.2 +++ b/src/sh4/intc.c Thu Dec 22 13:28:16 2005 +0000
1.3 @@ -115,18 +115,36 @@
1.4
1.5 void intc_clear_interrupt( int which )
1.6 {
1.7 -
1.8 + int i;
1.9 + for( i=intc_num_pending-1; i>=0; i-- ) {
1.10 + if( intc_pending[i] == which ) {
1.11 + /* Shift array contents down */
1.12 + while( i < intc_num_pending-1 ) {
1.13 + intc_pending[i] = intc_pending[++i];
1.14 + }
1.15 + intc_num_pending--;
1.16 + if( intc_num_pending == 0 )
1.17 + sh4r.int_pending = 0;
1.18 + else
1.19 + sh4r.int_pending = PRIORITY(intc_pending[intc_num_pending-1]);
1.20 + break;
1.21 + }
1.22 + }
1.23 +
1.24 }
1.25
1.26 uint32_t intc_accept_interrupt( void )
1.27 {
1.28 assert(intc_num_pending > 0);
1.29 + return INTCODE(intc_pending[intc_num_pending-1]);
1.30 + /*
1.31 intc_num_pending--;
1.32 if( intc_num_pending > 0 )
1.33 sh4r.int_pending = PRIORITY(intc_pending[intc_num_pending-1]);
1.34 else
1.35 sh4r.int_pending = 0;
1.36 return INTCODE(intc_pending[intc_num_pending]);
1.37 + */
1.38 }
1.39
1.40 void intc_mask_changed( void )
.