OSDN Git Service

* autoload.h: Make DLL initializers global to avoid inlining.
authorcgf <cgf>
Tue, 26 Dec 2000 03:21:05 +0000 (03:21 +0000)
committercgf <cgf>
Tue, 26 Dec 2000 03:21:05 +0000 (03:21 +0000)
* exceptions.cc (interrupt_setup): Reorganize arguments to allow use of
regparm.
(interrupt_now): Ditto.
(interrupt_on_return): Ditto.
(call_handler): Ditto.

winsup/cygwin/ChangeLog
winsup/cygwin/autoload.cc
winsup/cygwin/autoload.h
winsup/cygwin/exceptions.cc

index bcac790..649fc47 100644 (file)
@@ -1,3 +1,12 @@
+Mon Dec 25 22:18:42 2000  Christopher Faylor <cgf@cygnus.com>
+
+       * autoload.h: Make DLL initializers global to avoid inlining.
+       * exceptions.cc (interrupt_setup): Reorganize arguments to allow use of
+       regparm.
+       (interrupt_now): Ditto.
+       (interrupt_on_return): Ditto.
+       (call_handler): Ditto.
+
 Mon Dec 25 13:36:44 2000  Christopher Faylor <cgf@cygnus.com>
 
        * include/cygwin/version.h: Bump DLL minor version number to 8.
index 83081b7..a556807 100644 (file)
@@ -176,8 +176,8 @@ LoadDLLinitfunc (ws2_32)
   return 0;
 }
 
-static void dummy_autoload (void) __attribute__ ((unused));
-static void
+static void __stdcall dummy_autoload (void) __attribute__ ((unused));
+static void __stdcall
 dummy_autoload (void)
 {
 LoadDLLinit (advapi32)
index 9367c0d..b51df41 100644 (file)
@@ -12,8 +12,8 @@ details. */
 
 #define LoadDLLinitfunc(dllname) \
 HANDLE NO_COPY dllname ## _handle = NULL; \
-static int dllname ## _init () __asm__ (#dllname "_init") __attribute__ ((unused)); \
-static int dllname ## _init ()
+/*static*/ int dllname ## _init () __asm__ (#dllname "_init"); \
+/*static*/ int dllname ## _init ()
 
 #define LoadDLLinitnow(dllname) \
   ({__asm__ ("movl $cygwin_dll_func_load, " #dllname "_init_holder"); dllname##_init ();})
index c18da62..c50e5c1 100644 (file)
@@ -616,9 +616,13 @@ interruptible (DWORD pc, int testvalid = 0)
   return res;
 }
 
+static void __stdcall interrupt_setup (int sig, void *handler, DWORD retaddr,
+                                      DWORD *retaddr_on_stack,
+                                      struct sigaction& siga)
+                     __attribute__((regparm(3)));
 static void __stdcall
-interrupt_setup (int sig, struct sigaction& siga, void *handler,
-                DWORD retaddr, DWORD *retaddr_on_stack)
+interrupt_setup (int sig, void *handler, DWORD retaddr, DWORD *retaddr_on_stack,
+                struct sigaction& siga)
 {
   sigsave.retaddr = retaddr;
   sigsave.retaddr_on_stack = retaddr_on_stack;
@@ -630,10 +634,11 @@ interrupt_setup (int sig, struct sigaction& siga, void *handler,
   sigsave.saved_errno = -1;            // Flag: no errno to save
 }
 
+static bool interrupt_now (CONTEXT *, int, void *, struct sigaction&) __attribute__((regparm(3)));
 static bool
-interrupt_now (CONTEXT *ctx, int sig, struct sigaction& siga, void *handler)
+interrupt_now (CONTEXT *ctx, int sig, void *handler, struct sigaction& siga)
 {
-  interrupt_setup (sig, siga, handler, ctx->Eip, 0);
+  interrupt_setup (sig, handler, ctx->Eip, 0, siga);
   ctx->Eip = (DWORD) sigdelayed;
   SetThreadContext (myself->getthread2signal (), ctx); /* Restart the thread */
   return 1;
@@ -665,8 +670,9 @@ signal_fixup_after_exec (bool isspawn)
     }
 }
 
+static int interrupt_on_return (sigthread *, int, void *, struct sigaction&) __attribute__((regparm(3)));
 static int
-interrupt_on_return (sigthread *th, int sig, struct sigaction& siga, void *handler)
+interrupt_on_return (sigthread *th, int sig, void *handler, struct sigaction& siga)
 {
   int i;
   DWORD ebp = th->frame;
@@ -681,7 +687,7 @@ interrupt_on_return (sigthread *th, int sig, struct sigaction& siga, void *handl
        DWORD *addr_retaddr = ((DWORD *)thestack.sf.AddrFrame.Offset) + 1;
        if (*addr_retaddr  == thestack.sf.AddrReturn.Offset)
          {
-           interrupt_setup (sig, siga, handler, *addr_retaddr, addr_retaddr);
+           interrupt_setup (sig, handler, *addr_retaddr, addr_retaddr, siga);
            *addr_retaddr = (DWORD) sigdelayed;
          }
        return 1;
@@ -699,8 +705,9 @@ set_sig_errno (int e)
   // sigproc_printf ("errno %d", e);
 }
 
+static int call_handler (int, void *, struct sigaction&) __attribute__((regparm(3)));
 static int
-call_handler (int sig, struct sigaction& siga, void *handler)
+call_handler (int sig, void *handler, struct sigaction& siga)
 {
   CONTEXT cx;
   bool interrupted = 0;
@@ -778,12 +785,12 @@ call_handler (int sig, struct sigaction& siga, void *handler)
     try_to_interrupt:
       if (th)
        {
-         interrupted = interrupt_on_return (th, sig, siga, handler);
+         interrupted = interrupt_on_return (th, sig, handler, siga);
          if (!interrupted)
            LeaveCriticalSection (&th->lock);
        }
       else if (interruptible (cx.Eip))
-       interrupted = interrupt_now (&cx, sig, siga, handler);
+       interrupted = interrupt_now (&cx, sig, handler, siga);
       else
        break;
     }
@@ -979,7 +986,7 @@ stop:
 dosig:
   /* Dispatch to the appropriate function. */
   sigproc_printf ("signal %d, about to call %p", sig, thissig.sa_handler);
-  rc = call_handler (sig, thissig, handler);
+  rc = call_handler (sig, handler, thissig);
 
 done:
   sigproc_printf ("returning %d", rc);