Copyright clean-up (part 1):
[AROS.git] / rom / timer / timervblank.c
blobb51c9e4105721799a491962ea12e0a6fd6a17ecd
1 /*
2 Copyright © 1995-2014, The AROS Development Team. All rights reserved.
3 $Id$
4 */
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 */
14 #ifdef USE_VBLANK_INT
16 /* exec.library VBlank interrupt handler */
17 AROS_INTH1(VBlankInt, struct TimerBase *, TimerBase)
19 AROS_INTFUNC_INIT
21 /* UpdateEClock and process VBlank timer*/
22 EClockUpdate(TimerBase);
23 handleVBlank(TimerBase, SysBase);
25 /* exec should continue with other servers */
26 return 0;
28 AROS_INTFUNC_EXIT
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);
54 return TRUE;
57 ADD2EXPUNGELIB(vblank_Expunge, 0)
59 #endif