2 Copyright © 1995-2013, 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 #include <devices/timer.h>
13 #include <proto/exec.h>
14 #include <proto/timer.h>
16 /* See rom/timer/abortio.c for documentation */
18 AROS_LH1(LONG
, AbortIO
,
19 AROS_LHA(struct timerequest
*, timereq
, A1
),
20 struct TimerBase
*, TimerBase
, 6,Timer
)
27 As the timer.device runs as an interrupt, we had better protect
28 the "waiting timers" list from being corrupted.
32 if(timereq
->tr_node
.io_Message
.mn_Node
.ln_Type
!= NT_REPLYMSG
)
34 ULONG unit
= (ULONG
)timereq
->tr_node
.io_Unit
;
35 timereq
->tr_node
.io_Error
= IOERR_ABORTED
;
36 Remove((struct Node
*)timereq
);
37 if (unit
== UNIT_WAITUNTIL
|| unit
== UNIT_VBLANK
) {
38 if (IsListEmpty(&TimerBase
->tb_Lists
[UNIT_VBLANK
]))
39 TimerBase
->tb_vblank_on
= FALSE
;
41 if (IsListEmpty(&TimerBase
->tb_Lists
[UNIT_MICROHZ
]))
42 TimerBase
->tb_micro_on
= FALSE
;
44 ReplyMsg((struct Message
*)timereq
);