nsprpub/pr/src/md/unix/riscos.c

Wed, 31 Dec 2014 06:09:35 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Wed, 31 Dec 2014 06:09:35 +0100
changeset 0
6474c204b198
permissions
-rw-r--r--

Cloned upstream origin tor-browser at tor-browser-31.3.0esr-4.5-1-build1
revision ID fc1c9ff7c1b2defdbc039f12214767608f46423f for hacking purpose.

michael@0 1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
michael@0 2 /* This Source Code Form is subject to the terms of the Mozilla Public
michael@0 3 * License, v. 2.0. If a copy of the MPL was not distributed with this
michael@0 4 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
michael@0 5
michael@0 6 #include "primpl.h"
michael@0 7
michael@0 8 void _MD_EarlyInit(void)
michael@0 9 {
michael@0 10 }
michael@0 11
michael@0 12 PRWord *_MD_HomeGCRegisters(PRThread *t, int isCurrent, int *np)
michael@0 13 {
michael@0 14 #ifndef _PR_PTHREADS
michael@0 15 if (isCurrent) {
michael@0 16 (void) setjmp(CONTEXT(t));
michael@0 17 }
michael@0 18 *np = sizeof(CONTEXT(t)) / sizeof(PRWord);
michael@0 19 return (PRWord *) CONTEXT(t);
michael@0 20 #else
michael@0 21 *np = 0;
michael@0 22 return NULL;
michael@0 23 #endif
michael@0 24 }
michael@0 25
michael@0 26 #ifdef _PR_PTHREADS
michael@0 27
michael@0 28 void _MD_CleanupBeforeExit(void)
michael@0 29 {
michael@0 30 }
michael@0 31
michael@0 32 #else /* ! _PR_PTHREADS */
michael@0 33
michael@0 34 void
michael@0 35 _MD_SET_PRIORITY(_MDThread *thread, PRUintn newPri)
michael@0 36 {
michael@0 37 return;
michael@0 38 }
michael@0 39
michael@0 40 PRStatus
michael@0 41 _MD_InitializeThread(PRThread *thread)
michael@0 42 {
michael@0 43 /*
michael@0 44 * set the pointers to the stack-pointer and frame-pointer words in the
michael@0 45 * context structure; this is for debugging use.
michael@0 46 */
michael@0 47 thread->md.sp = _MD_GET_SP_PTR(thread);
michael@0 48 thread->md.fp = _MD_GET_FP_PTR(thread);
michael@0 49 return PR_SUCCESS;
michael@0 50 }
michael@0 51
michael@0 52 PRStatus
michael@0 53 _MD_WAIT(PRThread *thread, PRIntervalTime ticks)
michael@0 54 {
michael@0 55 PR_ASSERT(!(thread->flags & _PR_GLOBAL_SCOPE));
michael@0 56 _PR_MD_SWITCH_CONTEXT(thread);
michael@0 57 return PR_SUCCESS;
michael@0 58 }
michael@0 59
michael@0 60 PRStatus
michael@0 61 _MD_WAKEUP_WAITER(PRThread *thread)
michael@0 62 {
michael@0 63 if (thread) {
michael@0 64 PR_ASSERT(!(thread->flags & _PR_GLOBAL_SCOPE));
michael@0 65 }
michael@0 66 return PR_SUCCESS;
michael@0 67 }
michael@0 68
michael@0 69 /* These functions should not be called for RISC OS */
michael@0 70 void
michael@0 71 _MD_YIELD(void)
michael@0 72 {
michael@0 73 PR_NOT_REACHED("_MD_YIELD should not be called for RISC OS.");
michael@0 74 }
michael@0 75
michael@0 76 PRStatus
michael@0 77 _MD_CREATE_THREAD(
michael@0 78 PRThread *thread,
michael@0 79 void (*start) (void *),
michael@0 80 PRThreadPriority priority,
michael@0 81 PRThreadScope scope,
michael@0 82 PRThreadState state,
michael@0 83 PRUint32 stackSize)
michael@0 84 {
michael@0 85 PR_NOT_REACHED("_MD_CREATE_THREAD should not be called for RISC OS.");
michael@0 86 return PR_FAILURE;
michael@0 87 }
michael@0 88 #endif /* ! _PR_PTHREADS */

mercurial