mirror of
https://github.com/shadps4-emu/shadPS4.git
synced 2025-06-06 10:43:16 +00:00
core: Fix some missing uses of ExecuteGuest. (#1214)
This commit is contained in:
parent
388d717205
commit
1a34c2a189
6 changed files with 30 additions and 19 deletions
|
@ -109,16 +109,23 @@ public:
|
|||
void DebugDump();
|
||||
|
||||
template <class ReturnType, class... FuncArgs, class... CallArgs>
|
||||
ReturnType ExecuteGuest(PS4_SYSV_ABI ReturnType (*func)(FuncArgs...), CallArgs&&... args) {
|
||||
ReturnType ExecuteGuest(PS4_SYSV_ABI ReturnType (*func)(FuncArgs...),
|
||||
CallArgs&&... args) const {
|
||||
// Make sure TLS is initialized for the thread before entering guest.
|
||||
EnsureThreadInitialized();
|
||||
return func(std::forward<CallArgs>(args)...);
|
||||
return ExecuteGuestWithoutTls(func, args...);
|
||||
}
|
||||
|
||||
private:
|
||||
const Module* FindExportedModule(const ModuleInfo& m, const LibraryInfo& l);
|
||||
void EnsureThreadInitialized(bool is_primary = false);
|
||||
void InitTlsForThread(bool is_primary);
|
||||
void EnsureThreadInitialized(bool is_primary = false) const;
|
||||
void InitTlsForThread(bool is_primary) const;
|
||||
|
||||
template <class ReturnType, class... FuncArgs, class... CallArgs>
|
||||
ReturnType ExecuteGuestWithoutTls(PS4_SYSV_ABI ReturnType (*func)(FuncArgs...),
|
||||
CallArgs&&... args) const {
|
||||
return func(std::forward<CallArgs>(args)...);
|
||||
}
|
||||
|
||||
MemoryManager* memory;
|
||||
std::mutex mutex;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue