qnx.c (1440B)
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 #include <setjmp.h> 9 10 void _MD_EarlyInit(void) {} 11 12 PRWord* _MD_HomeGCRegisters(PRThread* t, int isCurrent, int* np) { 13 if (isCurrent) { 14 (void)setjmp(CONTEXT(t)); 15 } 16 *np = sizeof(CONTEXT(t)) / sizeof(PRWord); 17 return (PRWord*)CONTEXT(t); 18 } 19 20 void _MD_SET_PRIORITY(_MDThread* thread, PRUintn newPri) { return; } 21 22 PRStatus _MD_InitializeThread(PRThread* thread) { return PR_SUCCESS; } 23 24 PRStatus _MD_WAIT(PRThread* thread, PRIntervalTime ticks) { 25 PR_ASSERT(!(thread->flags & _PR_GLOBAL_SCOPE)); 26 _PR_MD_SWITCH_CONTEXT(thread); 27 return PR_SUCCESS; 28 } 29 30 PRStatus _MD_WAKEUP_WAITER(PRThread* thread) { 31 if (thread) { 32 PR_ASSERT(!(thread->flags & _PR_GLOBAL_SCOPE)); 33 } 34 return PR_SUCCESS; 35 } 36 37 /* These functions should not be called for qnx */ 38 void _MD_YIELD(void) { 39 PR_NOT_REACHED("_MD_YIELD should not be called for qnx."); 40 } 41 42 PRStatus _MD_CREATE_THREAD(PRThread* thread, void (*start)(void*), 43 PRUintn priority, PRThreadScope scope, 44 PRThreadState state, PRUint32 stackSize) { 45 PR_NOT_REACHED("_MD_CREATE_THREAD should not be called for qnx."); 46 return PR_FAILURE; 47 }