2 Copyright © 1995-2001, The AROS Development Team. All rights reserved.
5 Desc: i386native version of Cause().
9 #include <exec/execbase.h>
10 #include <aros/asmcall.h>
11 #include <aros/kernel.h>
12 #include <exec/interrupts.h>
13 #include <hardware/custom.h>
14 #include <hardware/intbits.h>
15 #include <proto/exec.h>
16 #include <proto/kernel.h>
18 #include <exec_intern.h>
20 extern void *priv_KernelBase
;
23 AROS_LHA(struct Interrupt
*, softint
, A1
),
24 struct ExecBase
*, SysBase
, 30, Exec
)
30 /* Check to ensure that this node is not already in a list. */
31 if( softint
->is_Node
.ln_Type
!= NT_SOFTINT
)
33 /* Scale the priority down to a number between 0 and 4 inclusive
34 We can use that to index into exec's software interrupt lists. */
35 pri
= (softint
->is_Node
.ln_Pri
+ 0x20)>>4;
37 /* We are accessing an Exec list, protect ourselves. */
38 ADDTAIL(&SysBase
->SoftInts
[pri
].sh_List
, &softint
->is_Node
);
39 softint
->is_Node
.ln_Type
= NT_SOFTINT
;
40 SysBase
->SysFlags
|= SFF_SoftInt
;
42 /* If we are in usermode the software interrupt will end up
43 being triggered in Enable(). See Enable() code */
51 AROS_UFH5(void, SoftIntDispatch
,
52 AROS_UFHA(ULONG
, intReady
, D1
),
53 AROS_UFHA(struct Custom
*, custom
, A0
),
54 AROS_UFHA(IPTR
, intData
, A1
),
55 AROS_UFHA(IPTR
, intCode
, A5
),
56 AROS_UFHA(struct ExecBase
*, SysBase
, A6
))
60 void *KernelBase
= priv_KernelBase
;
62 struct Interrupt
*intr
= 0;
65 if( SysBase
->SysFlags
& SFF_SoftInt
)
67 /* Clear the Software interrupt pending flag. */
68 SysBase
->SysFlags
&= ~(SFF_SoftInt
);
75 intr
= (struct Interrupt
*)RemHead(&SysBase
->SoftInts
[i
].sh_List
);
79 intr
->is_Node
.ln_Type
= NT_INTERRUPT
;
83 /* Call the software interrupt. */
84 AROS_UFC3(void, intr
->is_Code
,
85 AROS_UFCA(APTR
, intr
->is_Data
, A1
),
86 AROS_UFCA(APTR
, intr
->is_Code
, A5
),
87 AROS_UFCA(struct ExecBase
*, SysBase
, A6
));
89 /* Get out and start loop *all* over again *from scratch*! */