Clean up unused dpc event member variable

This commit is contained in:
ergo720 2023-03-01 22:43:42 +01:00
parent 827a3212f8
commit 58041c95b4
3 changed files with 7 additions and 17 deletions

View File

@ -96,11 +96,10 @@ namespace NtDll
// TODO : Move towards thread-simulation based Dpc emulation // TODO : Move towards thread-simulation based Dpc emulation
typedef struct _DpcData { typedef struct _DpcData {
CRITICAL_SECTION Lock; CRITICAL_SECTION Lock;
HANDLE DpcEvent;
xbox::LIST_ENTRY DpcQueue; // TODO : Use KeGetCurrentPrcb()->DpcListHead instead xbox::LIST_ENTRY DpcQueue; // TODO : Use KeGetCurrentPrcb()->DpcListHead instead
} DpcData; } DpcData;
DpcData g_DpcData = { 0 }; // Note : g_DpcData is initialized in InitDpcThread() DpcData g_DpcData = { 0 }; // Note : g_DpcData is initialized in InitDpcData()
xbox::ulonglong_xt LARGE_INTEGER2ULONGLONG(xbox::LARGE_INTEGER value) xbox::ulonglong_xt LARGE_INTEGER2ULONGLONG(xbox::LARGE_INTEGER value)
{ {
@ -479,14 +478,12 @@ void ExecuteDpcQueue()
LeaveCriticalSection(&(g_DpcData.Lock)); LeaveCriticalSection(&(g_DpcData.Lock));
} }
void InitDpcThread() void InitDpcData()
{ {
DWORD dwThreadId = 0; // Let's initialize the Dpc handling thread too,
// here for now (should be called by our caller)
InitializeCriticalSection(&(g_DpcData.Lock)); InitializeCriticalSection(&(g_DpcData.Lock));
InitializeListHead(&(g_DpcData.DpcQueue)); InitializeListHead(&(g_DpcData.DpcQueue));
EmuLogEx(CXBXR_MODULE::INIT, LOG_LEVEL::DEBUG, "Creating DPC event\n");
g_DpcData.DpcEvent = CreateEvent(/*lpEventAttributes=*/nullptr, /*bManualReset=*/FALSE, /*bInitialState=*/FALSE, /*lpName=*/nullptr);
} }
static constexpr uint32_t XBOX_TSC_FREQUENCY = 733333333; // Xbox Time Stamp Counter Frequency = 733333333 (CPU Clock) static constexpr uint32_t XBOX_TSC_FREQUENCY = 733333333; // Xbox Time Stamp Counter Frequency = 733333333 (CPU Clock)
@ -498,13 +495,6 @@ ULONGLONG CxbxGetPerformanceCounter(bool acpi)
return Timer_GetScaledPerformanceCounter(period); return Timer_GetScaledPerformanceCounter(period);
} }
void CxbxInitPerformanceCounters()
{
// Let's initialize the Dpc handling thread too,
// here for now (should be called by our caller)
InitDpcThread();
}
// ****************************************************************** // ******************************************************************
// * 0x005C - KeAlertResumeThread() // * 0x005C - KeAlertResumeThread()
// ****************************************************************** // ******************************************************************

View File

@ -1205,8 +1205,8 @@ static void CxbxrKrnlInitHacks()
Timer_Init(); Timer_Init();
// for unicode conversions // for unicode conversions
setlocale(LC_ALL, "English"); setlocale(LC_ALL, "English");
// Initialize time-related variables for the kernel and the timers // Initialize DPC global
CxbxInitPerformanceCounters(); InitDpcData();
#ifdef _DEBUG #ifdef _DEBUG
// PopupCustom(LOG_LEVEL::INFO, "Attach a Debugger"); // PopupCustom(LOG_LEVEL::INFO, "Attach a Debugger");
// Debug child processes using https://marketplace.visualstudio.com/items?itemName=GreggMiskelly.MicrosoftChildProcessDebuggingPowerTool // Debug child processes using https://marketplace.visualstudio.com/items?itemName=GreggMiskelly.MicrosoftChildProcessDebuggingPowerTool

View File

@ -155,7 +155,7 @@ void CxbxKrnlPanic();
/*! empty function */ /*! empty function */
void CxbxKrnlNoFunc(); void CxbxKrnlNoFunc();
void CxbxInitPerformanceCounters(); // Implemented in EmuKrnlKe.cpp void InitDpcData(); // Implemented in EmuKrnlKe.cpp
/*! kernel thunk table */ /*! kernel thunk table */
extern uint32_t CxbxKrnl_KernelThunkTable[379]; extern uint32_t CxbxKrnl_KernelThunkTable[379];