* 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.
This commit is contained in:
		| @@ -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> | Mon Dec 25 13:36:44 2000  Christopher Faylor <cgf@cygnus.com> | ||||||
|  |  | ||||||
| 	* include/cygwin/version.h: Bump DLL minor version number to 8. | 	* include/cygwin/version.h: Bump DLL minor version number to 8. | ||||||
|   | |||||||
| @@ -176,8 +176,8 @@ LoadDLLinitfunc (ws2_32) | |||||||
|   return 0; |   return 0; | ||||||
| } | } | ||||||
|  |  | ||||||
| static void dummy_autoload (void) __attribute__ ((unused)); | static void __stdcall dummy_autoload (void) __attribute__ ((unused)); | ||||||
| static void | static void __stdcall | ||||||
| dummy_autoload (void) | dummy_autoload (void) | ||||||
| { | { | ||||||
| LoadDLLinit (advapi32) | LoadDLLinit (advapi32) | ||||||
|   | |||||||
| @@ -12,8 +12,8 @@ details. */ | |||||||
|  |  | ||||||
| #define LoadDLLinitfunc(dllname) \ | #define LoadDLLinitfunc(dllname) \ | ||||||
| HANDLE NO_COPY dllname ## _handle = NULL; \ | HANDLE NO_COPY dllname ## _handle = NULL; \ | ||||||
| static int dllname ## _init () __asm__ (#dllname "_init") __attribute__ ((unused)); \ | /*static*/ int dllname ## _init () __asm__ (#dllname "_init"); \ | ||||||
| static int dllname ## _init () | /*static*/ int dllname ## _init () | ||||||
|  |  | ||||||
| #define LoadDLLinitnow(dllname) \ | #define LoadDLLinitnow(dllname) \ | ||||||
|   ({__asm__ ("movl $cygwin_dll_func_load, " #dllname "_init_holder"); dllname##_init ();}) |   ({__asm__ ("movl $cygwin_dll_func_load, " #dllname "_init_holder"); dllname##_init ();}) | ||||||
|   | |||||||
| @@ -616,9 +616,13 @@ interruptible (DWORD pc, int testvalid = 0) | |||||||
|   return res; |   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 | static void __stdcall | ||||||
| interrupt_setup (int sig, struct sigaction& siga, void *handler, | interrupt_setup (int sig, void *handler, DWORD retaddr, DWORD *retaddr_on_stack, | ||||||
| 		 DWORD retaddr, DWORD *retaddr_on_stack) | 		 struct sigaction& siga) | ||||||
| { | { | ||||||
|   sigsave.retaddr = retaddr; |   sigsave.retaddr = retaddr; | ||||||
|   sigsave.retaddr_on_stack = retaddr_on_stack; |   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 |   sigsave.saved_errno = -1;		// Flag: no errno to save | ||||||
| } | } | ||||||
|  |  | ||||||
|  | static bool interrupt_now (CONTEXT *, int, void *, struct sigaction&) __attribute__((regparm(3))); | ||||||
| static bool | 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; |   ctx->Eip = (DWORD) sigdelayed; | ||||||
|   SetThreadContext (myself->getthread2signal (), ctx); /* Restart the thread */ |   SetThreadContext (myself->getthread2signal (), ctx); /* Restart the thread */ | ||||||
|   return 1; |   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 | 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; |   int i; | ||||||
|   DWORD ebp = th->frame; |   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; | 	DWORD *addr_retaddr = ((DWORD *)thestack.sf.AddrFrame.Offset) + 1; | ||||||
| 	if (*addr_retaddr  == thestack.sf.AddrReturn.Offset) | 	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; | 	    *addr_retaddr = (DWORD) sigdelayed; | ||||||
| 	  } | 	  } | ||||||
| 	return 1; | 	return 1; | ||||||
| @@ -699,8 +705,9 @@ set_sig_errno (int e) | |||||||
|   // sigproc_printf ("errno %d", e); |   // sigproc_printf ("errno %d", e); | ||||||
| } | } | ||||||
|  |  | ||||||
|  | static int call_handler (int, void *, struct sigaction&) __attribute__((regparm(3))); | ||||||
| static int | static int | ||||||
| call_handler (int sig, struct sigaction& siga, void *handler) | call_handler (int sig, void *handler, struct sigaction& siga) | ||||||
| { | { | ||||||
|   CONTEXT cx; |   CONTEXT cx; | ||||||
|   bool interrupted = 0; |   bool interrupted = 0; | ||||||
| @@ -778,12 +785,12 @@ call_handler (int sig, struct sigaction& siga, void *handler) | |||||||
|     try_to_interrupt: |     try_to_interrupt: | ||||||
|       if (th) |       if (th) | ||||||
| 	{ | 	{ | ||||||
| 	  interrupted = interrupt_on_return (th, sig, siga, handler); | 	  interrupted = interrupt_on_return (th, sig, handler, siga); | ||||||
| 	  if (!interrupted) | 	  if (!interrupted) | ||||||
| 	    LeaveCriticalSection (&th->lock); | 	    LeaveCriticalSection (&th->lock); | ||||||
| 	} | 	} | ||||||
|       else if (interruptible (cx.Eip)) |       else if (interruptible (cx.Eip)) | ||||||
| 	interrupted = interrupt_now (&cx, sig, siga, handler); | 	interrupted = interrupt_now (&cx, sig, handler, siga); | ||||||
|       else |       else | ||||||
| 	break; | 	break; | ||||||
|     } |     } | ||||||
| @@ -979,7 +986,7 @@ stop: | |||||||
| dosig: | dosig: | ||||||
|   /* Dispatch to the appropriate function. */ |   /* Dispatch to the appropriate function. */ | ||||||
|   sigproc_printf ("signal %d, about to call %p", sig, thissig.sa_handler); |   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: | done: | ||||||
|   sigproc_printf ("returning %d", rc); |   sigproc_printf ("returning %d", rc); | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user