int ret=0;
VMBUS_CHANNEL_CLOSE_CHANNEL* msg;
VMBUS_CHANNEL_MSGINFO* info;
+ unsigned long flags;
DPRINT_ENTER(VMBUS);
// since the caller will free the channel
if (Channel->State == CHANNEL_OPEN_STATE)
{
- SpinlockAcquire(gVmbusConnection.ChannelLock);
+ spin_lock_irqsave(&gVmbusConnection.channel_lock, flags);
REMOVE_ENTRY_LIST(&Channel->ListEntry);
- SpinlockRelease(gVmbusConnection.ChannelLock);
+ spin_unlock_irqrestore(&gVmbusConnection.channel_lock, flags);
FreeVmbusChannel(Channel);
}
LIST_ENTRY* curr;
bool fNew = true;
VMBUS_CHANNEL* channel;
+ unsigned long flags;
DPRINT_ENTER(VMBUS);
// Make sure this is a new offer
- SpinlockAcquire(gVmbusConnection.ChannelLock);
+ spin_lock_irqsave(&gVmbusConnection.channel_lock, flags);
ITERATE_LIST_ENTRIES(anchor, curr, &gVmbusConnection.ChannelList)
{
{
INSERT_TAIL_LIST(&gVmbusConnection.ChannelList, &newChannel->ListEntry);
}
- SpinlockRelease(gVmbusConnection.ChannelLock);
+ spin_unlock_irqrestore(&gVmbusConnection.channel_lock, flags);
if (!fNew)
{
DPRINT_ERR(VMBUS, "unable to add child device object (relid %d)",
newChannel->OfferMsg.ChildRelId);
- SpinlockAcquire(gVmbusConnection.ChannelLock);
+ spin_lock_irqsave(&gVmbusConnection.channel_lock, flags);
REMOVE_ENTRY_LIST(&newChannel->ListEntry);
- SpinlockRelease(gVmbusConnection.ChannelLock);
+ spin_unlock_irqrestore(&gVmbusConnection.channel_lock, flags);
FreeVmbusChannel(newChannel);
}
LIST_ENTRY *entry;
VMBUS_CHANNEL *channel;
VMBUS_CHANNEL *start=NULL;
+ unsigned long flags;
- SpinlockAcquire(gVmbusConnection.ChannelLock);
+ spin_lock_irqsave(&gVmbusConnection.channel_lock, flags);
while (!IsListEmpty(&gVmbusConnection.ChannelList))
{
}
}
- SpinlockRelease(gVmbusConnection.ChannelLock);
+ spin_unlock_irqrestore(&gVmbusConnection.channel_lock, flags);
}
// eof
spin_lock_init(&gVmbusConnection.channelmsg_lock);
INITIALIZE_LIST_HEAD(&gVmbusConnection.ChannelList);
- gVmbusConnection.ChannelLock = SpinlockCreate();
+ spin_lock_init(&gVmbusConnection.channel_lock);
// Setup the vmbus event connection for channel interrupt abstraction stuff
gVmbusConnection.InterruptPage = PageAlloc(1);
gVmbusConnection.ConnectState = Disconnected;
WorkQueueClose(gVmbusConnection.WorkQueue);
- SpinlockClose(gVmbusConnection.ChannelLock);
if (gVmbusConnection.InterruptPage)
{
VMBUS_CHANNEL* foundChannel=NULL;
LIST_ENTRY* anchor;
LIST_ENTRY* curr;
+ unsigned long flags;
- SpinlockAcquire(gVmbusConnection.ChannelLock);
+ spin_lock_irqsave(&gVmbusConnection.channel_lock, flags);
ITERATE_LIST_ENTRIES(anchor, curr, &gVmbusConnection.ChannelList)
{
channel = CONTAINING_RECORD(curr, VMBUS_CHANNEL, ListEntry);
break;
}
}
- SpinlockRelease(gVmbusConnection.ChannelLock);
+ spin_unlock_irqrestore(&gVmbusConnection.channel_lock, flags);
return foundChannel;
}
// List of channels
LIST_ENTRY ChannelList;
- HANDLE ChannelLock;
+ spinlock_t channel_lock;
HANDLE WorkQueue;
} VMBUS_CONNECTION;