3 Copyright 2003, 2004 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
16 #define _NOMNTENT_FUNCS
18 #undef _NOMNTENT_FUNCS
20 #define CYGTLS_INITIALIZED 0x43227
21 #define CYGTLS_EXCEPTION (0x43227 + true)
24 # define CYG_MAX_PATH 260
31 #define TLS_STACK_SIZE 256
37 Needed for the group functions
52 char pass[_PASSWORD_LEN];
58 unsigned available_drives;
61 char mnt_fsname[CYG_MAX_PATH];
62 char mnt_dir[CYG_MAX_PATH];
65 char strerror_buf[20];
74 char timezone_buf[20];
75 struct tm _localtime_buf;
78 char username[UNLEN + 1];
82 struct protoent *protoent_buf;
83 struct servent *servent_buf;
84 struct hostent *hostent_buf;
85 char signamebuf[sizeof ("Unknown signal 4294967295 ")];
88 /* Please keep this file simple. Changes to the below structure may require
89 acompanying changes to the very simple parser in the perl script
90 'gentls_offsets' (<<-- start parsing here). */
92 typedef __uint32_t __stack_t;
95 void (*func) /*gentls_offsets*/(int)/*gentls_offsets*/;
102 unsigned initialized;
104 sigset_t sigwait_mask;
105 siginfo_t *sigwait_info;
109 struct _reent local_clib;
110 struct _local_storage locals;
111 struct _cygtls *prev, *next;
115 __stack_t stack[TLS_STACK_SIZE];
119 static CRITICAL_SECTION protect_linked_list;
121 void init_thread (void *, DWORD (*) (void *, void *));
122 static void call (DWORD (*) (void *, void *), void *);
123 static void call2 (DWORD (*) (void *, void *), void *, void *) __attribute__ ((regparm (3)));
124 static struct _cygtls *find_tls (int sig);
126 void push (__stack_t, bool) __attribute__ ((regparm (3)));
127 __stack_t pop () __attribute__ ((regparm (1)));
128 bool isinitialized () {return initialized == CYGTLS_INITIALIZED || initialized == CYGTLS_EXCEPTION;}
129 void set_state (bool);
130 void reset_exception ();
131 bool interrupt_now (CONTEXT *, int, void *, struct sigaction&)
132 __attribute__((regparm(3)));
133 void __stdcall interrupt_setup (int sig, void *handler,
134 struct sigaction& siga)
135 __attribute__((regparm(3)));
136 void init_threadlist_exceptions (struct _exception_list *);
137 operator HANDLE () const {return tid->win32_obj_id;}
138 void set_siginfo (struct sigpacket *) __attribute__ ((regparm (3)));
139 void set_threadkill () {threadkill = true;}
140 void reset_threadkill () {threadkill = false;}
141 int call_signal_handler () __attribute__ ((regparm (1)));
142 void fixup_after_fork () __attribute__ ((regparm (1)));
143 void lock () __attribute__ ((regparm (1)));
144 void unlock () __attribute__ ((regparm (1)));
145 bool locked () __attribute__ ((regparm (1)));
150 extern char *_tlsbase __asm__ ("%fs:4");
151 extern char *_tlstop __asm__ ("%fs:8");
152 #define _my_tls (((_cygtls *) _tlsbase)[-1])
153 extern _cygtls *_main_tls;
155 #define __getreent() (&_my_tls.local_clib)
157 const int CYGTLS_PADSIZE = (((char *) _main_tls->padding) - ((char *) _main_tls));