home *** CD-ROM | disk | FTP | other *** search
/ Tools / WinSN5.0Ver.iso / NETSCAP.50 / WIN1998.ZIP / ns / nsprpub / pr / src / md / unix / sony.c < prev    next >
Encoding:
C/C++ Source or Header  |  1998-04-08  |  2.1 KB  |  91 lines

  1. /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
  2. /*
  3.  * The contents of this file are subject to the Netscape Public License
  4.  * Version 1.0 (the "NPL"); you may not use this file except in
  5.  * compliance with the NPL.  You may obtain a copy of the NPL at
  6.  * http://www.mozilla.org/NPL/
  7.  * 
  8.  * Software distributed under the NPL is distributed on an "AS IS" basis,
  9.  * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
  10.  * for the specific language governing rights and limitations under the
  11.  * NPL.
  12.  * 
  13.  * The Initial Developer of this code under the NPL is Netscape
  14.  * Communications Corporation.  Portions created by Netscape are
  15.  * Copyright (C) 1998 Netscape Communications Corporation.  All Rights
  16.  * Reserved.
  17.  */
  18.  
  19. #include "primpl.h"
  20.  
  21. #include <signal.h>
  22.  
  23. void _MD_EarlyInit(void)
  24. {
  25. }
  26.  
  27. PRWord *_MD_HomeGCRegisters(PRThread *t, int isCurrent, int *np)
  28. {
  29. #ifndef _PR_PTHREADS
  30.     if (isCurrent) {
  31.     (void) setjmp(CONTEXT(t), 1);
  32.     }
  33.     *np = sizeof(CONTEXT(t)) / sizeof(PRWord);
  34.     return (PRWord *) CONTEXT(t);
  35. #else
  36.     *np = 0;
  37.     return NULL;
  38. #endif
  39. }
  40.  
  41. #ifndef _PR_PTHREADS
  42. void
  43. _MD_SET_PRIORITY(_MDThread *thread, PRUintn newPri)
  44. {
  45.     return;
  46. }
  47.  
  48. PRStatus
  49. _MD_InitializeThread(PRThread *thread)
  50. {
  51.     return PR_SUCCESS;
  52. }
  53.  
  54. PRStatus
  55. _MD_WAIT(PRThread *thread, PRIntervalTime ticks)
  56. {
  57.     PR_ASSERT(!(thread->flags & _PR_GLOBAL_SCOPE));
  58.     _PR_MD_SWITCH_CONTEXT(thread);
  59.     return PR_SUCCESS;
  60. }
  61.  
  62. PRStatus
  63. _MD_WAKEUP_WAITER(PRThread *thread)
  64. {
  65.     if (thread) {
  66.     PR_ASSERT(!(thread->flags & _PR_GLOBAL_SCOPE));
  67.     }
  68.     return PR_SUCCESS;
  69. }
  70.  
  71. /* These functions should not be called for Sony */
  72. void
  73. _MD_YIELD(void)
  74. {
  75.     PR_NOT_REACHED("_MD_YIELD should not be called for SONY.");
  76. }
  77.  
  78. PRStatus
  79. _MD_CREATE_THREAD(
  80.     PRThread *thread,
  81.     void (*start) (void *),
  82.     PRThreadPriority priority,
  83.     PRThreadScope scope,
  84.     PRThreadState state,
  85.     PRUint32 stackSize)
  86. {
  87.     PR_NOT_REACHED("_MD_CREATE_THREAD should not be called for SONY.");
  88.     return PR_FAILURE;
  89. }
  90. #endif /* ! _PR_PTHREADS */
  91.