picture.datatype: gi_RastPort should not be directly accessed
[AROS.git] / rom / exec / setintvector.c
blobcb55918d620518f676d62a9c703339895cdcb251
1 /*
2 Copyright © 1995-2001, The AROS Development Team. All rights reserved.
3 $Id$
5 Desc: Install an interrupt handler.
6 Lang: english
7 */
8 #include <exec/execbase.h>
9 #include <exec/interrupts.h>
10 #include <proto/exec.h>
11 #include <aros/libcall.h>
13 /*****************************************************************************
15 NAME */
17 AROS_LH2(struct Interrupt *, SetIntVector,
19 /* SYNOPSIS */
20 AROS_LHA(ULONG, intNumber, D0),
21 AROS_LHA(struct Interrupt *, interrupt, A1),
23 /* LOCATION */
24 struct ExecBase *, SysBase, 27, Exec)
26 /* FUNCTION
28 INPUTS
30 RESULT
32 NOTES
34 EXAMPLE
36 BUGS
38 SEE ALSO
40 INTERNALS
42 ******************************************************************************/
44 AROS_LIBFUNC_INIT
45 struct Interrupt *oldint;
46 BOOL ishandler = intNumber <= 2 || (intNumber >= 6 && intNumber <= 12);
48 Disable ();
50 oldint = (struct Interrupt *)SysBase->IntVects[intNumber].iv_Node;
51 SysBase->IntVects[intNumber].iv_Node = ishandler ? (struct Node *)interrupt : NULL;
53 if (interrupt)
55 SysBase->IntVects[intNumber].iv_Data = interrupt->is_Data;
56 SysBase->IntVects[intNumber].iv_Code = interrupt->is_Code;
58 else
60 SysBase->IntVects[intNumber].iv_Data = (APTR)~0;
61 SysBase->IntVects[intNumber].iv_Code = (void *)~0;
64 Enable ();
66 return oldint;
68 AROS_LIBFUNC_EXIT
69 } /* SetIntVector */