1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/nsprpub/pr/src/md/unix/dgux.c Wed Dec 31 06:09:35 2014 +0100 1.3 @@ -0,0 +1,77 @@ 1.4 +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ 1.5 +/* This Source Code Form is subject to the terms of the Mozilla Public 1.6 + * License, v. 2.0. If a copy of the MPL was not distributed with this 1.7 + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ 1.8 + 1.9 +#include "primpl.h" 1.10 + 1.11 +/* 1.12 + * using only NSPR threads here 1.13 + * 1.14 + * Copied from the UnixWare implementation. Should be kept in sync 1.15 + * with ../../../include/md/_dgux.h. 1.16 + */ 1.17 + 1.18 +#include <setjmp.h> 1.19 + 1.20 +void _MD_EarlyInit(void) 1.21 +{ 1.22 +} 1.23 + 1.24 +PRWord *_MD_HomeGCRegisters(PRThread *t, int isCurrent, int *np) 1.25 +{ 1.26 + if (isCurrent) { 1.27 + (void) setjmp(CONTEXT(t)); 1.28 + } 1.29 + *np = sizeof(CONTEXT(t)) / sizeof(PRWord); 1.30 + return (PRWord *) CONTEXT(t); 1.31 +} 1.32 + 1.33 +void 1.34 +_MD_SET_PRIORITY(_MDThread *thread, PRUintn newPri) 1.35 +{ 1.36 + return; 1.37 +} 1.38 + 1.39 +PRStatus 1.40 +_MD_InitializeThread(PRThread *thread) 1.41 +{ 1.42 + return PR_SUCCESS; 1.43 +} 1.44 + 1.45 +PRStatus 1.46 +_MD_WAIT(PRThread *thread, PRIntervalTime ticks) 1.47 +{ 1.48 + PR_ASSERT(!(thread->flags & _PR_GLOBAL_SCOPE)); 1.49 + _PR_MD_SWITCH_CONTEXT(thread); 1.50 + return PR_SUCCESS; 1.51 +} 1.52 + 1.53 +PRStatus 1.54 +_MD_WAKEUP_WAITER(PRThread *thread) 1.55 +{ 1.56 + if (thread) { 1.57 + PR_ASSERT(!(thread->flags & _PR_GLOBAL_SCOPE)); 1.58 + } 1.59 + return PR_SUCCESS; 1.60 +} 1.61 + 1.62 +/* These functions should not be called for DG/UX */ 1.63 +void 1.64 +_MD_YIELD(void) 1.65 +{ 1.66 + PR_NOT_REACHED("_MD_YIELD should not be called for DG/UX."); 1.67 +} 1.68 + 1.69 +PRStatus 1.70 +_MD_CREATE_THREAD( 1.71 + PRThread *thread, 1.72 + void (*start) (void *), 1.73 + PRThreadPriority priority, 1.74 + PRThreadScope scope, 1.75 + PRThreadState state, 1.76 + PRUint32 stackSize) 1.77 +{ 1.78 + PR_NOT_REACHED("_MD_CREATE_THREAD should not be called for DG/UX."); 1.79 +} 1.80 +