Counter Strike : Global Offensive Source Code
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

75 lines
2.0 KiB

  1. //====== Copyright 1996-2010, Valve Corporation, All rights reserved. =======//
  2. //
  3. // Purpose:
  4. //
  5. // $NoKeywords: $
  6. //
  7. //=============================================================================//
  8. #ifndef TLS_PS3_H
  9. #define TLS_PS3_H
  10. #ifdef _WIN32
  11. #pragma once
  12. #endif
  13. #if defined(_PS3) || defined (SN_TARGET_PS3)
  14. #define MAX_TLS_VALUES 32 //I just checked in ep2 and we were only using 14 so have reduced to a max of 32 - RP
  15. struct TLSGlobals
  16. {
  17. // TLS values/flags
  18. int nThreadLocalStateIndex;
  19. void *TLSValues[ MAX_TLS_VALUES ];
  20. bool TLSFlags[ MAX_TLS_VALUES ];
  21. bool bWaitObjectsCreated;
  22. sys_semaphore_t WaitObjectsSemaphore;
  23. void* pCurThread;
  24. int nThreadID;
  25. // Engine TLS data (zip/console/splitslot)
  26. unsigned int uiEngineZipLastErrorZ;
  27. bool bEngineConsoleIsInSpew;
  28. void* pEngineSplitSlot;
  29. // Malloc debugging TLS data
  30. void* pMallocDbgInfoStack;
  31. int nMallocDbgInfoStackDepth;
  32. // Filesystem read filename buffer
  33. char* pFileSystemReadFilename;
  34. // Material system render context
  35. void* pMaterialSystemRenderContext;
  36. // Physics virtual mesh frame locks
  37. void* pPhysicsVirtualMeshFrameLocks;
  38. // [MAIN] this will get set to true if the game quit normally; otherwise, an error screen will be displayed to account for "dirty disk" situations
  39. bool bNormalQuitRequested;
  40. };
  41. #ifndef _CERT
  42. extern "C" TLSGlobals *GetTLSGlobals();
  43. #else
  44. #define GetTLSGlobals() reinterpret_cast< TLSGlobals * >( (unsigned int)__reg(13) - 0x7000 )
  45. #endif
  46. #define g_nThreadLocalStateIndex GetTLSGlobals()->nThreadLocalStateIndex
  47. #define gTLSValues GetTLSGlobals()->TLSValues
  48. #define gTLSFlags GetTLSGlobals()->TLSFlags
  49. #define gbWaitObjectsCreated GetTLSGlobals()->bWaitObjectsCreated
  50. #define gWaitObjectsSemaphore GetTLSGlobals()->WaitObjectsSemaphore
  51. #define g_pCurThread GetTLSGlobals()->pCurThread
  52. #define g_nThreadID GetTLSGlobals()->nThreadID
  53. // stuffed here just to save having a tiny h file
  54. class CPs3ContentPathInfo;
  55. extern CPs3ContentPathInfo *g_pPS3PathInfo;
  56. #endif // defined(_PS3) || defined (SN_TARGET_PS3)
  57. #endif // TLS_PS3_H