|
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 #ifndef _PR_PTHREADS |
|
27 void |
|
28 _MD_SET_PRIORITY(_MDThread *thread, PRUintn newPri) |
|
29 { |
|
30 return; |
|
31 } |
|
32 |
|
33 PRStatus |
|
34 _MD_InitializeThread(PRThread *thread) |
|
35 { |
|
36 return PR_SUCCESS; |
|
37 } |
|
38 |
|
39 PRStatus |
|
40 _MD_WAIT(PRThread *thread, PRIntervalTime ticks) |
|
41 { |
|
42 PR_ASSERT(!(thread->flags & _PR_GLOBAL_SCOPE)); |
|
43 _PR_MD_SWITCH_CONTEXT(thread); |
|
44 return PR_SUCCESS; |
|
45 } |
|
46 |
|
47 PRStatus |
|
48 _MD_WAKEUP_WAITER(PRThread *thread) |
|
49 { |
|
50 if (thread) { |
|
51 PR_ASSERT(!(thread->flags & _PR_GLOBAL_SCOPE)); |
|
52 } |
|
53 return PR_SUCCESS; |
|
54 } |
|
55 |
|
56 /* These functions should not be called for OSF1 */ |
|
57 void |
|
58 _MD_YIELD(void) |
|
59 { |
|
60 PR_NOT_REACHED("_MD_YIELD should not be called for OSF1."); |
|
61 } |
|
62 |
|
63 PRStatus |
|
64 _MD_CREATE_THREAD( |
|
65 PRThread *thread, |
|
66 void (*start) (void *), |
|
67 PRThreadPriority priority, |
|
68 PRThreadScope scope, |
|
69 PRThreadState state, |
|
70 PRUint32 stackSize) |
|
71 { |
|
72 PR_NOT_REACHED("_MD_CREATE_THREAD should not be called for OSF1."); |
|
73 return PR_FAILURE; |
|
74 } |
|
75 #endif /* ! _PR_PTHREADS */ |