2N/A * The contents of this file are subject to the terms of the 2N/A * Common Development and Distribution License (the "License"). 2N/A * You may not use this file except in compliance with the License. 2N/A * See the License for the specific language governing permissions 2N/A * and limitations under the License. 2N/A * When distributing Covered Code, include this CDDL HEADER in each 2N/A * If applicable, add the following below this CDDL HEADER, with the 2N/A * fields enclosed by brackets "[]" replaced with your own identifying 2N/A * information: Portions Copyright [yyyy] [name of copyright owner] 2N/A * Copyright 2008 Sun Microsystems, Inc. All rights reserved. 2N/A * Use is subject to license terms. 2N/A * getcontext() and swapcontext() are written in assembler since it has to 2N/A * capture the correct machine state of the caller, including 2N/A * the registers: %edi, %esi and %ebx. 2N/A * As swapcontext() is actually equivalent to getcontext() + setcontext(), 2N/A * swapcontext() shares the most code with getcontext(). 2N/A * fix up %esp and %eip \ 2N/A /* %edx <-- &ucp->uc_mcontext.gregs */ \
2N/A /* store ret PC in EIP of env var */ \
2N/A /* store the sp into UESP of env var */ \
2N/A /* getcontext returns 0 after a setcontext */ 2N/A * getcontext(ucontext_t *ucp) 2N/A * swapcontext(ucontext_t *oucp, const ucontext_t *ucp)