Search
lxdream.org :: lxdream/test/asic.c :: diff
lxdream 0.9.1
released Jun 29
Download Now
filename test/asic.c
changeset 753:1fe39c3a9bbc
prev561:533f6b478071
next815:866c103d72cd
author nkeynes
date Thu Jul 24 02:31:56 2008 +0000 (15 years ago)
permissions -rw-r--r--
last change Fix to correctly mount empty CD drives
file annotate diff log raw
1.1 --- a/test/asic.c Tue Jan 01 05:08:38 2008 +0000
1.2 +++ b/test/asic.c Thu Jul 24 02:31:56 2008 +0000
1.3 @@ -43,6 +43,28 @@
1.4 }
1.5
1.6 /**
1.7 + * Wait for either of 2 ASIC events.
1.8 + * @return the event id if the event occurred, otherwise -1 if the wait timed out.
1.9 + */
1.10 +int asic_wait2( int event1, int event2 )
1.11 +{
1.12 + int n1 = event1 >> 5;
1.13 + int n2 = event2 >> 5;
1.14 + unsigned int mask1 = (1<< (event1&0x1f));
1.15 + unsigned int mask2 = (1<< (event2&0x1f));
1.16 + int i;
1.17 + for( i=0; i<TIMEOUT; i++ ) {
1.18 + if( long_read(ASIC_PIRQ(n1)) & mask1 ) {
1.19 + return event1;
1.20 + }
1.21 + if( long_read(ASIC_PIRQ(n2)) & mask2 ) {
1.22 + return event2;
1.23 + }
1.24 + }
1.25 + return -1; /* Timeout */
1.26 +}
1.27 +
1.28 +/**
1.29 * Clear all asic events
1.30 */
1.31 void asic_clear()
.