39df262a578e01bf890a581ec6a5b19b844953bb
2 Copyright © 1995-2007, The AROS Development Team. All rights reserved.
5 Desc: AbortIO() - abort a running timer request.
8 #include <timer_intern.h>
10 #include <exec/errors.h>
12 /*****i***********************************************************************
15 #include <devices/timer.h>
16 #include <proto/exec.h>
17 #include <proto/timer.h>
19 AROS_LH1(LONG
, AbortIO
,
22 AROS_LHA(struct timerequest
*, timereq
, A1
),
25 struct TimerBase
*, TimerBase
, 6,Timer
)
28 Abort a running timer.device request.
31 timereq - The request you wish to abort.
34 0 if the request was aborted, io_Error will also be set
35 to the value IOERR_ABORTED.
37 -1 otherwise (most likely that the request isn't working).
39 If the request is successfully aborted, you should WaitIO() on
40 the message before you try and reuse it.
43 This function may be called from interrupts.
50 exec/AbortIO(), exec/WaitIO()
55 18-02-1997 iaint Implemented.
57 ******************************************************************************/
64 As the timer.device runs as an interrupt, we had better protect
65 the "waiting timers" list from being corrupted.
69 if(timereq
->tr_node
.io_Message
.mn_Node
.ln_Type
!= NT_REPLYMSG
)
71 ULONG unit
= (ULONG
)timereq
->tr_node
.io_Unit
;
72 timereq
->tr_node
.io_Error
= IOERR_ABORTED
;
73 Remove((struct Node
*)timereq
);
74 if (unit
== UNIT_WAITUNTIL
|| unit
== UNIT_VBLANK
) {
75 if (IsListEmpty(&TimerBase
->tb_Lists
[UNIT_VBLANK
]))
76 TimerBase
->tb_vblank_on
= FALSE
;
78 if (IsListEmpty(&TimerBase
->tb_Lists
[UNIT_MICROHZ
]))
79 TimerBase
->tb_micro_on
= FALSE
;
81 ReplyMsg((struct Message
*)timereq
);