andre@0: /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ andre@0: /* This Source Code Form is subject to the terms of the Mozilla Public andre@0: * License, v. 2.0. If a copy of the MPL was not distributed with this andre@0: * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ andre@0: andre@0: #include "primpl.h" andre@0: andre@0: void _MD_EarlyInit(void) andre@0: { andre@0: } andre@0: andre@0: PRWord *_MD_HomeGCRegisters(PRThread *t, int isCurrent, int *np) andre@0: { andre@0: #ifndef _PR_PTHREADS andre@0: if (isCurrent) { andre@0: (void) setjmp(CONTEXT(t)); andre@0: } andre@0: *np = sizeof(CONTEXT(t)) / sizeof(PRWord); andre@0: return (PRWord *) CONTEXT(t); andre@0: #else andre@0: *np = 0; andre@0: return NULL; andre@0: #endif andre@0: } andre@0: andre@0: #ifdef _PR_PTHREADS andre@0: andre@0: extern void _MD_unix_terminate_waitpid_daemon(void); andre@0: andre@0: void _MD_CleanupBeforeExit(void) andre@0: { andre@0: _MD_unix_terminate_waitpid_daemon(); andre@0: } andre@0: andre@0: #else /* ! _PR_PTHREADS */ andre@0: andre@0: void andre@0: _MD_SET_PRIORITY(_MDThread *thread, PRUintn newPri) andre@0: { andre@0: return; andre@0: } andre@0: andre@0: PRStatus andre@0: _MD_InitializeThread(PRThread *thread) andre@0: { andre@0: /* andre@0: * set the pointers to the stack-pointer and frame-pointer words in the andre@0: * context structure; this is for debugging use. andre@0: */ andre@0: thread->md.sp = _MD_GET_SP_PTR(thread); andre@0: thread->md.fp = _MD_GET_FP_PTR(thread); andre@0: return PR_SUCCESS; andre@0: } andre@0: andre@0: PRStatus andre@0: _MD_WAIT(PRThread *thread, PRIntervalTime ticks) andre@0: { andre@0: PR_ASSERT(!(thread->flags & _PR_GLOBAL_SCOPE)); andre@0: _PR_MD_SWITCH_CONTEXT(thread); andre@0: return PR_SUCCESS; andre@0: } andre@0: andre@0: PRStatus andre@0: _MD_WAKEUP_WAITER(PRThread *thread) andre@0: { andre@0: if (thread) { andre@0: PR_ASSERT(!(thread->flags & _PR_GLOBAL_SCOPE)); andre@0: } andre@0: return PR_SUCCESS; andre@0: } andre@0: andre@0: /* These functions should not be called for Linux */ andre@0: void andre@0: _MD_YIELD(void) andre@0: { andre@0: PR_NOT_REACHED("_MD_YIELD should not be called for Linux."); andre@0: } andre@0: andre@0: PRStatus andre@0: _MD_CREATE_THREAD( andre@0: PRThread *thread, andre@0: void (*start) (void *), andre@0: PRThreadPriority priority, andre@0: PRThreadScope scope, andre@0: PRThreadState state, andre@0: PRUint32 stackSize) andre@0: { andre@0: PR_NOT_REACHED("_MD_CREATE_THREAD should not be called for Linux."); andre@0: return PR_FAILURE; andre@0: } andre@0: #endif /* ! _PR_PTHREADS */