filename | test/asic.c |
changeset | 753:1fe39c3a9bbc |
prev | 561:533f6b478071 |
next | 815:866c103d72cd |
author | nkeynes |
date | Mon Jul 21 00:08:34 2008 +0000 (15 years ago) |
permissions | -rw-r--r-- |
last change | Add gettext.h and build sanely without libintl if it's not available Remove x86dasm's config.h & opintl.h (no longer needed and actually wrong) |
file | annotate | diff | log | raw |
1.1 --- a/test/asic.c Tue Jan 01 05:08:38 2008 +00001.2 +++ b/test/asic.c Mon Jul 21 00:08:34 2008 +00001.3 @@ -43,6 +43,28 @@1.4 }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 events1.30 */1.31 void asic_clear()
.