]> git.saurik.com Git - apple/libc.git/blob - ppc/gen/getcontext.S
Libc-594.1.4.tar.gz
[apple/libc.git] / ppc / gen / getcontext.S
1 /*
2 * Copyright (c) 2004 Apple Computer, Inc. All rights reserved.
3 *
4 * @APPLE_LICENSE_HEADER_START@
5 *
6 * This file contains Original Code and/or Modifications of Original Code
7 * as defined in and that are subject to the Apple Public Source License
8 * Version 2.0 (the 'License'). You may not use this file except in
9 * compliance with the License. Please obtain a copy of the License at
10 * http://www.opensource.apple.com/apsl/ and read it before using this
11 * file.
12 *
13 * The Original Code and all software distributed under the License are
14 * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
15 * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
16 * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
17 * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
18 * Please see the License for the specific language governing rights and
19 * limitations under the License.
20 *
21 * @APPLE_LICENSE_HEADER_END@
22 */
23
24 #if defined(__ppc__)
25
26 #include <architecture/ppc/asm_help.h>
27
28 TEXT
29 LABEL(_getcontext)
30 mr r4, r1
31 CALL_EXTERN(_getmcontext)
32 stw r1, 44(r3)
33 stw r2, 48(r3)
34 stw r13, 92(r3)
35 stw r14, 96(r3)
36 stw r15, 100(r3)
37 stw r16, 104(r3)
38 stw r17, 108(r3)
39 stw r18, 112(r3)
40 stw r19, 116(r3)
41 stw r21, 124(r3)
42 stw r22, 128(r3)
43 stw r23, 132(r3)
44 stw r24, 136(r3)
45 stw r25, 140(r3)
46 stw r26, 144(r3)
47 stw r27, 148(r3)
48 stw r28, 152(r3)
49 stw r29, 156(r3)
50 stw r30, 160(r3)
51 stw r31, 164(r3)
52 mfcr r0
53 stw r0, 168(r3)
54 mflr r4
55 stw r4, 176(r3)
56 stw r4, 32(r3)
57 li r5, 0
58 stw r5, 52(r3)
59 li r3, 0
60 blr
61
62 #endif /* __ppc__ */