VMBUS_CHANNEL_OPEN_CHANNEL* openMsg;
VMBUS_CHANNEL_MSGINFO* openInfo;
void *in, *out;
+ unsigned long flags;
DPRINT_ENTER(VMBUS);
memcpy(openMsg->UserData, UserData, UserDataLen);
}
- SpinlockAcquire(gVmbusConnection.ChannelMsgLock);
+ spin_lock_irqsave(&gVmbusConnection.channelmsg_lock, flags);
INSERT_TAIL_LIST(&gVmbusConnection.ChannelMsgList, &openInfo->MsgListEntry);
- SpinlockRelease(gVmbusConnection.ChannelMsgLock);
+ spin_unlock_irqrestore(&gVmbusConnection.channelmsg_lock, flags);
DPRINT_DBG(VMBUS, "Sending channel open msg...");
}
Cleanup:
- SpinlockAcquire(gVmbusConnection.ChannelMsgLock);
+ spin_lock_irqsave(&gVmbusConnection.channelmsg_lock, flags);
REMOVE_ENTRY_LIST(&openInfo->MsgListEntry);
- SpinlockRelease(gVmbusConnection.ChannelMsgLock);
+ spin_unlock_irqrestore(&gVmbusConnection.channelmsg_lock, flags);
WaitEventClose(openInfo->WaitEvent);
kfree(openInfo);
LIST_ENTRY* anchor;
LIST_ENTRY* curr;
u32 nextGpadlHandle;
+ unsigned long flags;
DPRINT_ENTER(VMBUS);
DumpGpadlHeader(gpadlMsg);
- SpinlockAcquire(gVmbusConnection.ChannelMsgLock);
+ spin_lock_irqsave(&gVmbusConnection.channelmsg_lock, flags);
INSERT_TAIL_LIST(&gVmbusConnection.ChannelMsgList, &msgInfo->MsgListEntry);
- SpinlockRelease(gVmbusConnection.ChannelMsgLock);
+ spin_unlock_irqrestore(&gVmbusConnection.channelmsg_lock, flags);
DPRINT_DBG(VMBUS, "buffer %p, size %d msg cnt %d", Kbuffer, Size, msgCount);
*GpadlHandle = gpadlMsg->Gpadl;
Cleanup:
- SpinlockAcquire(gVmbusConnection.ChannelMsgLock);
+ spin_lock_irqsave(&gVmbusConnection.channelmsg_lock, flags);
REMOVE_ENTRY_LIST(&msgInfo->MsgListEntry);
- SpinlockRelease(gVmbusConnection.ChannelMsgLock);
+ spin_unlock_irqrestore(&gVmbusConnection.channelmsg_lock, flags);
WaitEventClose(msgInfo->WaitEvent);
kfree(msgInfo);
int ret=0;
VMBUS_CHANNEL_GPADL_TEARDOWN *msg;
VMBUS_CHANNEL_MSGINFO* info;
+ unsigned long flags;
DPRINT_ENTER(VMBUS);
msg->ChildRelId = Channel->OfferMsg.ChildRelId;
msg->Gpadl = GpadlHandle;
- SpinlockAcquire(gVmbusConnection.ChannelMsgLock);
+ spin_lock_irqsave(&gVmbusConnection.channelmsg_lock, flags);
INSERT_TAIL_LIST(&gVmbusConnection.ChannelMsgList, &info->MsgListEntry);
- SpinlockRelease(gVmbusConnection.ChannelMsgLock);
+ spin_unlock_irqrestore(&gVmbusConnection.channelmsg_lock, flags);
ret = VmbusPostMessage(msg, sizeof(VMBUS_CHANNEL_GPADL_TEARDOWN));
if (ret != 0)
WaitEventWait(info->WaitEvent);
// Received a torndown response
- SpinlockAcquire(gVmbusConnection.ChannelMsgLock);
+ spin_lock_irqsave(&gVmbusConnection.channelmsg_lock, flags);
REMOVE_ENTRY_LIST(&info->MsgListEntry);
- SpinlockRelease(gVmbusConnection.ChannelMsgLock);
+ spin_unlock_irqrestore(&gVmbusConnection.channelmsg_lock, flags);
WaitEventClose(info->WaitEvent);
kfree(info);
VMBUS_CHANNEL_MSGINFO* msgInfo;
VMBUS_CHANNEL_MESSAGE_HEADER* requestHeader;
VMBUS_CHANNEL_OPEN_CHANNEL* openMsg;
+ unsigned long flags;
DPRINT_ENTER(VMBUS);
DPRINT_DBG(VMBUS, "vmbus open result - %d", result->Status);
// Find the open msg, copy the result and signal/unblock the wait event
- SpinlockAcquire(gVmbusConnection.ChannelMsgLock);
+ spin_lock_irqsave(&gVmbusConnection.channelmsg_lock, flags);
ITERATE_LIST_ENTRIES(anchor, curr, &gVmbusConnection.ChannelMsgList)
{
}
}
}
- SpinlockRelease(gVmbusConnection.ChannelMsgLock);
+ spin_unlock_irqrestore(&gVmbusConnection.channelmsg_lock, flags);
DPRINT_EXIT(VMBUS);
}
VMBUS_CHANNEL_MSGINFO *msgInfo;
VMBUS_CHANNEL_MESSAGE_HEADER *requestHeader;
VMBUS_CHANNEL_GPADL_HEADER *gpadlHeader;
+ unsigned long flags;
DPRINT_ENTER(VMBUS);
DPRINT_DBG(VMBUS, "vmbus gpadl created result - %d", gpadlCreated->CreationStatus);
// Find the establish msg, copy the result and signal/unblock the wait event
- SpinlockAcquire(gVmbusConnection.ChannelMsgLock);
+ spin_lock_irqsave(&gVmbusConnection.channelmsg_lock, flags);
ITERATE_LIST_ENTRIES(anchor, curr, &gVmbusConnection.ChannelMsgList)
{
}
}
}
- SpinlockRelease(gVmbusConnection.ChannelMsgLock);
+ spin_unlock_irqrestore(&gVmbusConnection.channelmsg_lock, flags);
DPRINT_EXIT(VMBUS);
}
VMBUS_CHANNEL_MSGINFO* msgInfo;
VMBUS_CHANNEL_MESSAGE_HEADER *requestHeader;
VMBUS_CHANNEL_GPADL_TEARDOWN *gpadlTeardown;
+ unsigned long flags;
DPRINT_ENTER(VMBUS);
// Find the open msg, copy the result and signal/unblock the wait event
- SpinlockAcquire(gVmbusConnection.ChannelMsgLock);
+ spin_lock_irqsave(&gVmbusConnection.channelmsg_lock, flags);
ITERATE_LIST_ENTRIES(anchor, curr, &gVmbusConnection.ChannelMsgList)
{
}
}
}
- SpinlockRelease(gVmbusConnection.ChannelMsgLock);
+ spin_unlock_irqrestore(&gVmbusConnection.channelmsg_lock, flags);
DPRINT_EXIT(VMBUS);
}
VMBUS_CHANNEL_MESSAGE_HEADER *requestHeader;
VMBUS_CHANNEL_INITIATE_CONTACT *initiate;
VMBUS_CHANNEL_VERSION_RESPONSE *versionResponse = (VMBUS_CHANNEL_VERSION_RESPONSE*)hdr;
+ unsigned long flags;
DPRINT_ENTER(VMBUS);
- SpinlockAcquire(gVmbusConnection.ChannelMsgLock);
+ spin_lock_irqsave(&gVmbusConnection.channelmsg_lock, flags);
ITERATE_LIST_ENTRIES(anchor, curr, &gVmbusConnection.ChannelMsgList)
{
WaitEventSet(msgInfo->WaitEvent);
}
}
- SpinlockRelease(gVmbusConnection.ChannelMsgLock);
+ spin_unlock_irqrestore(&gVmbusConnection.channelmsg_lock, flags);
DPRINT_EXIT(VMBUS);
}
int ret=0;
VMBUS_CHANNEL_MSGINFO *msgInfo=NULL;
VMBUS_CHANNEL_INITIATE_CONTACT *msg;
+ unsigned long flags;
DPRINT_ENTER(VMBUS);
gVmbusConnection.WorkQueue = WorkQueueCreate("vmbusQ");
INITIALIZE_LIST_HEAD(&gVmbusConnection.ChannelMsgList);
- gVmbusConnection.ChannelMsgLock = SpinlockCreate();
+ spin_lock_init(&gVmbusConnection.channelmsg_lock);
INITIALIZE_LIST_HEAD(&gVmbusConnection.ChannelList);
gVmbusConnection.ChannelLock = SpinlockCreate();
// Add to list before we send the request since we may receive the response
// before returning from this routine
- SpinlockAcquire(gVmbusConnection.ChannelMsgLock);
+ spin_lock_irqsave(&gVmbusConnection.channelmsg_lock, flags);
INSERT_TAIL_LIST(&gVmbusConnection.ChannelMsgList, &msgInfo->MsgListEntry);
- SpinlockRelease(gVmbusConnection.ChannelMsgLock);
+ spin_unlock_irqrestore(&gVmbusConnection.channelmsg_lock, flags);
DPRINT_DBG(VMBUS, "Vmbus connection - interrupt pfn %llx, monitor1 pfn %llx,, monitor2 pfn %llx",
msg->InterruptPage, msg->MonitorPage1, msg->MonitorPage2);
WorkQueueClose(gVmbusConnection.WorkQueue);
SpinlockClose(gVmbusConnection.ChannelLock);
- SpinlockClose(gVmbusConnection.ChannelMsgLock);
if (gVmbusConnection.InterruptPage)
{
// TODO: iterate thru the msg list and free up
- SpinlockClose(gVmbusConnection.ChannelMsgLock);
-
WorkQueueClose(gVmbusConnection.WorkQueue);
gVmbusConnection.ConnectState = Disconnected;
// 2 pages - 1st page for parent->child notification and 2nd is child->parent notification
void * MonitorPages;
LIST_ENTRY ChannelMsgList;
- HANDLE ChannelMsgLock;
+ spinlock_t channelmsg_lock;
// List of channels
LIST_ENTRY ChannelList;