2 * Copyright 2000, International Business Machines Corporation and others.
5 * This software has been released under the terms of the IBM Public
6 * License. For details, see the LICENSE file in the top-level source
7 * directory or online at http://www.openafs.org/dl/license10.html
10 /* Sun 386i... I hope this does the right thing!!!
12 * Written by Derek Atkins <warlord@MIT.EDU>
13 * (debugging help by Chris Provenzano <proven@mit.edu>)
16 * "ojala que es correcto!"
19 #define IGNORE_STDS_H 1
20 /*#ifndef AFS_DJGPP_ENV*/
21 #include <afs/param.h>
22 /*#endif /* AFS_DJGPP_ENV */
39 * savecontext(f, area1, newsp)
40 * int (*f)(); struct savearea *area1; char *newsp;
43 /* offsets, to make my life easier! */
49 #if defined(AFS_DJGPP_ENV) || (defined(AFS_OBSD_ENV) && !defined (AFS_OBSD34_ENV))
50 #define PRE_Block _PRE_Block
51 #define savecontext _savecontext
53 #define returnto _returnto
54 #endif /* AFS_DJGPP_ENV */
60 pushl %ebp /* New Frame! */
62 pusha /* Push all registers */
63 movl $1,PRE_Block /* Pre-emption code */
64 movl area1(%ebp),%eax /* eax = base of savearea */
65 movl %esp,(%eax) /* area->topstack = esp */
66 movl newsp(%ebp),%eax /* get new sp into eax */
68 je L1 /* if new sp is 0 then dont change esp */
69 movl %eax,%esp /* go ahead. make my day! */
71 jmp *f(%ebp) /* ebx = &f */
73 /* Shouldnt be here....*/
79 * struct savearea *area2;
89 movl %esp, %ebp /* New frame, to get correct pointer */
90 movl area2(%ebp),%eax /* eax = area2 */
91 movl (%eax),%esp /* restore esp */
93 movl $0,PRE_Block /* clear it up... */
97 /* I see, said the blind man, as he picked up his hammer and saw! */