1 #include <aros/asmcall.h>
2 #include <exec/execbase.h>
3 #include <exec/lists.h>
4 #include <kernel/scheduler.h>
6 #include "intservers.h"
9 * Our default IntVectors.
10 * This interrupt handler will send an interrupt to a series of queued
11 * interrupt servers. Servers should return D0 != 0 (Z clear) if they
12 * believe the interrupt was for them, and no further interrupts will
13 * be called. This will only check the value in D0 for non-m68k systems,
14 * however it SHOULD check the Z-flag on 68k systems.
16 * Hmm, in that case I would have to separate it from this file in order
17 * to replace it... TODO: this can be done after merging exec_init.c from
18 * i386 and PPC native.
20 AROS_UFH5(void, IntServer
,
21 AROS_UFHA(ULONG
, intMask
, D0
),
22 AROS_UFHA(struct Custom
*, custom
, A0
),
23 AROS_UFHA(struct List
*, intList
, A1
),
24 AROS_UFHA(APTR
, intCode
, A5
),
25 AROS_UFHA(struct ExecBase
*, SysBase
, A6
))
29 struct Interrupt
* irq
;
31 ForeachNode(intList
, irq
)
33 if( AROS_UFC4(int, irq
->is_Code
,
34 AROS_UFCA(struct Custom
*, custom
, A0
),
35 AROS_UFCA(APTR
, irq
->is_Data
, A1
),
36 AROS_UFCA(APTR
, irq
->is_Code
, A5
),
37 AROS_UFCA(struct ExecBase
*, SysBase
, A6
)
49 /* VBlankServer. The same as general purpose IntServer but also counts task's quantum */
50 AROS_UFH5(void, VBlankServer
,
51 AROS_UFHA(ULONG
, intMask
, D1
),
52 AROS_UFHA(struct Custom
*, custom
, A0
),
53 AROS_UFHA(struct List
*, intList
, A1
),
54 AROS_UFHA(APTR
, intCode
, A5
),
55 AROS_UFHA(struct ExecBase
*, SysBase
, A6
))
59 /* First decrease Elapsed time for current task */
60 if (SysBase
->Elapsed
&& (--SysBase
->Elapsed
== 0))
62 SysBase
->SysFlags
|= SFF_QuantumOver
;
63 SysBase
->AttnResched
|= ARF_AttnSwitch
;
66 /* Chain to the generic routine */
67 AROS_UFC5(void, IntServer
,
68 AROS_UFCA(ULONG
, intMask
, D1
),
69 AROS_UFCA(struct Custom
*, custom
, A0
),
70 AROS_UFCA(struct List
*, intList
, A1
),
71 AROS_UFCA(APTR
, intCode
, A5
),
72 AROS_UFCA(struct ExecBase
*, SysBase
, A6
));