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