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!"
20 #if defined(__linux__) && defined(__ELF__)
21 .section .note.GNU-stack,"",%progbits
39 * savecontext(f, area1, newsp)
40 * int (*f)(); struct savearea *area1; char *newsp;
43 /* offsets, to make my life easier! */
48 .globl _C_LABEL(PRE_Block)
49 .globl _C_LABEL(savecontext)
52 pushl %ebp /* New Frame! */
54 pusha /* Push all registers */
55 movl $1,_C_LABEL(PRE_Block) /* Pre-emption code */
56 movl area1(%ebp),%eax /* eax = base of savearea */
57 movl %esp,(%eax) /* area->topstack = esp */
58 movl newsp(%ebp),%eax /* get new sp into eax */
60 je L1 /* if new sp is 0 then dont change esp */
61 movl %eax,%esp /* go ahead. make my day! */
63 jmp *f(%ebp) /* ebx = &f */
67 * struct savearea *area2;
73 .globl _C_LABEL(returnto)
77 movl %esp, %ebp /* New frame, to get correct pointer */
78 movl area2(%ebp),%eax /* eax = area2 */
79 movl (%eax),%esp /* restore esp */
81 movl $0,_C_LABEL(PRE_Block) /* clear it up... */