2 Copyright © 2013-2014, The AROS Development Team. All rights reserved
3 $Id: waitto.c 55802 2019-03-08 21:47:59Z wawa $
6 #include <aros/debug.h>
8 #include <proto/exec.h>
10 /* We want all other bases obtained from our base */
13 #include <proto/timer.h>
15 #include <exec/types.h>
16 #include <devices/timer.h>
22 /* Waits for a signal or a timeout */
23 ULONG
scsi_WaitTO(struct IORequest
* tmr
, ULONG secs
, ULONG micro
, ULONG sigs
)
25 ULONG sig
= 1 << tmr
->io_Message
.mn_ReplyPort
->mp_SigBit
;
27 D(struct Node
*t
= (struct Node
*)FindTask(NULL
));
28 D(bug("[SCSI ] Timed wait %lds %ldu (task='%s')\n", secs
, micro
,
31 tmr
->io_Command
= TR_ADDREQUEST
;
32 ((struct timerequest
*)tmr
)->tr_time
.tv_secs
= secs
;
33 ((struct timerequest
*)tmr
)->tr_time
.tv_micro
= micro
;
36 D(bug("[SCSI ] Preset signals: %lx ('%s')\n", SetSignal(0, 0), t
->ln_Name
));
37 D(bug("[SCSI ] Signals requested: %lx ('%s')\n", sigs
, t
->ln_Name
));
38 D(bug("[SCSI ] Timer signal: %lx ('%s')\n", sig
, t
->ln_Name
));
39 sigs
= Wait(sigs
| sig
);
40 D(bug("[SCSI ] Signals received: %lx ('%s')\n", sigs
, t
->ln_Name
));
41 if (0 == (sigs
& sig
))