Stash handles rather than native pointers in Ke* objects.

This commit is contained in:
Dr. Chat
2015-12-01 17:15:50 -06:00
committed by Ben Vanik
parent 4301641bdf
commit 52ec24ea6a
2 changed files with 14 additions and 15 deletions

View File

@@ -202,11 +202,9 @@ class XObject {
}
// Stash native pointer into X_DISPATCH_HEADER
static void StashNative(X_DISPATCH_HEADER* header, void* native_ptr) {
uint64_t object_ptr = reinterpret_cast<uint64_t>(native_ptr);
object_ptr |= 0x1;
header->wait_list_flink = (uint32_t)(object_ptr >> 32);
header->wait_list_blink = (uint32_t)(object_ptr & 0xFFFFFFFF);
static void StashHandle(X_DISPATCH_HEADER* header, uint32_t handle) {
header->wait_list_flink = 'XEN\0';
header->wait_list_blink = handle;
}
static uint32_t TimeoutTicksToMs(int64_t timeout_ticks);