66
66
ThreadInfo thread[MAX_THREADS];
67
67
int idxThreadInUse; /*index of any used thread*/
69
#if defined(WINDOWS) && defined(VBOX_WITH_WDDM)
70
bool bRunningUnderWDDM;
70
74
ContextInfo context[CR_MAX_CONTEXTS];
73
77
extern PackSPU pack_spu;
79
#define THREAD_OFFSET_MAGIC 2000
75
81
#ifdef CHROMIUM_THREADSAFE
76
82
extern CRmutex _PackMutex;
77
83
extern CRtsd _PackTSD;
78
#define GET_THREAD(T) ThreadInfo *T = crGetTSD(&_PackTSD)
84
#define GET_THREAD_VAL() (crGetTSD(&_PackTSD))
85
#define GET_THREAD_VAL_ID(_id) (&(pack_spu.thread[(_id) - THREAD_OFFSET_MAGIC]))
80
#define GET_THREAD(T) ThreadInfo *T = &(pack_spu.thread[0])
87
#define GET_THREAD_VAL() (&(pack_spu.thread[0]))
89
#define GET_THREAD(T) ThreadInfo *T = GET_THREAD_VAL()
90
#define GET_THREAD_ID(T, _id) ThreadInfo *T = GET_THREAD_VAL_ID(_id)
83
94
#define GET_CONTEXT(C) \
84
95
GET_THREAD(thread); \
85
96
ContextInfo *C = thread->currentContext
98
#define CRPACKSPU_WRITEBACK_WAIT(_thread, _writeback) CR_WRITEBACK_WAIT((_thread)->netServer.conn, _writeback)
99
#if defined(WINDOWS) && defined(VBOX_WITH_WDDM) && defined(VBOX_WITH_CRHGSMI) && defined(IN_GUEST)
100
# define CRPACKSPU_IS_WDDM_CRHGSMI() (pack_spu.bRunningUnderWDDM)
102
# define CRPACKSPU_IS_WDDM_CRHGSMI() (GL_FALSE)
87
105
extern void packspuCreateFunctions( void );
88
106
extern void packspuSetVBoxConfiguration( const SPU *child_spu );
89
extern void packspuConnectToServer( CRNetServer *server );
107
extern void packspuConnectToServer( CRNetServer *server
108
#if defined(VBOX_WITH_CRHGSMI) && defined(IN_GUEST)
109
, struct VBOXUHGSMI *pHgsmi
90
112
extern void packspuFlush( void *arg );
91
113
extern void packspuHuge( CROpcode opcode, void *buf );
93
115
extern GLboolean packspuSyncOnFlushes();
95
extern ThreadInfo *packspuNewThread( unsigned long id );
117
extern ThreadInfo *packspuNewThread(
118
#if defined(VBOX_WITH_CRHGSMI) && defined(IN_GUEST)
119
struct VBOXUHGSMI *pHgsmi
123
extern ThreadInfo *packspuNewCtxThread( struct VBOXUHGSMI *pHgsmi );
98
125
#endif /* CR_PACKSPU_H */