home *** CD-ROM | disk | FTP | other *** search
/ Aminet 18 / aminetcdnumber181997.iso / Aminet / misc / emu / AROSdev.lha / AROS / config / i386 / enable.s < prev    next >
Encoding:
Text File  |  1997-01-27  |  1.4 KB  |  91 lines

  1. /*
  2.     (C) 1995-96 AROS - The Amiga Replacement OS
  3.     $Id: enable.s,v 1.12 1997/01/27 07:53:43 iaint Exp $
  4.  
  5.     Desc:
  6.     Lang:
  7. */
  8.  
  9. /******************************************************************************
  10.  
  11.     NAME
  12.     AROS_LH0(void, Enable,
  13.  
  14.     LOCATION
  15.     struct ExecBase *, SysBase, 21, Exec)
  16.  
  17.     FUNCTION
  18.  
  19.     INPUTS
  20.  
  21.     RESULT
  22.  
  23.     NOTES
  24.  
  25.     EXAMPLE
  26.  
  27.     BUGS
  28.  
  29.     SEE ALSO
  30.  
  31.     INTERNALS
  32.  
  33.     HISTORY
  34.  
  35. ******************************************************************************/
  36.  
  37.     #include "machine.i"
  38.  
  39.     .text
  40.     .balign 16
  41.     .globl    AROS_SLIB_ENTRY(Enable,Exec)
  42.     .type    AROS_SLIB_ENTRY(Enable,Exec),@function
  43. AROS_SLIB_ENTRY(Enable,Exec):
  44.     /* Preserve all registers */
  45.     pushl    %edx
  46.     pushl    %eax
  47.  
  48.     /* Get SysBase */
  49.     movl    12(%esp),%edx
  50.  
  51.     /* Decrement and test IDNestCnt */
  52.     decb    IDNestCnt(%edx)
  53.     jge    noswch
  54.     call    en
  55.  
  56.     /* Is there a delayed switch pending and are taskswitches allowed? */
  57.     cmpb    $0,AttnResched(%edx)
  58.     jge    noswch
  59.     cmpb    $0,TDNestCnt(%edx)
  60.     jge    noswch
  61.  
  62.     /* Clear delayed switch bit and do the delayed switch */
  63.     andb    $127,AttnResched(%edx)
  64.     leal    Switch(%edx),%eax
  65.     pushl    %edx
  66.     call    *%eax
  67.     addl    $4,%esp
  68.  
  69.     /* Restore registers and return */
  70. noswch: popl    %eax
  71.     popl    %edx
  72.     ret
  73.  
  74. .globl en
  75.     .type    en,@function
  76. en:
  77.     pushl %eax
  78.     pushl %ecx
  79.     pushl %edx
  80.     pushl $-1
  81.     pushl $0
  82.     leal 4(%esp),%eax
  83.     pushl %eax
  84.     pushl $SIG_UNBLOCK
  85.     call AROS_CSYMNAME(sigprocmask)
  86.     addl $16,%esp
  87.     popl %edx
  88.     popl %ecx
  89.     popl %eax
  90.     ret
  91.