1: /*
   2:  * Copyright (c) 1987 Regents of the University of California.
   3:  * All rights reserved.  The Berkeley software License Agreement
   4:  * specifies the terms and conditions for redistribution.
   5:  */
   6: 
   7: #ifdef SYSLIBC_SCCS
   8: _sccsid: <@(#)sigreturn.s	2.6 (2.11BSD GTE) 1995/05/08\0>
   9:         .even
  10: #endif SYSLIBC_SCCS
  11: 
  12: /*
  13:  * error = sigreturn(scp);
  14:  *	int			error;
  15:  * 	struct sigcontext	*scp;
  16:  *
  17:  * Overlaid version of sigreturn.  MUST BE LOADED IN BASE SEGMENT!!!
  18:  *
  19:  * Note that no qualification for returning to the base segment is made in
  20:  * sigreturn (to avoid a posible superfluous overlay switch request) as cret
  21:  * does.  The problem is the routine being returned to in the base could
  22:  * easily be one which doesn't use cret itself to return (like a system call
  23:  * from the library) which on its own return might be returning to a different
  24:  * overlay than the one currently loaded.
  25:  */
  26: #include "SYS.h"
  27: 
  28: SC_OVNO = 18.                           / offset of sc_ovno in sigcontext
  29: emt     = 0104000                       / overlay switch - ovno in r0
  30: 
  31: .globl  __ovno
  32: 
  33: /*
  34:  * XXX - cat'n use ENTRY(sigreturn)!!! - ENTRY includes profiling code which
  35:  * mungs registers.
  36:  */
  37: .globl  _sigreturn
  38: _sigreturn:
  39:         mov     2(sp),r0                / r0 = scp->sc_ovno
  40:         mov     SC_OVNO(r0),r0
  41:         beq     1f                      / zero implies no overlay switches yet
  42:         cmp     r0,__ovno               / same overlay currently loaded?
  43:         beq     1f                      /   yes, nothing to do
  44:         emt                             /   no, request overlay load
  45:         mov     r0,__ovno               /     and indicate new overlay
  46: 
  47:         / The last two instructions represent a potential race condition ...
  48: 1:
  49:         SYS(sigreturn)                  / attempt the sigreturn
      /
      /   trap 103 -> [kernel] -> syscall() -> via sysent[] -> handler: sigreturn
      /
  50:         jmp     x_error

Defined functions

SC_OVNO defined in line 28; used 1 times
  • in line 40
_sccsid defined in line 8; never used
_sigreturn declared in line 37; defined in line 38; used 5 times
emt defined in line 29; used 1 times
  • in line 44
Last modified: 1995-05-09
Generated: 2016-12-26
Generated by src2html V0.67
page hit count: 667
Valid CSS Valid XHTML 1.0 Strict