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>
19 #include "../kernel/kernel_intern.h"
22 AROS_LHA(struct Interrupt
*, softint
, A1
),
23 struct ExecBase
*, SysBase
, 30, Exec
)
29 /* Check to ensure that this node is not already in a list. */
30 if( softint
->is_Node
.ln_Type
!= NT_SOFTINT
)
32 /* Scale the priority down to a number between 0 and 4 inclusive
33 We can use that to index into exec's software interrupt lists. */
34 pri
= (softint
->is_Node
.ln_Pri
+ 0x20)>>4;
36 /* We are accessing an Exec list, protect ourselves. */
37 ADDTAIL(&SysBase
->SoftInts
[pri
].sh_List
, &softint
->is_Node
);
38 softint
->is_Node
.ln_Type
= NT_SOFTINT
;
39 SysBase
->SysFlags
|= SFF_SoftInt
;
41 /* If we are in usermode the software interrupt will end up
42 being triggered in Enable(). See Enable() code */
50 AROS_UFH5(void, SoftIntDispatch
,
51 AROS_UFHA(ULONG
, intReady
, D1
),
52 AROS_UFHA(struct Custom
*, custom
, A0
),
53 AROS_UFHA(IPTR
, intData
, A1
),
54 AROS_UFHA(IPTR
, intCode
, A5
),
55 AROS_UFHA(struct ExecBase
*, SysBase
, A6
))
59 void *KernelBase
= getKernelBase();
61 struct Interrupt
*intr
= 0;
64 if( SysBase
->SysFlags
& SFF_SoftInt
)
66 /* Clear the Software interrupt pending flag. */
67 SysBase
->SysFlags
&= ~(SFF_SoftInt
);
74 intr
= (struct Interrupt
*)RemHead(&SysBase
->SoftInts
[i
].sh_List
);
78 intr
->is_Node
.ln_Type
= NT_INTERRUPT
;
82 /* Call the software interrupt. */
83 AROS_UFC3(void, intr
->is_Code
,
84 AROS_UFCA(APTR
, intr
->is_Data
, A1
),
85 AROS_UFCA(APTR
, intr
->is_Code
, A5
),
86 AROS_UFCA(struct ExecBase
*, SysBase
, A6
));
88 /* Get out and start loop *all* over again *from scratch*! */