~ubuntu-branches/ubuntu/utopic/eglibc/utopic

« back to all changes in this revision

Viewing changes to sysdeps/unix/sysv/linux/ia64/getcontext.S

  • Committer: Package Import Robot
  • Author(s): Adam Conrad
  • Date: 2012-10-26 05:14:58 UTC
  • mfrom: (1.5.1) (4.4.22 experimental)
  • Revision ID: package-import@ubuntu.com-20121026051458-oryotr4i03ob5pab
Tags: 2.16-0ubuntu1
* Merge with unreleased 2.16 in Debian experimental, remaining changes:
  - Drop the Breaks line from libc6, which refers to a Debian transition
  - Remove the libc6 recommends on libc6-i686, which we don't build
  - Enable libc6{,-dev}-armel on armhf and libc6{-dev}-armhf on armel
  - Ship update-locale and validlocale in /usr/sbin in libc-bin
  - Don't build locales or locales-all in Ubuntu, we rely on langpacks
  - Heavily mangle the way we do service restarting on major upgrades
  - Use different MIN_KERNEL_SUPPORTED versions than Debian, due to
    buildd needs.  This should be universally bumped to 3.2.0 once all
    our buildds (including the PPA guests) are running precise kernels
  - Build i386 variants as -march=i686, build amd64 with -O3, and build
    ppc64 variants (both 64-bit and 32-bit) with -O3 -fno-tree-vectorize
  - Re-enable unsubmitted-ldconfig-cache-abi.diff and rebuild the cache
    on upgrades from previous versions that used a different constant
  - debian/patches/any/local-CVE-2012-3406.diff: switch to malloc when
    array grows too large to handle via alloca extension (CVE-2012-3406)
  - Build generic i386/i686 flavour with -mno-tls-direct-seg-refs
* Changes added/dropped with this merge while reducing our delta:
  - Stop building glibc docs from the eglibc source, and instead make
    the glibc-docs stub have a hard dependency on glibc-doc-reference
  - Remove outdated conflicts against ancient versions of ia32-libs
  - Drop the tzdata dependency from libc6, it's in required and minimal
  - Use gcc-4.7/g++-4.7 by default on all our supported architectures
  - Save our historical changelog as changelog.ubuntu in the source
  - Drop nscd's libaudit build-dep for now, as libaudit is in universe
  - Drop the unnecessary Breaks from libc6 to locales and locales-all
  - Ship xen's ld.so.conf.d snippet as /etc/ld.so.conf.d/libc6-xen.conf
* Disable hard failures on the test suite for the first upload to raring

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/* Copyright (C) 2001, 2002 Free Software Foundation, Inc.
2
 
   This file is part of the GNU C Library.
3
 
   Contributed by David Mosberger-Tang <davidm@hpl.hp.com>.
4
 
 
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.
9
 
 
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.
14
 
 
15
 
   You should have received a copy of the GNU Lesser General Public
16
 
   License along with the GNU C Library; if not, write to the Free
17
 
   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
18
 
   02111-1307 USA.  */
19
 
 
20
 
#include <sysdep.h>
21
 
#include <features.h>
22
 
 
23
 
#include "ucontext_i.h"
24
 
 
25
 
/*  __getcontext (ucontext_t *ucp)
26
 
 
27
 
  Saves the machine context in UCP such that when it is activated,
28
 
  it appears as if __getcontext() returned again.  The only difference
29
 
  is that on a first return, r9 contains 1 and on a subsequent
30
 
  return, it contains 0.
31
 
 
32
 
  This implementation in intended to be used for *synchronous* context
33
 
  switches only.  Therefore, it does not have to save anything
34
 
  other than the PRESERVED state.  */
35
 
 
36
 
ENTRY(__getcontext)
37
 
        .prologue
38
 
        .body
39
 
        alloc r11 = ar.pfs, 1, 0, 4, 0
40
 
 
41
 
        // sigprocmask (SIG_BLOCK, NULL, &sc->sc_mask):
42
 
 
43
 
        mov r3 = SC_MASK
44
 
        mov out0 = SIG_BLOCK
45
 
 
46
 
        flushrs                                 // save dirty partition on rbs
47
 
        mov out1 = 0
48
 
        add out2 = r3, in0
49
 
 
50
 
        mov out3 = 8    // sizeof kernel sigset_t
51
 
        DO_CALL(__NR_rt_sigprocmask)
52
 
 
53
 
        mov.m rFPSR = ar.fpsr
54
 
        mov.m rRSC = ar.rsc
55
 
        add r2 = SC_GR+1*8, r32
56
 
        ;;
57
 
        mov.m rBSP = ar.bsp
58
 
        .prologue
59
 
        .save ar.unat, rUNAT
60
 
        mov.m rUNAT = ar.unat
61
 
        .body
62
 
        add r3 = SC_GR+4*8, r32
