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

  1. /*
  2.      (C) 1995-96 AROS - The Amiga Replacement OS
  3.      $Id: userstate.s,v 1.6 1996/11/26 00:21:44 aros Exp $
  4.  
  5.      Desc:
  6.      Lang:
  7. */
  8.  
  9. /*****************************************************************************
  10.  
  11.     NAME
  12.  
  13.      AROS_LH1(void, UserState,
  14.  
  15.     SYNOPSIS
  16.      AROS_LHA(APTR, sysStack, D0),
  17.  
  18.     LOCATION
  19.      struct ExecBase *, SysBase, 26, Exec)
  20.  
  21.     FUNCTION
  22.      Return to user mode after a call to SuperState().
  23.  
  24.     INPUTS
  25.      sysStack - The returncode from SuperState().
  26.  
  27.     RESULT
  28.  
  29.     NOTES
  30.  
  31.     EXAMPLE
  32.  
  33.     BUGS
  34.  
  35.     SEE ALSO
  36.      SuperState(), Supervisor()
  37.  
  38.     INTERNALS
  39.  
  40.     HISTORY
  41.  
  42. ******************************************************************************/
  43.  
  44.     #include "machine.i"
  45.  
  46.     .text
  47.     .balign 16
  48.     .globl    AROS_SLIB_ENTRY(UserState,Exec)
  49.     .type    AROS_SLIB_ENTRY(UserState,Exec),@function
  50. AROS_SLIB_ENTRY(UserState,Exec):
  51.     /* simply return if argument is NULL */
  52.     tst.l    d0
  53.     bne    nonzero
  54.     rts
  55. nonzero:
  56.     /* Transfer sp */
  57.     move.l    sp,usp
  58.  
  59.     /* Set old supervisor sp */
  60.     move.l    d0,sp
  61.  
  62.     /* And return. This jumps directly to a rts. */
  63.     rte
  64.  
  65.