2 Copyright © 2013-2014, The AROS Development Team. All rights reserved
6 #include <exec/types.h>
7 #include <devices/timer.h>
9 #include <proto/exec.h>
10 #include <aros/debug.h>
11 #include <proto/timer.h>
16 /* Waits for a signal or a timeout */
17 ULONG
ata_WaitTO(struct IORequest
* tmr
, ULONG secs
, ULONG micro
, ULONG sigs
)
19 ULONG sig
= 1 << tmr
->io_Message
.mn_ReplyPort
->mp_SigBit
;
21 D(struct Node
*t
= FindTask(NULL
));
22 D(bug("[ATA ] Timed wait %lds %ldu (task='%s')\n", secs
, micro
,
25 tmr
->io_Command
= TR_ADDREQUEST
;
26 ((struct timerequest
*)tmr
)->tr_time
.tv_secs
= secs
;
27 ((struct timerequest
*)tmr
)->tr_time
.tv_micro
= micro
;
30 D(bug("[ATA ] Preset signals: %lx ('%s')\n", SetSignal(0, 0), t
->ln_Name
));
31 D(bug("[ATA ] Signals requested: %lx ('%s')\n", sigs
, t
->ln_Name
));
32 D(bug("[ATA ] Timer signal: %lx ('%s')\n", sig
, t
->ln_Name
));
33 sigs
= Wait(sigs
| sig
);
34 D(bug("[ATA ] Signals received: %lx ('%s')\n", sigs
, t
->ln_Name
));
35 if (0 == (sigs
& sig
))