2 Copyright © 1995-2014, The AROS Development Team. All rights reserved.
6 #include <aros/asmcall.h>
7 #include <hardware/intbits.h>
8 #include <proto/exec.h>
10 #include <timer_intern.h>
11 #include "timervblank.h"
13 /* Define this in timer_platform.h in order to make use of this code */
16 /* exec.library VBlank interrupt handler */
17 AROS_INTH1(VBlankInt
, struct TimerBase
*, TimerBase
)
21 /* UpdateEClock and process VBlank timer*/
22 EClockUpdate(TimerBase
);
23 handleVBlank(TimerBase
, SysBase
);
25 /* exec should continue with other servers */
31 int vblank_Init(struct TimerBase
*LIBBASE
)
33 LIBBASE
->tb_VBlankInt
.is_Node
.ln_Pri
= 0;
34 LIBBASE
->tb_VBlankInt
.is_Node
.ln_Type
= NT_INTERRUPT
;
35 LIBBASE
->tb_VBlankInt
.is_Node
.ln_Name
= LIBBASE
->tb_Device
.dd_Library
.lib_Node
.ln_Name
;
36 LIBBASE
->tb_VBlankInt
.is_Code
= (VOID_FUNC
)VBlankInt
;
37 LIBBASE
->tb_VBlankInt
.is_Data
= LIBBASE
;
39 AddIntServer(INTB_VERTB
, &LIBBASE
->tb_VBlankInt
);
40 return TRUE
; /* We can't fail */
44 * We intentionally don't ADD2INITLIB() here because some architectures may
45 * want to use VBlank interrupt conditionally.
48 static int vblank_Expunge(struct TimerBase
*base
)
50 /* ln_Succ will ne non-empty if this Node was added to a list */
51 if (base
->tb_VBlankInt
.is_Node
.ln_Succ
)
52 RemIntServer(INTB_VERTB
, &base
->tb_VBlankInt
);
57 ADD2EXPUNGELIB(vblank_Expunge
, 0)