home *** CD-ROM | disk | FTP | other *** search
/ Aminet 18 / aminetcdnumber181997.iso / Aminet / misc / emu / AROSdev.lha / AROS / config / m68k-native / enable.s < prev    next >
Encoding:
Text File  |  1996-11-26  |  1.4 KB  |  77 lines

  1. /*
  2.      (C) 1995-96 AROS - The Amiga Replacement OS
  3.      $Id: enable.s,v 1.7 1996/11/26 00:21:42 aros Exp $
  4.  
  5.      Desc:
  6.      Lang:
  7. */
  8.  
  9. /*****************************************************************************
  10.  
  11.     NAME
  12.  
  13.      AROS_LH0(void, Enable,
  14.  
  15.     LOCATION
  16.      struct ExecBase *, SysBase, 21, Exec)
  17.  
  18.     FUNCTION
  19.      This function reenables the delivery of interrupts after a call to
  20.      Disable().
  21.  
  22.     INPUTS
  23.  
  24.     RESULT
  25.  
  26.     NOTES
  27.      This function preserves all registers.
  28.  
  29.      This function may be used from interrupts.
  30.  
  31.     EXAMPLE
  32.  
  33.     BUGS
  34.  
  35.     SEE ALSO
  36.      Forbid(), Permit(), Disable()
  37.  
  38.     INTERNALS
  39.  
  40.     HISTORY
  41.  
  42. ******************************************************************************/
  43.  
  44.     INTENA        =    0xdff09a
  45.     INTEN        =    0x4000
  46.     SET        =    0x8000
  47.  
  48.     #include "machine.i"
  49.  
  50.     .text
  51.     .balign 16
  52.     .globl    AROS_SLIB_ENTRY(Enable,Exec)
  53.     .type    AROS_SLIB_ENTRY(Enable,Exec),@function
  54. AROS_SLIB_ENTRY(Enable,Exec):
  55.     /* decrement nesting count and return if there are Disable()s left */
  56.     subq.b    #1,IDNestCnt(a6)
  57.     bpl    end
  58.  
  59.     /* reenable interrupts */
  60.     move.w    #INTEN+SET,INTENA
  61.  
  62.     /* return if there are no delayed switches pending. */
  63.     tst.b    AttnResched+1(a6)
  64.     bpl    end
  65.  
  66.     /* if TDNestCnt is not -1 taskswitches are still forbidden */
  67.     tst.b    TDNestCnt(a6)
  68.     bpl    end
  69.  
  70.     /* Unset delayed switch bit and do the delayed switch */
  71.     bclr    #7,0x12b(a6)
  72.     jsr    Switch(a6)
  73.  
  74.     /* all done. */
  75. end:    rts
  76.  
  77.