4 ****************************************************************************
5 * Copyright IBM Corporation 1988, 1989 - All Rights Reserved *
7 * Permission to use, copy, modify, and distribute this software and its *
8 * documentation for any purpose and without fee is hereby granted, *
9 * provided that the above copyright notice appear in all copies and *
10 * that both that copyright notice and this permission notice appear in *
11 * supporting documentation, and that the name of IBM not be used in *
12 * advertising or publicity pertaining to distribution of the software *
13 * without specific, written prior permission. *
15 * IBM DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL *
16 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL IBM *
17 * BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY *
18 * DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER *
19 * IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING *
20 * OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. *
21 ****************************************************************************
30 # Information Technology Center
31 # Carnegie-Mellon University
36 # Process assembly language assist for Sailboats.
53 /*# Offsets of fields*/
56 /*# Stuff to allow saving/restoring registers*/
62 # savecontext(f, area1, newsp)
63 # int (*f)(); struct savearea *area1; char *newsp;
68 ai 1,1,-regspace # Save frame pointer & ...
71 stm 0,0(1) # Change this if save fewer regs.
73 /*# Set preemption semaphore*/
77 /*# r3 = base of savearea*/
78 st 1,topstack(3) # area1->topstack = sp
79 /*# New sp is in r4.*/
81 beq L1 # If newsp == 0, no stack switch
82 cas 1,4,0 # Switch to new stack
95 # struct savearea *area2;
105 # Now in the context of the savecontext stack to be restored.
106 # Start with the registers...
107 # Clear preemption semaphore
113 lm 0,0(1) # Change if saving fewer regs.
114 brx 15 # Return to previous process