home *** CD-ROM | disk | FTP | other *** search
/ Aminet 18 / aminetcdnumber181997.iso / Aminet / misc / emu / AROSdev.lha / AROS / rom / exec / addintserver.c < prev    next >
Encoding:
C/C++ Source or Header  |  1997-01-10  |  1.5 KB  |  75 lines

  1. /*
  2.     (C) 1995-96 AROS - The Amiga Replacement OS
  3.     $Id: addintserver.c,v 1.5 1997/01/10 04:04:01 ldp Exp $
  4.  
  5.     Desc: Add interrupt client to chain of interrupt server
  6.     Lang:
  7. */
  8. #include <aros/config.h>
  9. #include <exec/execbase.h>
  10. #include <exec/interrupts.h>
  11.  
  12. #if (AROS_FLAVOUR == AROS_FLAVOUR_NATIVE)
  13. #include <hardware/custom.h>
  14. #include <hardware/intbits.h>
  15. #endif
  16.  
  17. #include <proto/exec.h>
  18. #include <aros/libcall.h>
  19.  
  20. /*****************************************************************************
  21.  
  22.     NAME */
  23.  
  24.     AROS_LH2(void, AddIntServer,
  25.  
  26. /*  SYNOPSIS */
  27.     AROS_LHA(ULONG,              intNumber, D0),
  28.     AROS_LHA(struct Interrupt *, interrupt, A1),
  29.  
  30. /*  LOCATION */
  31.     struct ExecBase *, SysBase, 28, Exec)
  32.  
  33. /*  FUNCTION
  34.  
  35.     INPUTS
  36.  
  37.     RESULT
  38.  
  39.     NOTES
  40.     This function also enables the corresponding chipset interrupt if
  41.     run on a native Amiga.
  42.  
  43.     EXAMPLE
  44.  
  45.     BUGS
  46.  
  47.     SEE ALSO
  48.  
  49.     INTERNALS
  50.  
  51.     HISTORY
  52.  
  53. ******************************************************************************/
  54. {
  55.     AROS_LIBFUNC_INIT
  56. #if (AROS_FLAVOUR == AROS_FLAVOUR_NATIVE)
  57.     struct Custom *custom = (struct Custom *)(void **)0xdff000;
  58. #endif
  59.  
  60.     Disable();
  61.  
  62.     Enqueue((struct List *)SysBase->IntVects[intNumber].iv_Data, (struct Node *)interrupt);
  63.  
  64. #if (AROS_FLAVOUR == AROS_FLAVOUR_NATIVE)
  65.     /*
  66.     Enable the chipset interrupt if run on a native Amiga.
  67.     */
  68.     custom->intena = (UWORD)(INTF_SETCLR|(1L<<intNumber));
  69. #endif
  70.  
  71.     Enable();
  72.  
  73.     AROS_LIBFUNC_EXIT
  74. } /* AddIntServer */
  75.