home *** CD-ROM | disk | FTP | other *** search
/ Gold Fish 3 / goldfish_volume_3.bin / files / comm / tcp / amitcp / src / l / inet-handler / interrupt.c < prev    next >
Encoding:
C/C++ Source or Header  |  1994-04-05  |  1.9 KB  |  95 lines

  1. /*
  2.  * interrupt.c
  3.  *
  4.  * Author: Tomi Ollila <too@cs.hut.fi>
  5.  *
  6.  * Copyright (c) 1993 AmiTCP/IP Group, <amitcp-group@hut.fi>
  7.  *              All rights reserved.
  8.  *
  9.  * Created: Tue Oct 19 21:27:16 1993 too
  10.  * Last modified: Mon Nov 15 23:21:26 1993 too
  11.  *
  12.  * $Id: interrupt.c,v 1.1 1993/11/17 11:47:44 too Exp too $
  13.  *
  14.  * HISTORY
  15.  * $Log: interrupt.c,v $
  16.  * Revision 1.1  1993/11/17  11:47:44  too
  17.  * Initial revision
  18.  *
  19.  * Revision 1.1  1993/10/24  12:50:39  too
  20.  * Initial revision
  21.  *
  22.  */
  23.  
  24. #include <exec/types.h>
  25. #include <exec/lists.h>
  26. #include <exec/ports.h>
  27. #include <exec/execbase.h>
  28.  
  29. #include "global.h"
  30.  
  31. #include <sys/types.h>
  32.  
  33. #include "applport.h"
  34.  
  35. #include "dirindex.h"
  36.  
  37. #define RFI ->
  38.  
  39. #if __GNUC__
  40.  
  41. #define RAF2(funname, type1, arg1, reg1, type2, arg2, reg2) \
  42.   funname(VOID)                \
  43. {                    \
  44.   register type1 reg1 __asm(#reg1); \
  45.   type1 arg1 = reg1;             \
  46.   register type2 reg2 __asm(#reg2); \
  47.   type2 arg2 = reg2;
  48.  
  49. #elif __SASC
  50. #include <proto/exec.h>
  51. #define RAF2(funname,type1, arg1, reg1,type2, arg2, reg2) \
  52.  __asm funname(register __##reg1 type1 arg1,    \
  53.            register __##reg2 type2 arg2)    \
  54. {
  55.  
  56. #else
  57.   #error foo
  58. #endif /* __GNUC__ */
  59.  
  60. /*
  61.  * interrupt handler...
  62.  */
  63. void RAF2(intCode,
  64.       struct ExecBase *,    SysBase,    a6,
  65.       struct ApplPort *,    port,        a1)
  66. #if 0
  67. {
  68. #endif
  69.  
  70. #if __GNUC__
  71.   register struct ApplShared * AS __asm("a5") = port->ap_AS;
  72. #else
  73.   struct ApplShared * AS = port->ap_AS;
  74. #endif  
  75.   int pos = applcbpos;
  76.  
  77.   directIndex(struct ApplPort *, applcbbuf, pos) = port;
  78.   
  79.   pos += sizeof (struct ApplPort *);
  80.   pos &= 0x3f * sizeof (struct ApplPort *);
  81.   applcbpos = pos;
  82. #if __GNUC__
  83.   {
  84.     register struct Task * a1 __asm("a1") = me;
  85.     register ULONG d0 __asm("d0") = applportflag;
  86.     __asm __volatile ("jmp a6@(-0x144)"            /* Signal() */
  87.               : /* no output */
  88.               : /*"r" (a6),*/ "r" (a1), "r" (d0)
  89.               : "a0","a1","d0","d1", "memory");
  90.   }
  91. #else
  92.     Signal(me, applportflag);
  93. #endif
  94. }
  95.