63
 
        ;;
64
 
 
65
 
.mem.offset 0,0; st8.spill [r2] = r1, (5*8 - 1*8)
66
 
.mem.offset 8,0; st8.spill [r3] = r4, 16
67
 
        mov rPFS = r11
68
 
        ;;
69
 
.mem.offset 0,0; st8.spill [r2] = r5, 16
70
 
.mem.offset 8,0; st8.spill [r3] = r6, 48
71
 
        and rTMP = ~0x3, rRSC
72
 
        ;;
73
 
.mem.offset 0,0; st8.spill [r2] = r7, (SC_FR+2*16-(SC_GR+7*8))
74
 
.mem.offset 8,0; st8.spill [r3] = sp, (SC_FR+3*16-(SC_GR+12*8))
75
 
        ;;
76
 
        mov.m ar.rsc = rTMP             // put RSE into enforced lazy mode
77
 
        mov.m rNAT = ar.unat
78
 
        mov.i rLC = ar.lc
79
 
        ;;
80
 
        mov.m rRNAT = ar.rnat
81
 
        mov.m ar.rsc = rRSC             // restore RSE mode
82
 
        mov rPR = pr
83
 
 
84
 
        /*
85
 
         * Rotate NaT bits by rPOS positions to the right:
86
 
         */
87
 
        stf.spill [r2] = f2, 32
88
 
        stf.spill [r3] = f3, 32
89
 
        add rPOS = SC_GR, r32                   // rPOS <- &sc_gr[0]
90
 
        ;;
91
 
        stf.spill [r2] = f4, (16*16-4*16)
92
 
        stf.spill [r3] = f5, (17*16-5*16)
93
 
        extr.u rPOS = rPOS, 3, 6                // get NaT bit number for r0
94
 
        ;;
95
 
        stf.spill [r2] = f16, 32
96
 
        stf.spill [r3] = f17, 32
97
 
        sub rCPOS = 64, rPOS
98
 
        ;;
99
 
        stf.spill [r2] = f18, 32
100
 
        stf.spill [r3] = f19, 32
101
 
        shr.u rTMP = rNAT, rPOS
102
 
        ;;
103
 
        stf.spill [r2] = f20, 32
104
 
        stf.spill [r3] = f21, 32
105
 
        shl rNAT = rNAT, rCPOS
106
 
        ;;
107
 
        stf.spill [r2] = f22, 32
108
 
        stf.spill [r3] = f23, 32
109
 
        or rNAT = rNAT, rTMP
110
 
        ;;
111
 
        stf.spill [r2] = f24, 32
112
 
        stf.spill [r3] = f25, 32
113
 
        mov r8 = 0
114
 
        ;;
115
 
        stf.spill [r2] = f26, 32
116
 
        stf.spill [r3] = f27, 32
117
 
        mov r9 = 1
118
 
        ;;
119
 
        stf.spill [r2] = f28, 32
120
 
        stf.spill [r3] = f29, 32
121
 
        mov rB0 = b0
122
 
        ;;
123
 
        stf.spill [r2] = f30, 32
124
 
        stf.spill [r3] = f31, 32
125
 
        mov rB1 = b1
126
 
        ;;
127
 
        mov ar.unat = rUNAT     // we're done spilling integer regs; restore caller's UNaT
128
 
        add r2 = SC_NAT, r32
129
 
        add r3 = SC_BSP, r32
130
 
        ;;
131
 
        st8 [r2] = rNAT, (SC_RNAT-SC_NAT)
132
 
        st8 [r3] = rBSP, (SC_UNAT-SC_BSP)
133
 
        mov rB2 = b2
134
 
        ;;
135
 
        st8 [r2] = rRNAT, (SC_FPSR-SC_RNAT)
136
 
        st8 [r3] = rUNAT, (SC_PFS-SC_UNAT)
137
 
        mov rB3 = b3
138
 
        ;;
139
 
        st8 [r2] = rFPSR, (SC_LC-SC_FPSR)
140
 
        st8 [r3] = rPFS, (SC_PR-SC_PFS)
141
 
        mov rB4 = b4
142
 
        ;;
143
 
        st8 [r2] = rLC, (SC_BR+0*8-SC_LC)
144
 
        st8 [r3] = rPR, (SC_BR+1*8-SC_PR)
145
 
        mov rB5 = b5
146
 
        ;;
147
 
        st8 [r2] = rB0, 16
148
 
        st8 [r3] = rB1, 16
149
 
        ;;
150
 
        st8 [r2] = rB2, 16
151
 
        st8 [r3] = rB3, 16
152
 
        ;;
153
 
        st8 [r2] = rB4
154
 
        st8 [r3] = rB5
155
 
        ret
156
 
END(__getcontext)
157
 
 
158
 
weak_alias (__getcontext, getcontext)