2 Copyright © 2010, The AROS Development Team. All rights reserved.
5 Desc: SetICR() function.
9 #include <exec/libraries.h>
10 #include <proto/cia.h>
11 #include <proto/exec.h>
12 #include <hardware/cia.h>
13 #include <hardware/custom.h>
14 #include <hardware/intbits.h>
16 #include "cia_intern.h"
18 AROS_LH1(WORD
, SetICR
,
19 AROS_LHA(WORD
, mask
, D0
),
20 struct Library
*, resource
, 4, Cia
)
24 struct CIABase
*CiaBase
= (struct CIABase
*)resource
;
25 volatile struct Custom
*custom
= (struct Custom
*)0xdff000;
30 // I think this needs to return interrupt=active status
31 // if called inside CIA interrupt handler
32 CiaBase
->active_mask
|= CiaBase
->hw
->ciaicr
& 0x1f;
33 old
= CiaBase
->active_mask
| CiaBase
->executing_mask
;
35 CiaBase
->active_mask
|= mask
& 0x1f;
37 CiaBase
->active_mask
&= ~mask
;
39 // do we need to trigger the interrupt now?
40 if (CiaBase
->enable_mask
& CiaBase
->active_mask
)
41 custom
->intreq
= INTF_SETCLR
| CiaBase
->inten_mask
;