home *** CD-ROM | disk | FTP | other *** search
/ Aminet 18 / aminetcdnumber181997.iso / Aminet / misc / emu / AROSdev.lha / AROS / config / m68k-native / permit.s < prev    next >
Encoding:
Text File  |  1997-01-08  |  1.2 KB  |  67 lines

  1. /*
  2.      (C) 1995-96 AROS - The Amiga Replacement OS
  3.      $Id: permit.s,v 1.8 1997/01/08 04:14:25 ldp Exp $
  4.  
  5.      Desc:
  6.      Lang:
  7. */
  8.  
  9. /*****************************************************************************
  10.  
  11.     NAME
  12.  
  13.      AROS_LH0(void, Permit,
  14.  
  15.     LOCATION
  16.      struct ExecBase *, SysBase, 23, Exec)
  17.  
  18.     FUNCTION
  19.      This function activates the dispatcher again after a call to Permit().
  20.  
  21.     INPUTS
  22.  
  23.     RESULT
  24.  
  25.     NOTES
  26.      This function preserves all registers.
  27.  
  28.     EXAMPLE
  29.  
  30.     BUGS
  31.  
  32.     SEE ALSO
  33.      Forbid(), Disable(), Enable()
  34.  
  35.     INTERNALS
  36.  
  37.     HISTORY
  38.  
  39. ******************************************************************************/
  40.  
  41.     #include "machine.i"
  42.  
  43.     .text
  44.     .balign 16
  45.     .globl    AROS_SLIB_ENTRY(Permit,Exec)
  46.     .type    AROS_SLIB_ENTRY(Permit,Exec),@function
  47. AROS_SLIB_ENTRY(Permit,Exec):
  48.     /* decrement nesting count and return if there are Forbid()s left */
  49.     subq.b    #1,TDNestCnt(a6)
  50.     bpl    end
  51.  
  52.     /* return if there are no delayed switches pending. */
  53.     tst.b    AttnResched+1(a6)
  54.     bpl    end
  55.  
  56.     /* if IDNestCnt is not -1 taskswitches are still forbidden */
  57.     tst.b    IDNestCnt(a6)
  58.     bpl    end
  59.  
  60.     /* Unset delayed switch bit and do the delayed switch */
  61.     bclr    #7,AttnResched+1(a6)
  62.     jsr    Switch(a6)
  63.  
  64.     /* all done. */
  65. end:    rts
  66.  
  67.