1 #include <aros/asmcall.h>
2 #include <hardware/intbits.h>
3 #include <proto/exec.h>
5 #include <timer_intern.h>
6 #include "timervblank.h"
8 /* Define this in timer_platform.h in order to make use of this code */
11 /* exec.library VBlank interrupt handler */
12 AROS_INTH1(VBlankInt
, struct TimerBase
*, TimerBase
)
16 /* UpdateEClock and process VBlank timer*/
17 EClockUpdate(TimerBase
);
18 handleVBlank(TimerBase
, SysBase
);
20 /* exec should continue with other servers */
26 int vblank_Init(struct TimerBase
*LIBBASE
)
28 LIBBASE
->tb_VBlankInt
.is_Node
.ln_Pri
= 0;
29 LIBBASE
->tb_VBlankInt
.is_Node
.ln_Type
= NT_INTERRUPT
;
30 LIBBASE
->tb_VBlankInt
.is_Node
.ln_Name
= LIBBASE
->tb_Device
.dd_Library
.lib_Node
.ln_Name
;
31 LIBBASE
->tb_VBlankInt
.is_Code
= (VOID_FUNC
)VBlankInt
;
32 LIBBASE
->tb_VBlankInt
.is_Data
= LIBBASE
;
34 AddIntServer(INTB_VERTB
, &LIBBASE
->tb_VBlankInt
);
35 return TRUE
; /* We can't fail */
39 * We intentionally don't ADD2INITLIB() here because some architectures may
40 * want to use VBlank interrupt conditionally.
43 static int vblank_Expunge(struct TimerBase
*base
)
45 /* ln_Succ will ne non-empty if this Node was added to a list */
46 if (base
->tb_VBlankInt
.is_Node
.ln_Succ
)
47 RemIntServer(INTB_VERTB
, &base
->tb_VBlankInt
);
52 ADD2EXPUNGELIB(vblank_Expunge
, 0)