4 #include <exec/execbase.h>
5 #include <proto/exec.h>
8 //#include "ahi_device.h"
10 extern struct ExecBase
*SysBase
;
12 void printlist(struct MinList
*);
14 #if defined(__AROSPLATFORM_SMP__)
15 #include <aros/types/spinlock_s.h>
16 #include <proto/execlock.h>
17 #include <resources/execlock.h>
22 struct AHIBase
*AHIBase
;
23 struct AHIDevUnit
*iounit
;
25 #if defined(__AROSPLATFORM_SMP__)
26 void *ExecLockBase
= OpenResource("execlock.resource");
29 ObtainSystemLock(&SysBase
->DeviceList
, SPINLOCK_MODE_READ
, LOCKF_DISABLE
);
35 AHIBase
= (struct AHIBase
*) FindName(& SysBase
->DeviceList
, AHINAME
);
36 #if defined(__AROSPLATFORM_SMP__)
38 ReleaseSystemLock(&SysBase
->DeviceList
, LOCKF_DISABLE
);
46 printf("Base: 0x%08lx\n", AHIBase
);
50 iounit
= AHIBase
->ahib_DevUnits
[0];
51 printf("iounit 0: 0x%08lx\n", iounit
);
55 printf("Is playing.\n");
57 if(iounit
->IsRecording
)
58 printf("Is recording.\n");
61 printlist(&iounit
->ReadList
);
62 printf("PlayingList\n");
63 printlist(&iounit
->PlayingList
);
64 printf("SilentList\n");
65 printlist(&iounit
->SilentList
);
66 printf("WaitingList\n");
67 printlist(&iounit
->WaitingList
);
69 printf("S: %ld, R: %ld, R:%ld\n", iounit
->SampleSignal
,
70 iounit
->RecordSignal
, iounit
->PlaySignal
);
73 iounit
= AHIBase
->ahib_DevUnits
[1];
74 printf("iounit 1: 0x%08lx\n", iounit
);
78 printf("Is playing.\n");
80 if(iounit
->IsRecording
)
81 printf("Is recording.\n");
84 printlist(&iounit
->ReadList
);
85 printf("PlayingList\n");
86 printlist(&iounit
->PlayingList
);
87 printf("SilentList\n");
88 printlist(&iounit
->SilentList
);
89 printf("WaitingList\n");
90 printlist(&iounit
->WaitingList
);
92 printf("S: %ld, R: %ld, R:%ld\n", iounit
->SampleSignal
,
93 iounit
->RecordSignal
, iounit
->PlaySignal
);
99 const static char * commands
[] =
112 void printlist(struct MinList
*list
)
114 struct AHIRequest
*ioreq
;
116 ioreq
= (struct AHIRequest
*) list
->mlh_Head
;
117 while (ioreq
->ahir_Std
.io_Message
.mn_Node
.ln_Succ
)
119 printf("iorequest: 0x%08lx\n", ioreq
);
120 printf("command : %s (0x%lx)\n",
121 (ioreq
->ahir_Std
.io_Command
< CMD_NONSTD
?
122 commands
[ioreq
->ahir_Std
.io_Command
] :
124 ioreq
->ahir_Std
.io_Command
);
125 ioreq
= (struct AHIRequest
*) ioreq
->ahir_Std
.io_Message
.mn_Node
.ln_Succ
;