Logging APC delivery.

This commit is contained in:
Ben Vanik 2015-06-03 17:59:25 -07:00
parent 1e0c8e223d
commit 36dc6dd864
1 changed files with 5 additions and 1 deletions

View File

@ -510,6 +510,8 @@ void XThread::DeliverAPCs(void* data) {
auto apc = reinterpret_cast<XAPC*>(memory->TranslateVirtual(apc_ptr));
bool needs_freeing = apc->kernel_routine == XAPC::kDummyKernelRoutine;
XELOGD("Delivering APC to %.8X", uint32_t(apc->normal_routine));
// Mark as uninserted so that it can be reinserted again by the routine.
apc->enqueued = 0;
@ -542,12 +544,14 @@ void XThread::DeliverAPCs(void* data) {
if (normal_routine) {
thread->UnlockApc(false);
// normal_routine(normal_context, system_arg1, system_arg2)
uint64_t normal_args[] = {normal_context, apc->arg1, apc->arg2};
uint64_t normal_args[] = {normal_context, arg1, arg2};
processor->Execute(thread->thread_state(), normal_routine, normal_args,
xe::countof(normal_args));
thread->LockApc();
}
XELOGD("Completed delivery of APC to %.8X", uint32_t(apc->normal_routine));
// If special, free it.
if (needs_freeing) {
memory->SystemHeapFree(apc_ptr);