- Wait for mouse acks properly.
[cake.git] / rom / exec / setintvector.c
blobb20bab15d5ea90f13df4a3bccf205283f9bef4fc
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;
47 Disable ();
49 oldint = (struct Interrupt *)SysBase->IntVects[intNumber].iv_Node;
50 SysBase->IntVects[intNumber].iv_Node = (struct Node *)interrupt;
52 if (interrupt)
54 SysBase->IntVects[intNumber].iv_Data = interrupt->is_Data;
55 SysBase->IntVects[intNumber].iv_Code = interrupt->is_Code;
57 else
59 SysBase->IntVects[intNumber].iv_Data = (APTR)~0;
60 SysBase->IntVects[intNumber].iv_Code = (void *)~0;
63 Enable ();
65 return oldint;
67 AROS_LIBFUNC_EXIT
68 } /* SetIntVector */