3 Copyright 2001 Red Hat, Inc.
5 This software is a copyrighted work licensed under the terms of the
6 Cygwin license. Please consult the file "CYGWIN_LICENSE" for
10 /* For the PowerPC, we want to make this function have its structured
11 exception table exception function point to something we control. */
13 extern void __cygwin_exception_handler();
14 extern void mainCRTStartup(void) __attribute__((__exception__(__cygwin_exception_handler)));
17 /* In the following ifdef'd i386 code, the FPU precision is set to 80 bits
18 and all FPU exceptions are masked. The former is needed to make long
19 doubles work correctly. The latter causes the FPU to generate NaNs and
20 Infinities instead of signals for certain operations.
24 #define FPU_RESERVED 0xF0C0
25 #define FPU_DEFAULT 0x033f
27 /* For debugging on *#!$@ windbg. bp for breakpoint. */
28 int __cygwin_crt0_bp = 0;
31 extern int main (int argc, char **argv);
33 void cygwin_crt0 (int (*main) (int, char **));
39 (void)__builtin_return_address(1);
40 asm volatile ("andl $-16,%%esp" ::: "%esp");
42 asm volatile ("int3");
45 volatile unsigned short cw;
47 /* Get Control Word */
48 __asm__ volatile ("fnstcw %0" : "=m" (cw) : );
55 __asm__ volatile ("fldcw %0" :: "m" (cw));