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

Subversion Repositories or1k

[/] [or1k/] [trunk/] [newlib-1.10.0/] [newlib/] [libc/] [sys/] [go32/] [longjmp.S] - Diff between revs 1010 and 1765

Only display areas with differences | Details | Blame | View Log

Rev 1010 Rev 1765
/* This is file LONGJMP.S */
/* This is file LONGJMP.S */
/*
/*
** Copyright (C) 1993 DJ Delorie
** Copyright (C) 1993 DJ Delorie
**
**
** This file is distributed under the terms listed in the document
** This file is distributed under the terms listed in the document
** "copying.dj".
** "copying.dj".
** A copy of "copying.dj" should accompany this file; if not, a copy
** A copy of "copying.dj" should accompany this file; if not, a copy
** should be available from where this file was obtained.  This file
** should be available from where this file was obtained.  This file
** may not be distributed without a verbatim copy of "copying.dj".
** may not be distributed without a verbatim copy of "copying.dj".
**
**
** This file is distributed WITHOUT ANY WARRANTY; without even the implied
** This file is distributed WITHOUT ANY WARRANTY; without even the implied
** warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
** warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
*/
*/
/*
/*
**      jmp_buf:
**      jmp_buf:
**       eax ebx ecx edx esi edi ebp esp eip es fs gs ss
**       eax ebx ecx edx esi edi ebp esp eip es fs gs ss
**       0   4   8   12  16  20  24  28  32  36 38 40 42
**       0   4   8   12  16  20  24  28  32  36 38 40 42
*/
*/
        .globl  _longjmp /* jmp_buf, int */
        .globl  _longjmp /* jmp_buf, int */
_longjmp:
_longjmp:
        pushl   %ebp
        pushl   %ebp
        movl    %esp,%ebp
        movl    %esp,%ebp
        movl    8(%ebp),%edi    /* get jmp_buf */
        movl    8(%ebp),%edi    /* get jmp_buf */
        movl    12(%ebp),%eax   /* store retval in j->eax */
        movl    12(%ebp),%eax   /* store retval in j->eax */
        testl   %eax,%eax
        testl   %eax,%eax
        jne 0f
        jne 0f
        incl %eax
        incl %eax
0:
0:
        movl    %eax,0(%edi)
        movl    %eax,0(%edi)
        movl    24(%edi),%ebp
        movl    24(%edi),%ebp
        pushfl                  /* get flags so will only re-enable */
        pushfl                  /* get flags so will only re-enable */
        popl    %ebx            /* interrupts if they were previously */
        popl    %ebx            /* interrupts if they were previously */
                                /* enabled */
                                /* enabled */
        cli
        cli
        movw    42(%edi),%ax
        movw    42(%edi),%ax
        movw    %ax,%ss
        movw    %ax,%ss
        movl    28(%edi),%esp
        movl    28(%edi),%esp
        pushl   32(%edi)        /* for a ret! */
        pushl   32(%edi)        /* for a ret! */
        pushl   %ebx            /* save flags that contain previous */
        pushl   %ebx            /* save flags that contain previous */
                                /* interrupt state */
                                /* interrupt state */
        movw    36(%edi),%ax
        movw    36(%edi),%ax
        movw    %ax,%es
        movw    %ax,%es
        movw    38(%edi),%ax
        movw    38(%edi),%ax
        movw    %ax,%fs
        movw    %ax,%fs
        movw    40(%edi),%ax
        movw    40(%edi),%ax
        movw    %ax,%gs
        movw    %ax,%gs
        movl    0(%edi),%eax
        movl    0(%edi),%eax
        movl    4(%edi),%ebx
        movl    4(%edi),%ebx
        movl    8(%edi),%ecx
        movl    8(%edi),%ecx
        movl    12(%edi),%edx
        movl    12(%edi),%edx
        movl    16(%edi),%esi
        movl    16(%edi),%esi
        movl    20(%edi),%edi
        movl    20(%edi),%edi
        popfl                   /* restore previous interrupt state */
        popfl                   /* restore previous interrupt state */
        ret                     /* actually jump to new eip */
        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.