diff options
author | Christopher Faylor <me@cgf.cx> | 2000-02-17 19:38:33 +0000 |
---|---|---|
committer | Christopher Faylor <me@cgf.cx> | 2000-02-17 19:38:33 +0000 |
commit | 1fd5e000ace55b323124c7e556a7a864b972a5c4 (patch) | |
tree | dc4fcf1e5e22a040716ef92c496b8d94959b2baa /winsup/cygwin/config | |
parent | 369d8a8fd5e887eca547bf34bccfdf755c9e5397 (diff) | |
download | newlib-1fd5e000ace55b323124c7e556a7a864b972a5c4.zip newlib-1fd5e000ace55b323124c7e556a7a864b972a5c4.tar.gz newlib-1fd5e000ace55b323124c7e556a7a864b972a5c4.tar.bz2 |
import winsup-2000-02-17 snapshot
Diffstat (limited to 'winsup/cygwin/config')
-rw-r--r-- | winsup/cygwin/config/i386/longjmp.c | 51 | ||||
-rw-r--r-- | winsup/cygwin/config/i386/makefrag | 17 | ||||
-rw-r--r-- | winsup/cygwin/config/i386/profile.h | 58 | ||||
-rw-r--r-- | winsup/cygwin/config/i386/setjmp.c | 48 |
4 files changed, 174 insertions, 0 deletions
diff --git a/winsup/cygwin/config/i386/longjmp.c b/winsup/cygwin/config/i386/longjmp.c new file mode 100644 index 0000000..d663e20 --- /dev/null +++ b/winsup/cygwin/config/i386/longjmp.c @@ -0,0 +1,51 @@ +/* longjmp.c + + Copyright 1996, 1998 Cygnus Solutions. + +This file is part of Cygwin. + +This software is a copyrighted work licensed under the terms of the +Cygwin license. Please consult the file "CYGWIN_LICENSE" for +details. */ + +#ifdef __i386__ +#if 1 +asm (" .globl _longjmp \n" +"_longjmp: \n" +" pushl %ebp \n" +" movl %esp,%ebp \n" +" movl 8(%ebp),%edi \n" +" movl 12(%ebp),%eax \n" +" testl %eax,%eax \n" +" jne 0f \n" +" incl %eax \n" +"0: \n" +" movl %eax,0(%edi) \n" +" movl 24(%edi),%ebp \n" +" pushfl \n" +" popl %ebx \n" +" movw 42(%edi),%ax \n" +" movw %ax,%ss \n" +" movl 28(%edi),%esp \n" +" pushl 32(%edi) \n" +" pushl %ebx \n" +" movw 36(%edi),%ax \n" +" movw %ax,%es \n" +#if 0 +/* fs is a system register in windows; don't muck with it */ +" movw 38(%edi),%ax \n" +" movw %ax,%fs \n" +#endif +" movw 40(%edi),%ax \n" +" movw %ax,%gs \n" +" movl 0(%edi),%eax \n" +" movl 4(%edi),%ebx \n" +" movl 8(%edi),%ecx \n" +" movl 12(%edi),%edx \n" +" movl 16(%edi),%esi \n" +" movl 20(%edi),%edi \n" +" popfl \n" +" ret \n"); +#endif + +#endif /* __i386__ */ diff --git a/winsup/cygwin/config/i386/makefrag b/winsup/cygwin/config/i386/makefrag new file mode 100644 index 0000000..a8b3942 --- /dev/null +++ b/winsup/cygwin/config/i386/makefrag @@ -0,0 +1,17 @@ +# makefrag: included by the main Cygwin Makefile.in + +# Copyright 1996, 1998 Cygnus Solutions. + +# This file is part of Cygwin. + +# This software is a copyrighted work licensed under the terms of the +# Cygwin license. Please consult the file "CYGWIN_LICENSE" for +# details. + +EXTRA_DLL_OFILES=setjmp.o longjmp.o + +setjmp.o:config/i386/setjmp.c + $(CC) -c $(ALL_CFLAGS) $< + +longjmp.o:config/i386/longjmp.c + $(CC) -c $(ALL_CFLAGS) $< diff --git a/winsup/cygwin/config/i386/profile.h b/winsup/cygwin/config/i386/profile.h new file mode 100644 index 0000000..ad5f625 --- /dev/null +++ b/winsup/cygwin/config/i386/profile.h @@ -0,0 +1,58 @@ +/* $NetBSD: profile.h,v 1.6 1995/03/28 18:17:08 jtc Exp $ */ + +/* + * Copyright (c) 1992, 1993 + * The Regents of the University of California. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * This product includes software developed by the University of + * California, Berkeley and its contributors. + * 4. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * @(#)profile.h 8.1 (Berkeley) 6/11/93 + */ + +#define _MCOUNT_DECL static inline void _mcount + +#define MCOUNT \ +void \ +mcount() \ +{ \ + int selfpc, frompcindex; \ + /* \ + * find the return address for mcount, \ + * and the return address for mcount's caller. \ + * \ + * selfpc = pc pushed by mcount call \ + */ \ + __asm("movl 4(%%ebp),%0" : "=r" (selfpc)); \ + /* \ + * frompcindex = pc pushed by call into self. \ + */ \ + __asm("movl (%%ebp),%0;movl 4(%0),%0" : "=r" (frompcindex)); \ + _mcount(frompcindex, selfpc); \ +} + diff --git a/winsup/cygwin/config/i386/setjmp.c b/winsup/cygwin/config/i386/setjmp.c new file mode 100644 index 0000000..befd7e6 --- /dev/null +++ b/winsup/cygwin/config/i386/setjmp.c @@ -0,0 +1,48 @@ +/* setjmp.c + + Copyright 1996, 1998 Cygnus Solutions. + +This file is part of Cygwin. + +This software is a copyrighted work licensed under the terms of the +Cygwin license. Please consult the file "CYGWIN_LICENSE" for +details. */ + +#ifdef __i386__ + +#if 1 +asm(" .globl _setjmp \n" +"_setjmp: \n" +" pushl %ebp \n" +" movl %esp,%ebp \n" +" pushl %edi \n" +" movl 8(%ebp),%edi \n" +" movl %eax,0(%edi) \n" +" movl %ebx,4(%edi) \n" +" movl %ecx,8(%edi) \n" +" movl %edx,12(%edi) \n" +" movl %esi,16(%edi) \n" +" movl -4(%ebp),%eax \n" +" movl %eax,20(%edi) \n" +" movl 0(%ebp),%eax \n" +" movl %eax,24(%edi) \n" +" movl %esp,%eax \n" +" addl $12,%eax \n" +" movl %eax,28(%edi) \n" +" movl 4(%ebp),%eax \n" +" movl %eax,32(%edi) \n" +" movw %es, %ax \n" +" movw %ax, 36(%edi) \n" +" movw %fs, %ax \n" +" movw %ax, 38(%edi) \n" +" movw %gs, %ax \n" +" movw %ax, 40(%edi) \n" +" movw %ss, %ax \n" +" movw %ax, 42(%edi) \n" +" popl %edi \n" +" movl $0,%eax \n" +" leave \n" +" ret \n"); +#endif + +#endif /* __i386__ */ |