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

Subversion Repositories or1k

[/] [or1k/] [trunk/] [newlib-1.10.0/] [newlib/] [libc/] [sys/] [sysvi386/] [_longjmp.s] - Blame information for rev 1765

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 1010 ivang
/
2
/ our buffer looks like:
3
/  eax,ebx,ecx,edx,esi,edi,esp,ebp,pc
4
/
5
/ _longjmp is called with two parameters:  jmp_buf*,int
6
/ jmp_buf* is at 4(%esp), int is at 8(%esp)
7
/ retaddr is, of course, at (%esp)
8
 
9
        .globl  _longjmp
10
        .globl  longjmp
11
_longjmp:
12
longjmp:
13
        movl    4(%esp), %ebx   / address of buf
14
        movl    8(%esp), %eax   / store return value
15
 
16
        movl    24(%ebx), %esp  / restore stack
17
        movl    32(%ebx), %edi
18
/ Next line sets up return address.
19
        movl    %edi, 0(%esp)
20
        movl    8(%ebx), %ecx
21
        movl    12(%ebx), %edx
22
        movl    16(%ebx), %esi
23
        movl    20(%ebx), %edi
24
        movl    28(%ebx), %ebp
25
        movl    4(%ebx), %ebx
26
        testl   %eax,%eax
27
        jne     bye
28
        incl    %eax            / eax hold 0 if we are here
29
bye:
30
        ret
31
 

powered by: WebSVN 2.1.0

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