Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(256)

Side by Side Diff: mozilla/nsprpub/pr/include/md/_win95.h

Issue 14249009: Change the NSS and NSPR source tree to the new directory structure to be (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/deps/third_party/nss/
Patch Set: Created 7 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « mozilla/nsprpub/pr/include/md/_win32_errors.h ('k') | mozilla/nsprpub/pr/include/md/_win95.cfg » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
2 /* This Source Code Form is subject to the terms of the Mozilla Public
3 * License, v. 2.0. If a copy of the MPL was not distributed with this
4 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
5
6 #ifndef nspr_win95_defs_h___
7 #define nspr_win95_defs_h___
8
9 #include "prio.h"
10
11 #include <windows.h>
12 #include <winsock.h>
13 #include <errno.h>
14
15 /*
16 * Internal configuration macros
17 */
18
19 #define PR_LINKER_ARCH "win32"
20 #define _PR_SI_SYSNAME "WIN95"
21 #if defined(_M_IX86) || defined(_X86_)
22 #define _PR_SI_ARCHITECTURE "x86"
23 #elif defined(_M_X64) || defined(_M_AMD64) || defined(_AMD64_)
24 #define _PR_SI_ARCHITECTURE "x86-64"
25 #elif defined(_M_IA64) || defined(_IA64_)
26 #define _PR_SI_ARCHITECTURE "ia64"
27 #elif defined(_M_ARM) || defined(_ARM_)
28 #define _PR_SI_ARCHITECTURE "arm"
29 #else
30 #error unknown processor architecture
31 #endif
32
33 #define HAVE_DLL
34 #undef HAVE_THREAD_AFFINITY
35 #ifndef _PR_INET6
36 #define AF_INET6 23
37 /* newer ws2tcpip.h provides these */
38 #ifndef AI_CANONNAME
39 #define AI_CANONNAME 0x2
40 #define AI_NUMERICHOST 0x4
41 #define NI_NUMERICHOST 0x02
42 struct addrinfo {
43 int ai_flags;
44 int ai_family;
45 int ai_socktype;
46 int ai_protocol;
47 size_t ai_addrlen;
48 char *ai_canonname;
49 struct sockaddr *ai_addr;
50 struct addrinfo *ai_next;
51 };
52 #endif
53 #define _PR_HAVE_MD_SOCKADDR_IN6
54 /* isomorphic to struct in6_addr on Windows */
55 struct _md_in6_addr {
56 union {
57 PRUint8 _S6_u8[16];
58 PRUint16 _S6_u16[8];
59 } _S6_un;
60 };
61 /* isomorphic to struct sockaddr_in6 on Windows */
62 struct _md_sockaddr_in6 {
63 PRInt16 sin6_family;
64 PRUint16 sin6_port;
65 PRUint32 sin6_flowinfo;
66 struct _md_in6_addr sin6_addr;
67 PRUint32 sin6_scope_id;
68 };
69 #endif
70 #define _PR_HAVE_THREADSAFE_GETHOST
71 #define _PR_HAVE_ATOMIC_OPS
72 #define PR_HAVE_WIN32_NAMED_SHARED_MEMORY
73
74 /* --- Common User-Thread/Native-Thread Definitions --------------------- */
75
76 /* --- Globals --- */
77 extern struct PRLock *_pr_schedLock;
78
79 /* --- Typedefs --- */
80 typedef void (*FiberFunc)(void *);
81
82 #define PR_NUM_GCREGS 8
83 typedef PRInt32 PR_CONTEXT_TYPE[PR_NUM_GCREGS];
84 #define GC_VMBASE 0x40000000
85 #define GC_VMLIMIT 0x00FFFFFF
86
87 #define _MD_MAGIC_THREAD 0x22222222
88 #define _MD_MAGIC_THREADSTACK 0x33333333
89 #define _MD_MAGIC_SEGMENT 0x44444444
90 #define _MD_MAGIC_DIR 0x55555555
91 #define _MD_MAGIC_CV 0x66666666
92
93 struct _MDCPU {
94 int unused;
95 };
96
97 struct _MDThread {
98 HANDLE blocked_sema; /* Threads block on this when waiting
99 * for IO or CondVar.
100 */
101 PRBool inCVWaitQueue; /* PR_TRUE if the thread is in the
102 * wait queue of some cond var.
103 * PR_FALSE otherwise. */
104 HANDLE handle; /* Win32 thread handle */
105 PRUint32 id;
106 void *sp; /* only valid when suspended */
107 PRUint32 magic; /* for debugging */
108 PR_CONTEXT_TYPE gcContext; /* Thread context for GC */
109 struct PRThread *prev, *next; /* used by the cvar wait queue to
110 * chain the PRThread structures
111 * together */
112 void (*start)(void *); /* used by _PR_MD_CREATE_THREAD to
113 * pass its 'start' argument to
114 * pr_root. */
115 };
116
117 struct _MDThreadStack {
118 PRUint32 magic; /* for debugging */
119 };
120
121 struct _MDSegment {
122 PRUint32 magic; /* for debugging */
123 };
124
125 #undef PROFILE_LOCKS
126
127 struct _MDDir {
128 HANDLE d_hdl;
129 WIN32_FIND_DATAA d_entry;
130 PRBool firstEntry; /* Is this the entry returned
131 * by FindFirstFile()? */
132 PRUint32 magic; /* for debugging */
133 };
134
135 #ifdef MOZ_UNICODE
136 struct _MDDirUTF16 {
137 HANDLE d_hdl;
138 WIN32_FIND_DATAW d_entry;
139 PRBool firstEntry; /* Is this the entry returned
140 * by FindFirstFileW()? */
141 PRUint32 magic; /* for debugging */
142 };
143 #endif /* MOZ_UNICODE */
144
145 struct _MDCVar {
146 PRUint32 magic;
147 struct PRThread *waitHead, *waitTail; /* the wait queue: a doubly-
148 * linked list of threads
149 * waiting on this condition
150 * variable */
151 PRIntn nwait; /* number of threads in the
152 * wait queue */
153 };
154
155 #define _MD_CV_NOTIFIED_LENGTH 6
156 typedef struct _MDNotified _MDNotified;
157 struct _MDNotified {
158 PRIntn length; /* # of used entries in this
159 * structure */
160 struct {
161 struct _MDCVar *cv; /* the condition variable notified */
162 PRIntn times; /* and the number of times notified */
163 struct PRThread *notifyHead; /* list of threads to wake up */
164 } cv[_MD_CV_NOTIFIED_LENGTH];
165 _MDNotified *link; /* link to another of these, or NULL */
166 };
167
168 struct _MDLock {
169 CRITICAL_SECTION mutex; /* this is recursive on NT */
170
171 /*
172 * When notifying cvars, there is no point in actually
173 * waking up the threads waiting on the cvars until we've
174 * released the lock. So, we temporarily record the cvars.
175 * When doing an unlock, we'll then wake up the waiting threads.
176 */
177 struct _MDNotified notified; /* array of conditions notified */
178 #ifdef PROFILE_LOCKS
179 PRInt32 hitcount;
180 PRInt32 misscount;
181 #endif
182 };
183
184 struct _MDSemaphore {
185 HANDLE sem;
186 };
187
188 struct _MDFileDesc {
189 PROsfd osfd; /* The osfd can come from one of three spaces:
190 * - For stdin, stdout, and stderr, we are using
191 * the libc file handle (0, 1, 2), which is an int.
192 * - For files and pipes, we are using Win32 HANDLE,
193 * which is a void*.
194 * - For sockets, we are using Winsock SOCKET, which
195 * is a u_int.
196 */
197 };
198
199 struct _MDProcess {
200 HANDLE handle;
201 DWORD id;
202 };
203
204 /* --- Misc stuff --- */
205 #define _MD_GET_SP(thread) (thread)->md.gcContext[6]
206
207 /* --- NT security stuff --- */
208
209 extern void _PR_NT_InitSids(void);
210 extern void _PR_NT_FreeSids(void);
211 extern PRStatus _PR_NT_MakeSecurityDescriptorACL(
212 PRIntn mode,
213 DWORD accessTable[],
214 PSECURITY_DESCRIPTOR *resultSD,
215 PACL *resultACL
216 );
217 extern void _PR_NT_FreeSecurityDescriptorACL(
218 PSECURITY_DESCRIPTOR pSD, PACL pACL);
219
220 /* --- IO stuff --- */
221
222 #define _MD_OPEN _PR_MD_OPEN
223 #define _MD_OPEN_FILE _PR_MD_OPEN_FILE
224 #define _MD_READ _PR_MD_READ
225 #define _MD_WRITE _PR_MD_WRITE
226 #define _MD_WRITEV _PR_MD_WRITEV
227 #define _MD_LSEEK _PR_MD_LSEEK
228 #define _MD_LSEEK64 _PR_MD_LSEEK64
229 extern PRInt32 _MD_CloseFile(PROsfd osfd);
230 #define _MD_CLOSE_FILE _MD_CloseFile
231 #define _MD_GETFILEINFO _PR_MD_GETFILEINFO
232 #define _MD_GETFILEINFO64 _PR_MD_GETFILEINFO64
233 #define _MD_GETOPENFILEINFO _PR_MD_GETOPENFILEINFO
234 #define _MD_GETOPENFILEINFO64 _PR_MD_GETOPENFILEINFO64
235 #define _MD_STAT _PR_MD_STAT
236 #define _MD_RENAME _PR_MD_RENAME
237 #define _MD_ACCESS _PR_MD_ACCESS
238 #define _MD_DELETE _PR_MD_DELETE
239 #define _MD_MKDIR _PR_MD_MKDIR
240 #define _MD_MAKE_DIR _PR_MD_MAKE_DIR
241 #define _MD_RMDIR _PR_MD_RMDIR
242 #define _MD_LOCKFILE _PR_MD_LOCKFILE
243 #define _MD_TLOCKFILE _PR_MD_TLOCKFILE
244 #define _MD_UNLOCKFILE _PR_MD_UNLOCKFILE
245
246 /* --- UTF16 IO stuff --- */
247 extern PRBool _pr_useUnicode;
248 #ifdef MOZ_UNICODE
249 #define _MD_OPEN_FILE_UTF16 _PR_MD_OPEN_FILE_UTF16
250 #define _MD_OPEN_DIR_UTF16 _PR_MD_OPEN_DIR_UTF16
251 #define _MD_READ_DIR_UTF16 _PR_MD_READ_DIR_UTF16
252 #define _MD_CLOSE_DIR_UTF16 _PR_MD_CLOSE_DIR_UTF16
253 #define _MD_GETFILEINFO64_UTF16 _PR_MD_GETFILEINFO64_UTF16
254 #endif /* MOZ_UNICODE */
255
256 /* --- Socket IO stuff --- */
257 extern void _PR_MD_InitSockets(void);
258 extern void _PR_MD_CleanupSockets(void);
259 #define _MD_EACCES WSAEACCES
260 #define _MD_EADDRINUSE WSAEADDRINUSE
261 #define _MD_EADDRNOTAVAIL WSAEADDRNOTAVAIL
262 #define _MD_EAFNOSUPPORT WSAEAFNOSUPPORT
263 #define _MD_EAGAIN WSAEWOULDBLOCK
264 #define _MD_EALREADY WSAEALREADY
265 #define _MD_EBADF WSAEBADF
266 #define _MD_ECONNREFUSED WSAECONNREFUSED
267 #define _MD_ECONNRESET WSAECONNRESET
268 #define _MD_EFAULT WSAEFAULT
269 #define _MD_EINPROGRESS WSAEINPROGRESS
270 #define _MD_EINTR WSAEINTR
271 #define _MD_EINVAL EINVAL
272 #define _MD_EISCONN WSAEISCONN
273 #define _MD_ENETUNREACH WSAENETUNREACH
274 #define _MD_ENOENT ENOENT
275 #define _MD_ENOTCONN WSAENOTCONN
276 #define _MD_ENOTSOCK WSAENOTSOCK
277 #define _MD_EOPNOTSUPP WSAEOPNOTSUPP
278 #define _MD_EWOULDBLOCK WSAEWOULDBLOCK
279 #define _MD_GET_SOCKET_ERROR() WSAGetLastError()
280 #define _MD_SET_SOCKET_ERROR(_err) WSASetLastError(_err)
281
282 #define _MD_INIT_FILEDESC(fd)
283 extern void _MD_MakeNonblock(PRFileDesc *f);
284 #define _MD_MAKE_NONBLOCK _MD_MakeNonblock
285 #define _MD_INIT_FD_INHERITABLE _PR_MD_INIT_FD_INHERITABLE
286 #define _MD_QUERY_FD_INHERITABLE _PR_MD_QUERY_FD_INHERITABLE
287 #define _MD_SHUTDOWN _PR_MD_SHUTDOWN
288 #define _MD_LISTEN _PR_MD_LISTEN
289 extern PRInt32 _MD_CloseSocket(PROsfd osfd);
290 #define _MD_CLOSE_SOCKET _MD_CloseSocket
291 #define _MD_SENDTO _PR_MD_SENDTO
292 #define _MD_RECVFROM _PR_MD_RECVFROM
293 #define _MD_SOCKETPAIR(s, type, proto, sv) -1
294 #define _MD_GETSOCKNAME _PR_MD_GETSOCKNAME
295 #define _MD_GETPEERNAME _PR_MD_GETPEERNAME
296 #define _MD_GETSOCKOPT _PR_MD_GETSOCKOPT
297 #define _MD_SETSOCKOPT _PR_MD_SETSOCKOPT
298 #define _MD_SET_FD_INHERITABLE _PR_MD_SET_FD_INHERITABLE
299 #define _MD_SELECT select
300 #define _MD_FSYNC _PR_MD_FSYNC
301 #define READ_FD 1
302 #define WRITE_FD 2
303
304 #define _MD_INIT_ATOMIC()
305 #if defined(_M_IX86) || defined(_X86_)
306 #define _MD_ATOMIC_INCREMENT _PR_MD_ATOMIC_INCREMENT
307 #define _MD_ATOMIC_ADD _PR_MD_ATOMIC_ADD
308 #define _MD_ATOMIC_DECREMENT _PR_MD_ATOMIC_DECREMENT
309 #else /* non-x86 processors */
310 #define _MD_ATOMIC_INCREMENT(x) InterlockedIncrement((PLONG)x)
311 #define _MD_ATOMIC_ADD(ptr,val) (InterlockedExchangeAdd((PLONG)ptr, (LONG)val ) + val)
312 #define _MD_ATOMIC_DECREMENT(x) InterlockedDecrement((PLONG)x)
313 #endif /* x86 */
314 #define _MD_ATOMIC_SET(x,y) InterlockedExchange((PLONG)x, (LONG)y)
315
316 #define _MD_INIT_IO _PR_MD_INIT_IO
317
318
319 /* win95 doesn't have async IO */
320 #define _MD_SOCKET _PR_MD_SOCKET
321 extern PRInt32 _MD_SocketAvailable(PRFileDesc *fd);
322 #define _MD_SOCKETAVAILABLE _MD_SocketAvailable
323 #define _MD_PIPEAVAILABLE _PR_MD_PIPEAVAILABLE
324 #define _MD_CONNECT _PR_MD_CONNECT
325 extern PROsfd _MD_Accept(PRFileDesc *fd, PRNetAddr *raddr, PRUint32 *rlen,
326 PRIntervalTime timeout);
327 #define _MD_ACCEPT _MD_Accept
328 #define _MD_BIND _PR_MD_BIND
329 #define _MD_RECV _PR_MD_RECV
330 #define _MD_SEND _PR_MD_SEND
331 #define _MD_PR_POLL _PR_MD_PR_POLL
332
333 /* --- Scheduler stuff --- */
334 // #define _MD_PAUSE_CPU _PR_MD_PAUSE_CPU
335 #define _MD_PAUSE_CPU
336
337 /* --- DIR stuff --- */
338 #define PR_DIRECTORY_SEPARATOR '\\'
339 #define PR_DIRECTORY_SEPARATOR_STR "\\"
340 #define PR_PATH_SEPARATOR ';'
341 #define PR_PATH_SEPARATOR_STR ";"
342 #define _MD_ERRNO() GetLastError()
343 #define _MD_OPEN_DIR _PR_MD_OPEN_DIR
344 #define _MD_CLOSE_DIR _PR_MD_CLOSE_DIR
345 #define _MD_READ_DIR _PR_MD_READ_DIR
346
347 /* --- Segment stuff --- */
348 #define _MD_INIT_SEGS()
349 #define _MD_ALLOC_SEGMENT(seg, size, vaddr) 0
350 #define _MD_FREE_SEGMENT(seg)
351
352 /* --- Environment Stuff --- */
353 #define _MD_GET_ENV _PR_MD_GET_ENV
354 #define _MD_PUT_ENV _PR_MD_PUT_ENV
355
356 /* --- Threading Stuff --- */
357 #define _MD_DEFAULT_STACK_SIZE 0
358 #define _MD_INIT_THREAD _PR_MD_INIT_THREAD
359 #define _MD_INIT_ATTACHED_THREAD _PR_MD_INIT_THREAD
360 #define _MD_CREATE_THREAD _PR_MD_CREATE_THREAD
361 #define _MD_YIELD _PR_MD_YIELD
362 #define _MD_SET_PRIORITY _PR_MD_SET_PRIORITY
363 #define _MD_SET_CURRENT_THREAD_NAME _PR_MD_SET_CURRENT_THREAD_NAME
364 #define _MD_CLEAN_THREAD _PR_MD_CLEAN_THREAD
365 #define _MD_SETTHREADAFFINITYMASK _PR_MD_SETTHREADAFFINITYMASK
366 #define _MD_GETTHREADAFFINITYMASK _PR_MD_GETTHREADAFFINITYMASK
367 #define _MD_EXIT_THREAD _PR_MD_EXIT_THREAD
368 #define _MD_EXIT _PR_MD_EXIT
369 #define _MD_SUSPEND_THREAD _PR_MD_SUSPEND_THREAD
370 #define _MD_RESUME_THREAD _PR_MD_RESUME_THREAD
371 #define _MD_SUSPEND_CPU _PR_MD_SUSPEND_CPU
372 #define _MD_RESUME_CPU _PR_MD_RESUME_CPU
373 #define _MD_BEGIN_SUSPEND_ALL()
374 #define _MD_BEGIN_RESUME_ALL()
375 #define _MD_END_SUSPEND_ALL()
376 #define _MD_END_RESUME_ALL()
377
378 /* --- Lock stuff --- */
379 #define _PR_LOCK _MD_LOCK
380 #define _PR_UNLOCK _MD_UNLOCK
381
382 #define _MD_NEW_LOCK(lock) (InitializeCriticalSection(&((lock)->mutex )),(lock)->notified.length=0,(lock)->notified.link=NULL,PR_SUCCESS)
383 #define _MD_FREE_LOCK(lock) DeleteCriticalSection(&((lock)->mutex))
384 #define _MD_LOCK(lock) EnterCriticalSection(&((lock)->mutex))
385 #define _MD_TEST_AND_LOCK(lock) (EnterCriticalSection(&((lock)->mutex)),0)
386 #define _MD_UNLOCK _PR_MD_UNLOCK
387
388 /* --- lock and cv waiting --- */
389 #define _MD_WAIT _PR_MD_WAIT
390 #define _MD_WAKEUP_WAITER _PR_MD_WAKEUP_WAITER
391
392 /* --- CVar ------------------- */
393 #define _MD_WAIT_CV _PR_MD_WAIT_CV
394 #define _MD_NEW_CV _PR_MD_NEW_CV
395 #define _MD_FREE_CV _PR_MD_FREE_CV
396 #define _MD_NOTIFY_CV _PR_MD_NOTIFY_CV
397 #define _MD_NOTIFYALL_CV _PR_MD_NOTIFYALL_CV
398
399 /* XXXMB- the IOQ stuff is certainly not working correctly yet. */
400 // extern struct _MDLock _pr_ioq_lock;
401 #define _MD_IOQ_LOCK()
402 #define _MD_IOQ_UNLOCK()
403
404
405 /* --- Initialization stuff --- */
406 #define _MD_START_INTERRUPTS()
407 #define _MD_STOP_INTERRUPTS()
408 #define _MD_DISABLE_CLOCK_INTERRUPTS()
409 #define _MD_ENABLE_CLOCK_INTERRUPTS()
410 #define _MD_BLOCK_CLOCK_INTERRUPTS()
411 #define _MD_UNBLOCK_CLOCK_INTERRUPTS()
412 #define _MD_EARLY_INIT _PR_MD_EARLY_INIT
413 #define _MD_FINAL_INIT()
414 #define _MD_EARLY_CLEANUP()
415 #define _MD_INIT_CPUS()
416 #define _MD_INIT_RUNNING_CPU(cpu)
417
418 struct PRProcess;
419 struct PRProcessAttr;
420
421 #define _MD_CREATE_PROCESS _PR_CreateWindowsProcess
422 extern struct PRProcess * _PR_CreateWindowsProcess(
423 const char *path,
424 char *const *argv,
425 char *const *envp,
426 const struct PRProcessAttr *attr
427 );
428
429 #define _MD_DETACH_PROCESS _PR_DetachWindowsProcess
430 extern PRStatus _PR_DetachWindowsProcess(struct PRProcess *process);
431
432 /* --- Wait for a child process to terminate --- */
433 #define _MD_WAIT_PROCESS _PR_WaitWindowsProcess
434 extern PRStatus _PR_WaitWindowsProcess(struct PRProcess *process,
435 PRInt32 *exitCode);
436
437 #define _MD_KILL_PROCESS _PR_KillWindowsProcess
438 extern PRStatus _PR_KillWindowsProcess(struct PRProcess *process);
439
440 #define _MD_CLEANUP_BEFORE_EXIT _PR_MD_CLEANUP_BEFORE_EXIT
441 #define _MD_INIT_CONTEXT(_thread, _sp, _main, status) \
442 PR_BEGIN_MACRO \
443 *status = PR_TRUE; \
444 PR_END_MACRO
445 #define _MD_SWITCH_CONTEXT
446 #define _MD_RESTORE_CONTEXT
447
448 /* --- Intervals --- */
449 #define _MD_INTERVAL_INIT _PR_MD_INTERVAL_INIT
450 #define _MD_GET_INTERVAL _PR_MD_GET_INTERVAL
451 #define _MD_INTERVAL_PER_SEC _PR_MD_INTERVAL_PER_SEC
452 #define _MD_INTERVAL_PER_MILLISEC() (_PR_MD_INTERVAL_PER_SEC() / 1000)
453 #define _MD_INTERVAL_PER_MICROSEC() (_PR_MD_INTERVAL_PER_SEC() / 1000000)
454
455 /* --- Time --- */
456 extern void _PR_FileTimeToPRTime(const FILETIME *filetime, PRTime *prtm);
457
458 #ifdef WINCE
459 extern void _MD_InitTime(void);
460 extern void _MD_CleanupTime(void);
461 #endif
462
463 /* --- Native-Thread Specific Definitions ------------------------------- */
464
465 extern struct PRThread * _MD_CURRENT_THREAD(void);
466
467 #ifdef _PR_USE_STATIC_TLS
468 extern __declspec(thread) struct PRThread *_pr_currentThread;
469 #define _MD_GET_ATTACHED_THREAD() _pr_currentThread
470 #define _MD_SET_CURRENT_THREAD(_thread) (_pr_currentThread = (_thread))
471
472 extern __declspec(thread) struct PRThread *_pr_thread_last_run;
473 #define _MD_LAST_THREAD() _pr_thread_last_run
474 #define _MD_SET_LAST_THREAD(_thread) (_pr_thread_last_run = 0)
475
476 extern __declspec(thread) struct _PRCPU *_pr_currentCPU;
477 #define _MD_CURRENT_CPU() _pr_currentCPU
478 #define _MD_SET_CURRENT_CPU(_cpu) (_pr_currentCPU = 0)
479 #else /* _PR_USE_STATIC_TLS */
480 extern DWORD _pr_currentThreadIndex;
481 #define _MD_GET_ATTACHED_THREAD() ((PRThread *) TlsGetValue(_pr_currentThreadInd ex))
482 #define _MD_SET_CURRENT_THREAD(_thread) TlsSetValue(_pr_currentThreadIndex, (_th read))
483
484 extern DWORD _pr_lastThreadIndex;
485 #define _MD_LAST_THREAD() ((PRThread *) TlsGetValue(_pr_lastThreadIndex))
486 #define _MD_SET_LAST_THREAD(_thread) TlsSetValue(_pr_lastThreadIndex, 0)
487
488 extern DWORD _pr_currentCPUIndex;
489 #define _MD_CURRENT_CPU() ((struct _PRCPU *) TlsGetValue(_pr_currentCPUIndex))
490 #define _MD_SET_CURRENT_CPU(_cpu) TlsSetValue(_pr_currentCPUIndex, 0)
491 #endif /* _PR_USE_STATIC_TLS */
492
493 /* --- Scheduler stuff --- */
494 #define LOCK_SCHEDULER() 0
495 #define UNLOCK_SCHEDULER() 0
496 #define _PR_LockSched() 0
497 #define _PR_UnlockSched() 0
498
499 /* --- Initialization stuff --- */
500 #define _MD_INIT_LOCKS()
501
502 /* --- Stack stuff --- */
503 #define _MD_INIT_STACK(stack, redzone)
504 #define _MD_CLEAR_STACK(stack)
505
506 /* --- Memory-mapped files stuff --- */
507
508 struct _MDFileMap {
509 HANDLE hFileMap;
510 DWORD dwAccess;
511 };
512
513 extern PRStatus _MD_CreateFileMap(struct PRFileMap *fmap, PRInt64 size);
514 #define _MD_CREATE_FILE_MAP _MD_CreateFileMap
515
516 extern PRInt32 _MD_GetMemMapAlignment(void);
517 #define _MD_GET_MEM_MAP_ALIGNMENT _MD_GetMemMapAlignment
518
519 extern void * _MD_MemMap(struct PRFileMap *fmap, PRInt64 offset,
520 PRUint32 len);
521 #define _MD_MEM_MAP _MD_MemMap
522
523 extern PRStatus _MD_MemUnmap(void *addr, PRUint32 size);
524 #define _MD_MEM_UNMAP _MD_MemUnmap
525
526 extern PRStatus _MD_CloseFileMap(struct PRFileMap *fmap);
527 #define _MD_CLOSE_FILE_MAP _MD_CloseFileMap
528
529 /* --- Named semaphores stuff --- */
530 #define _PR_HAVE_NAMED_SEMAPHORES
531 #define _MD_OPEN_SEMAPHORE _PR_MD_OPEN_SEMAPHORE
532 #define _MD_WAIT_SEMAPHORE _PR_MD_WAIT_SEMAPHORE
533 #define _MD_POST_SEMAPHORE _PR_MD_POST_SEMAPHORE
534 #define _MD_CLOSE_SEMAPHORE _PR_MD_CLOSE_SEMAPHORE
535 #define _MD_DELETE_SEMAPHORE(name) PR_SUCCESS /* no op */
536
537 #endif /* nspr_win32_defs_h___ */
OLDNEW
« no previous file with comments | « mozilla/nsprpub/pr/include/md/_win32_errors.h ('k') | mozilla/nsprpub/pr/include/md/_win95.cfg » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698