comparison nspr/pr/src/md/unix/linux.c @ 0:1e5118fa0cb1

This is NSS with a Cmake Buildsyste To compile a static NSS library for Windows we've used the Chromium-NSS fork and added a Cmake buildsystem to compile it statically for Windows. See README.chromium for chromium changes and README.trustbridge for our modifications.
author Andre Heinecke <andre.heinecke@intevation.de>
date Mon, 28 Jul 2014 10:47:06 +0200
parents
children
comparison
equal deleted inserted replaced
-1:000000000000 0:1e5118fa0cb1
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 #include "primpl.h"
7
8 void _MD_EarlyInit(void)
9 {
10 }
11
12 PRWord *_MD_HomeGCRegisters(PRThread *t, int isCurrent, int *np)
13 {
14 #ifndef _PR_PTHREADS
15 if (isCurrent) {
16 (void) setjmp(CONTEXT(t));
17 }
18 *np = sizeof(CONTEXT(t)) / sizeof(PRWord);
19 return (PRWord *) CONTEXT(t);
20 #else
21 *np = 0;
22 return NULL;
23 #endif
24 }
25
26 #ifdef _PR_PTHREADS
27
28 extern void _MD_unix_terminate_waitpid_daemon(void);
29
30 void _MD_CleanupBeforeExit(void)
31 {
32 _MD_unix_terminate_waitpid_daemon();
33 }
34
35 #else /* ! _PR_PTHREADS */
36
37 void
38 _MD_SET_PRIORITY(_MDThread *thread, PRUintn newPri)
39 {
40 return;
41 }
42
43 PRStatus
44 _MD_InitializeThread(PRThread *thread)
45 {
46 /*
47 * set the pointers to the stack-pointer and frame-pointer words in the
48 * context structure; this is for debugging use.
49 */
50 thread->md.sp = _MD_GET_SP_PTR(thread);
51 thread->md.fp = _MD_GET_FP_PTR(thread);
52 return PR_SUCCESS;
53 }
54
55 PRStatus
56 _MD_WAIT(PRThread *thread, PRIntervalTime ticks)
57 {
58 PR_ASSERT(!(thread->flags & _PR_GLOBAL_SCOPE));
59 _PR_MD_SWITCH_CONTEXT(thread);
60 return PR_SUCCESS;
61 }
62
63 PRStatus
64 _MD_WAKEUP_WAITER(PRThread *thread)
65 {
66 if (thread) {
67 PR_ASSERT(!(thread->flags & _PR_GLOBAL_SCOPE));
68 }
69 return PR_SUCCESS;
70 }
71
72 /* These functions should not be called for Linux */
73 void
74 _MD_YIELD(void)
75 {
76 PR_NOT_REACHED("_MD_YIELD should not be called for Linux.");
77 }
78
79 PRStatus
80 _MD_CREATE_THREAD(
81 PRThread *thread,
82 void (*start) (void *),
83 PRThreadPriority priority,
84 PRThreadScope scope,
85 PRThreadState state,
86 PRUint32 stackSize)
87 {
88 PR_NOT_REACHED("_MD_CREATE_THREAD should not be called for Linux.");
89 return PR_FAILURE;
90 }
91 #endif /* ! _PR_PTHREADS */
This site is hosted by Intevation GmbH (Datenschutzerklärung und Impressum | Privacy Policy and Imprint)