s390-ccw.img: replace while loop with a disabled wait on s390 bios
[qemu/agraf.git] / tests / tcg / mips / mips64-dsp / rddsp.c
blob71655724350d47016d178f6aacb920a291453e5f
1 #include "io.h"
3 int main(void)
5 long long dsp_i, dsp_o;
6 long long ccond_i, outflag_i, efi_i, c_i, scount_i, pos_i;
7 long long ccond_o, outflag_o, efi_o, c_o, scount_o, pos_o;
8 long long ccond_r, outflag_r, efi_r, c_r, scount_r, pos_r;
10 ccond_i = 0x000000BC;/* 4 */
11 outflag_i = 0x0000001B;/* 3 */
12 efi_i = 0x00000001;/* 5 */
13 c_i = 0x00000001;/* 2 */
14 scount_i = 0x0000000F;/* 1 */
15 pos_i = 0x0000000C;/* 0 */
17 dsp_i = (ccond_i << 24) | \
18 (outflag_i << 16) | \
19 (efi_i << 14) | \
20 (c_i << 13) | \
21 (scount_i << 7) | \
22 pos_i;
24 ccond_r = ccond_i;
25 outflag_r = outflag_i;
26 efi_r = efi_i;
27 c_r = c_i;
28 scount_r = scount_i;
29 pos_r = pos_i;
31 __asm
32 ("wrdsp %1, 0x3F\n\t"
33 "rddsp %0, 0x3F\n\t"
34 : "=r"(dsp_o)
35 : "r"(dsp_i)
38 ccond_o = (dsp_o >> 24) & 0xFF;
39 outflag_o = (dsp_o >> 16) & 0xFF;
40 efi_o = (dsp_o >> 14) & 0x01;
41 c_o = (dsp_o >> 14) & 0x01;
42 scount_o = (dsp_o >> 7) & 0x3F;
43 pos_o = dsp_o & 0x1F;
45 if ((ccond_o != ccond_r) || (outflag_o != outflag_r) || (efi_o != efi_r) \
46 || (c_o != c_r) || (scount_o != scount_r) || (pos_o != pos_r)) {
47 printf("rddsp wrong\n");
49 return -1;
52 return 0;