~ubuntu-branches/ubuntu/hardy/silo/hardy-updates

« back to all changes in this revision

Viewing changes to common/jmp.S

  • Committer: Bazaar Package Importer
  • Author(s): Fabio M. Di Nitto
  • Date: 2007-10-25 09:28:08 UTC
  • mfrom: (15.1.1 upstream)
  • Revision ID: james.westby@ubuntu.com-20071025092808-1yhj12t7s4zqsfu5
Tags: 1.4.13a+git20070930-1ubuntu1
* Merge from debian unstable, remaining changes:
  - Build with -fno-stack-protector.
  - Change silo.postinst to automatically update the boot block without
    invoking siloconfig and keep asking questions on upgrades.
  - Convert silo.conf to use /dev/disk/by-uuid.
  - Ubuntu maintainer foobar.
  - Fix debian/rules call to dh_installdocs.
  - Drop the requirement of gcc-4.1 and start using default gcc.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/* setjmp/longjmp code
 
2
   
 
3
   Copyright (C) 1996 Miguel de Icaza
 
4
                 1996 Jakub Jelinek
 
5
   
 
6
   This program is free software; you can redistribute it and/or modify
 
7
   it under the terms of the GNU General Public License as published by
 
8
   the Free Software Foundation; either version 2 of the License, or
 
9
   (at your option) any later version.
 
10
   
 
11
   This program is distributed in the hope that it will be useful,
 
12
   but WITHOUT ANY WARRANTY; without even the implied warranty of
 
13
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 
14
   GNU General Public License for more details.
 
15
 
 
16
   You should have received a copy of the GNU General Public License
 
17
   along with this program; if not, write to the Free Software
 
18
   Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
 
19
   USA.  */
 
20
 
 
21
#define _SV save %sp, -0x40, %sp
 
22
#define _RV restore
 
23
#define FLUSH_ALL_WINDOWS \
 
24
        _SV; _SV; _SV; _SV; _SV; _SV; _SV; \
 
25
        _RV; _RV; _RV; _RV; _RV; _RV; _RV;
 
26
 
 
27
        /* Save our return PC and SP.  */
 
28
        .global _setjmp, setjmp, __sigsetjmp
 
29
setjmp:
 
30
_setjmp:
 
31
__sigsetjmp:
 
32
        st %o7, [%o0]
 
33
        st %sp, [%o0 + 4]
 
34
        retl
 
35
        clr %o0
 
36
 
 
37
        .global __longjmp, longjmp
 
38
longjmp:
 
39
__longjmp:
 
40
        /* Flush register windows.
 
41
           Write all the register windows to their stack slots, and
 
42
           mark them all as invalid (needing to be sucked up from the
 
43
           stack when used).  This ensures that all information needed to
 
44
           unwind to these callers is in memory, not in the register
 
45
           windows.  */
 
46
        FLUSH_ALL_WINDOWS
 
47
        ld [%o0], %o7           /* Return PC.  */
 
48
        ld [%o0 + 4], %fp       /* Saved SP.  */
 
49
        sub %fp, 64, %sp        /* Allocate a register save area.  */
 
50
        tst %o1
 
51
        be,a 1f
 
52
        mov 1, %o1
 
53
1:      retl
 
54
        /* On the way out, put the return value in %o0.  */
 
55
        restore %o1, 0, %o0