]> rtime.felk.cvut.cz Git - frescor/fosa.git/blob - src_partikle/fosa_setjmp.S
08795cec873fee5b9e63e19d2f56b9c4e8cce002
[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 // FOSA(Frescor Operating System Adaptation layer)
54 //================================================
55 */
56 /*
57  * $FILE: fosa_setjmp.S
58  *
59  * Setjmp and Longjmp healper functions
60  */
61         
62 .text
63
64 .global fosa_long_jump_save_context, fosa_longjmp
65 .type   fosa_long_jump_save_context,@function
66 .type   fosa_longjmp,@function
67
68 fosa_long_jump_save_context:
69         movl 0(%esp), %ecx
70         leal 4(%esp), %edx
71         movl (%edx), %eax
72         movl %ebx, 0(%eax)
73         movl %esi, 4(%eax)
74         movl %edi, 8(%eax)
75         movl %ebp, 12(%eax)
76         movl %edx, 16(%eax)
77         movl %ecx, 20(%eax)
78         movl $0,   24(%eax)
79         movl $0,   %eax
80         ret
81
82 fosa_longjmp:
83         movl 4(%esp),  %ecx
84         movl 8(%esp),  %eax
85         movl %eax,  24(%ecx)
86         movl 20(%ecx), %edx
87         movl 0(%ecx),  %ebx
88         movl 4(%ecx),  %esi
89         movl 8(%ecx),  %edi
90         movl 12(%ecx), %ebp
91         movl 16(%ecx), %esp
92         movl $0,       %eax
93         jmp *%edx