1 /* Swap to new context.
2 Copyright (C) 2008-2022 Free Software Foundation, Inc.
3 This file is part of the GNU C Library.
5 The GNU C Library is free software; you can redistribute it and/or
6 modify it under the terms of the GNU Lesser General Public
7 License as published by the Free Software Foundation; either
8 version 2.1 of the License, or (at your option) any later version.
10 The GNU C Library is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 Lesser General Public License for more details.
15 You should have received a copy of the GNU Lesser General Public
16 License along with the GNU C Library. If not, see
17 <https://www.gnu.org/licenses/>. */
20 #include "ucontext_i.h"
25 /* Copy rp to ret0 (r28). */
30 .cfi_def_cfa_offset -64
32 /* Save the current machine context to oucp. */
35 /* Copy oucp to register ret1 (r29). __getcontext saves and
36 restores it on a normal return. It is restored from oR29
44 /* Load return pointer from oR28. */
47 /* Return if error. */
51 /* Load sc_sar flag. */
54 /* Return if oucp context has been reactivated. */
58 /* Mark sc_sar flag. */
62 /* Activate the machine context in ucp. */
66 /* Load return pointer. */
72 weak_alias (__swapcontext, swapcontext)