OpenCores
URL https://opencores.org/ocsvn/or1k/or1k/trunk

Subversion Repositories or1k

[/] [or1k/] [tags/] [tn_m001/] [newlib/] [newlib/] [libc/] [sys/] [go32/] [longjmp.S] - Blame information for rev 39

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 39 lampret
/* This is file LONGJMP.S */
2
/*
3
** Copyright (C) 1993 DJ Delorie, 24 Kirsten Ave, Rochester NH 03867-2954
4
**
5
** This file is distributed under the terms listed in the document
6
** "copying.dj", available from DJ Delorie at the address above.
7
** A copy of "copying.dj" should accompany this file; if not, a copy
8
** should be available from where this file was obtained.  This file
9
** may not be distributed without a verbatim copy of "copying.dj".
10
**
11
** This file is distributed WITHOUT ANY WARRANTY; without even the implied
12
** warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
13
*/
14
 
15
/*
16
**      jmp_buf:
17
**       eax ebx ecx edx esi edi ebp esp eip es fs gs ss
18
**       0   4   8   12  16  20  24  28  32  36 38 40 42
19
*/
20
 
21
        .globl  _longjmp /* jmp_buf, int */
22
_longjmp:
23
        pushl   %ebp
24
        movl    %esp,%ebp
25
 
26
        movl    8(%ebp),%edi    /* get jmp_buf */
27
        movl    12(%ebp),%eax   /* store retval in j->eax */
28
        testl   %eax,%eax
29
        jne 0f
30
        incl %eax
31
0:
32
        movl    %eax,0(%edi)
33
 
34
        movl    24(%edi),%ebp
35
 
36
        pushfl                  /* get flags so will only re-enable */
37
        popl    %ebx            /* interrupts if they were previously */
38
                                /* enabled */
39
 
40
        cli
41
        movw    42(%edi),%ax
42
        movw    %ax,%ss
43
        movl    28(%edi),%esp
44
 
45
        pushl   32(%edi)        /* for a ret! */
46
 
47
        pushl   %ebx            /* save flags that contain previous */
48
                                /* interrupt state */
49
 
50
        movw    36(%edi),%ax
51
        movw    %ax,%es
52
        movw    38(%edi),%ax
53
        movw    %ax,%fs
54
        movw    40(%edi),%ax
55
        movw    %ax,%gs
56
        movl    0(%edi),%eax
57
        movl    4(%edi),%ebx
58
        movl    8(%edi),%ecx
59
        movl    12(%edi),%edx
60
        movl    16(%edi),%esi
61
        movl    20(%edi),%edi
62
 
63
        popfl                   /* restore previous interrupt state */
64
 
65
        ret                     /* actually jump to new eip */

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.