]> rtime.felk.cvut.cz Git - frescor/fosa.git/blob - src_partikle/fosa_setjmp.S
Makefile: Add missing header file
[frescor/fosa.git] / src_partikle / fosa_setjmp.S
1 /*
2 //----------------------------------------------------------------------
3 //  Copyright (C) 2006 - 2007 by the FRESCOR consortium:
4 //
5 //    Universidad de Cantabria,              SPAIN
6 //    University of York,                    UK
7 //    Scuola Superiore Sant'Anna,            ITALY
8 //    Kaiserslautern University,             GERMANY
9 //    Univ. Politecnica  Valencia,           SPAIN
10 //    Czech Technical University in Prague,  CZECH REPUBLIC
11 //    ENEA                                   SWEDEN
12 //    Thales Communication S.A.              FRANCE
13 //    Visual Tools S.A.                      SPAIN
14 //    Rapita Systems Ltd                     UK
15 //    Evidence                               ITALY
16 //
17 //    See http://www.frescor.org
18 //
19 //        The FRESCOR project (FP6/2005/IST/5-034026) is funded
20 //        in part by the European Union Sixth Framework Programme
21 //        The European Union is not liable of any use that may be
22 //        made of this code.
23 //
24 //
25 //  based on previous work (FSF) done in the FIRST project
26 //
27 //   Copyright (C) 2005  Mälardalen University, SWEDEN
28 //                       Scuola Superiore S.Anna, ITALY
29 //                       Universidad de Cantabria, SPAIN
30 //                       University of York, UK
31 //
32 // This file is part of FOSA (Frsh Operating System Abstraction)
33 //
34 // FOSA is free software; you can redistribute it and/or modify it
35 // under terms of the GNU General Public License as published by the
36 // Free Software Foundation; either version 2, or (at your option) any
37 // later version.  FOSA is distributed in the hope that it will be
38 // useful, but WITHOUT ANY WARRANTY; without even the implied warranty
39 // of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
40 // General Public License for more details. You should have received a
41 // copy of the GNU General Public License along with FOSA; see file
42 // COPYING. If not, write to the Free Software Foundation, 675 Mass Ave,
43 // Cambridge, MA 02139, USA.
44     //
45 // As a special exception, including FOSA header files in a file,
46 // instantiating FOSA generics or templates, or linking other files
47 // with FOSA objects to produce an executable application, does not
48 // by itself cause the resulting executable application to be covered
49 // by the GNU General Public License. This exception does not
50 // however invalidate any other reasons why the executable file might be
51 // covered by the GNU Public License.
52 // -----------------------------------------------------------------------
53
54 // FOSA(Frescor Operating System Adaptation layer)
55 //================================================
56 */
57 /*
58  * $FILE: fosa_setjmp.S
59  *
60  * Setjmp and Longjmp healper functions
61  */
62
63 .text
64
65 .global fosa_long_jump_save_context, fosa_setjmp, fosa_longjmp
66 .type   fosa_long_jump_save_context,@function
67 .type   fosa_setjmp,@function
68 .type   fosa_longjmp,@function
69
70
71 fosa_long_jump_save_context:
72         subl    $44,  %esp
73         cmpl    $0, 48(%esp)
74         jne     .L2
75         movl    $22, 24(%esp)
76         jmp     .L4
77 .L2:
78         movl    $0,  24(%esp)
79         movl    44(%esp), %ecx
80         leal    48(%esp), %edx
81         movl    48(%esp), %eax
82         movl    %ebx, 0(%eax)
83         movl    %esi, 4(%eax)
84         movl    %edi, 8(%eax)
85         movl    %ebp, 12(%eax)
86         movl    %edx, 16(%eax)
87         movl    %ecx, 20(%eax)
88         movl    $0,   24(%eax)
89
90         leal    28(%eax), %eax
91         movl    %eax, 8(%esp)
92         movl    $0, 4(%esp)
93         movl    $0, (%esp)
94         call    pthread_sigmask
95
96 .L4:
97         movl    24(%esp), %eax
98         addl    $44, %esp
99         ret
100
101
102 fosa_setjmp:
103         movl 0(%esp), %ecx
104         leal 4(%esp), %edx
105         movl (%edx), %eax
106         movl %ebx, 0(%eax)
107         movl %esi, 4(%eax)
108         movl %edi, 8(%eax)
109         movl %ebp, 12(%eax)
110         movl %edx, 16(%eax)
111         movl %ecx, 20(%eax)
112         movl $0,   24(%eax)
113         movl $0,   %eax
114         ret
115
116 fosa_longjmp:
117         movl 4(%esp),  %ecx
118         movl 8(%esp),  %eax
119         movl %eax,  24(%ecx)
120         movl 20(%ecx), %edx
121         movl 0(%ecx),  %ebx
122         movl 4(%ecx),  %esi
123         movl 8(%ecx),  %edi
124         movl 12(%ecx), %ebp
125         movl 16(%ecx), %esp
126         movl $0,       %eax
127         jmp *%edx