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!"
36 * savecontext(f, area1, newsp)
37 * int (*f)(); struct savearea *area1; char *newsp;
40 /* offsets, to make my life easier! */
45 .globl _C_LABEL(PRE_Block)
46 .globl _C_LABEL(savecontext)
49 pushl
%ebp
/* New Frame! */
51 pusha
/* Push all registers */
52 movl $
1,_C_LABEL
(PRE_Block
) /* Pre-emption code */
53 movl area1
(%ebp
),%eax
/* eax = base of savearea */
54 movl
%esp
,(%eax
) /* area->topstack = esp */
55 movl newsp
(%ebp
),%eax
/* get new sp into eax */
57 je L1
/* if new sp is 0 then dont change esp */
58 movl
%eax
,%esp
/* go ahead. make my day! */
60 jmp
*f
(%ebp
) /* ebx = &f */
64 * struct savearea *area2;
70 .globl _C_LABEL(returnto)
74 movl
%esp
, %ebp
/* New frame, to get correct pointer */
75 movl area2
(%ebp
),%eax
/* eax = area2 */
76 movl
(%eax
),%esp
/* restore esp */
78 movl $
0,_C_LABEL
(PRE_Block
) /* clear it up... */
82 #if defined(__linux__) && defined(__ELF__)
83 .section .note.GNU-stack,"",%progbits