Welcome to mirror list, hosted at ThFree Co, Russian Federation.

cygwin.com/git/newlib-cygwin.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristopher Faylor <me@cgf.cx>2000-07-01 07:51:55 +0400
committerChristopher Faylor <me@cgf.cx>2000-07-01 07:51:55 +0400
commit14a3bc2fa10e6d2436331f5bdcf3e2665a616137 (patch)
tree621eb94f045bb77fd4291c0a0d1b62f3a5e0ac60 /winsup/cygwin/winsup.h
parent86e25f234a75c9e95b405c30ce1d889776b5b12b (diff)
* Makefile.in: Use variables rather than configure constructs where
appropriate. (LIBCOS): Find additional stub library stuff in their own subdirectory. * dcrt0.cc: Convert user_data pointer to static __cygwin_user_data area. (do_global_ctors): Check magic_bisquit for initialization. (dll_crt0_1): First group of premain functions prior to fd initialization. Run second group before calling main. (dll_crt0 ()): New function, called from new initialization code. (dll_crt0 (per_process *uptr)): Call new dll_crt0 () function on initialization. * debug.cc (thread_stub): Initialize bottom of stack with per-thread info. * environ.cc (parse_thing): Use binmode global to control CYGWIN=binmode behavior. * fhandler.cc (fhandler_base::open): Allow explicit setting of __fmode to O_BINARY or O_TEXT to override disk mount settings. * libcmain.cc: Move to lib subdirectory. * libccrt0.cc: Ditto. * dll_main.cc: Ditto. * dll_entry.cc: Ditto. * getopt.c: Ditto. * thread.cc (thread_init_wrapper): Call ExitThread explicitly rather than returning, as a preliminary step towards placing per thread info at the bottom of the stack. * winsup.h: Move per_process class to include/sys/cygwin.h. Declare new dll_crt0(). * include/cygwin/version.h: Bump API minor version. * binmode.c: New file. * textmode.c: Ditto. * lib/_cygwin_crt0_common.cc: Ditto. * lib/crt0.h: Ditto. * lib/cygwin_attach_dll.c: Ditto. * lib/cygwin_crt0.c: Ditto. * lib/dll_entry.cc: Ditto. * lib/dll_main.cc: Ditto. * lib/getopt.c: Ditto. * lib/libcmain.c: Ditto. * lib/premain0.c: Ditto. * lib/premain1.c: Ditto. * lib/premain2.c: Ditto. * lib/premain3.c: Ditto.
Diffstat (limited to 'winsup/cygwin/winsup.h')
-rw-r--r--winsup/cygwin/winsup.h98
1 files changed, 4 insertions, 94 deletions
diff --git a/winsup/cygwin/winsup.h b/winsup/cygwin/winsup.h
index 29eca9dcc..714955a5a 100644
--- a/winsup/cygwin/winsup.h
+++ b/winsup/cygwin/winsup.h
@@ -93,99 +93,8 @@ extern HANDLE hMainProc;
/********************** Application Interface **************************/
-/* This lives in the app and is initialized before jumping into the DLL.
- It should only contain stuff which the user's process needs to see, or
- which is needed before the user pointer is initialized, or is needed to
- carry inheritance information from parent to child. Note that it cannot
- be used to carry inheritance information across exec!
-
- Remember, this structure is linked into the application's executable.
- Changes to this can invalidate existing executables, so we go to extra
- lengths to avoid having to do it.
-
- When adding/deleting members, remember to adjust {public,internal}_reserved.
- The size of the class shouldn't change [unless you really are prepared to
- invalidate all existing executables]. The program does a check (using
- SIZEOF_PER_PROCESS) to make sure you remember to make the adjustment.
-*/
-
-class per_process
-{
- public:
- char *initial_sp;
-
- /* The offset of these 3 values can never change. */
- /* magic_biscuit is the size of this class and should never change. */
- DWORD magic_biscuit;
- DWORD dll_major;
- DWORD dll_minor;
-
- struct _reent **impure_ptr_ptr;
- char ***envptr;
-
- /* Used to point to the memory machine we should use. Usually these
- point back into the dll, but they can be overridden by the user. */
- void *(*malloc)(size_t);
- void (*free)(void *);
- void *(*realloc)(void *, size_t);
-
- int *fmode_ptr;
-
- int (*main)(int, char **, char **);
- void (**ctors)(void);
- void (**dtors)(void);
-
- /* For fork */
- void *data_start;
- void *data_end;
- void *bss_start;
- void *bss_end;
-
- void *(*calloc)(size_t, size_t);
- /* For future expansion of values set by the app. */
- void (*premain[4]) (int, char **);
-
- /* The rest are *internal* to cygwin.dll.
- Those that are here because we want the child to inherit the value from
- the parent (which happens when bss is copied) are marked as such. */
-
- /* non-zero of ctors have been run. Inherited from parent. */
- int run_ctors_p;
-
- /* These will be non-zero if the above (malloc,free,realloc) have been
- overridden. */
- /* FIXME: not currently used */
- int __imp_malloc;
- int __imp_free;
- int __imp_realloc;
-
- /* Heap management. Inherited from parent. */
- void *heapbase; /* bottom of the heap */
- void *heapptr; /* current index into heap */
- void *heaptop; /* current top of heap */
-
- HANDLE unused1; /* unused */
-
- /* Non-zero means the task was forked. The value is the pid.
- Inherited from parent. */
- int forkee;
-
- HMODULE hmodule;
-
- DWORD api_major; /* API version that this program was */
- DWORD api_minor; /* linked with */
- /* For future expansion, so apps won't have to be relinked if we
- add an item. */
-#ifdef _MT_SAFE
- ResourceLocks *resourcelocks;
- MTinterface *threadinterface;
- void *internal_reserved[6];
-#else
- void *internal_reserved[8];
-#endif
-};
-
-extern per_process *user_data; /* Pointer into application's static data */
+extern "C" per_process __cygwin_user_data; /* Pointer into application's static data */
+#define user_data (&__cygwin_user_data)
/* We use the following to test that sizeof hasn't changed. When adding
or deleting members, insert fillers or use the reserved entries.
@@ -363,9 +272,10 @@ extern unsigned int signal_shift_subtract;
/* cygwin .dll initialization */
void dll_crt0 (per_process *);
+void __stdcall dll_crt0 () __asm__ ("dll_crt0");
/* dynamically loaded dll initialization */
-extern "C" int dll_dllcrt0 (HMODULE,per_process*);
+extern "C" int dll_dllcrt0 (HMODULE, per_process*);
/* dynamically loaded dll initialization for non-cygwin apps */
extern "C" int dll_noncygwin_dllcrt0 (HMODULE, per_process *);