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_UFH4(static ULONG
, VBlankInt
,
13 AROS_UFHA(ULONG
, dummy
, A0
),
14 AROS_UFHA(struct TimerBase
*, TimerBase
, A1
),
15 AROS_UFHA(ULONG
, dummy2
, A5
),
16 AROS_UFHA(struct ExecBase
*, SysBase
, A6
))
20 /* UpdateEClock and process VBlank timer*/
21 EClockUpdate(TimerBase
);
22 handleVBlank(TimerBase
, SysBase
);
24 /* exec should continue with other servers */
30 int vblank_Init(struct TimerBase
*LIBBASE
)
32 LIBBASE
->tb_VBlankInt
.is_Node
.ln_Pri
= 0;
33 LIBBASE
->tb_VBlankInt
.is_Node
.ln_Type
= NT_INTERRUPT
;
34 LIBBASE
->tb_VBlankInt
.is_Node
.ln_Name
= LIBBASE
->tb_Device
.dd_Library
.lib_Node
.ln_Name
;
35 LIBBASE
->tb_VBlankInt
.is_Code
= (APTR
)VBlankInt
;
36 LIBBASE
->tb_VBlankInt
.is_Data
= LIBBASE
;
38 AddIntServer(INTB_VERTB
, &LIBBASE
->tb_VBlankInt
);
39 return TRUE
; /* We can't fail */
43 * We intentionally don't ADD2INITLIB() here because some architectures may
44 * want to use VBlank interrupt conditionally.
47 static int vblank_Expunge(struct TimerBase
*base
)
49 /* ln_Succ will ne non-empty if this Node was added to a list */
50 if (base
->tb_VBlankInt
.is_Node
.ln_Succ
)
51 RemIntServer(INTB_VERTB
, &base
->tb_VBlankInt
);
56 ADD2EXPUNGELIB(vblank_Expunge
, 0)