RingInfo->RingSize = BufferLen;
RingInfo->RingDataSize = BufferLen - sizeof(RING_BUFFER);
- RingInfo->RingLock = SpinlockCreate();
+ spin_lock_init(&RingInfo->ring_lock);
return 0;
}
RING_BUFFER_INFO* RingInfo
)
{
- SpinlockClose(RingInfo->RingLock);
}
/*++
volatile u32 nextWriteLocation;
u64 prevIndices=0;
+ unsigned long flags;
DPRINT_ENTER(VMBUS);
totalBytesToWrite += sizeof(u64);
- SpinlockAcquire(OutRingInfo->RingLock);
+ spin_lock_irqsave(&OutRingInfo->ring_lock, flags);
GetRingBufferAvailBytes(OutRingInfo, &byteAvailToRead, &byteAvailToWrite);
{
DPRINT_DBG(VMBUS, "No more space left on outbound ring buffer (needed %u, avail %u)", totalBytesToWrite, byteAvailToWrite);
- SpinlockRelease(OutRingInfo->RingLock);
+ spin_unlock_irqrestore(&OutRingInfo->ring_lock, flags);
DPRINT_EXIT(VMBUS);
//DumpRingInfo(OutRingInfo, "AFTER ");
- SpinlockRelease(OutRingInfo->RingLock);
+ spin_unlock_irqrestore(&OutRingInfo->ring_lock, flags);
DPRINT_EXIT(VMBUS);
u32 bytesAvailToWrite;
u32 bytesAvailToRead;
u32 nextReadLocation=0;
+ unsigned long flags;
- SpinlockAcquire(InRingInfo->RingLock);
+ spin_lock_irqsave(&InRingInfo->ring_lock, flags);
GetRingBufferAvailBytes(InRingInfo, &bytesAvailToRead, &bytesAvailToWrite);
{
//DPRINT_DBG(VMBUS, "got callback but not enough to read <avail to read %d read size %d>!!", bytesAvailToRead, BufferLen);
- SpinlockRelease(InRingInfo->RingLock);
+ spin_unlock_irqrestore(&InRingInfo->ring_lock, flags);
return -1;
}
BufferLen,
nextReadLocation);
- SpinlockRelease(InRingInfo->RingLock);
+ spin_unlock_irqrestore(&InRingInfo->ring_lock, flags);
return 0;
}
u32 bytesAvailToRead;
u32 nextReadLocation=0;
u64 prevIndices=0;
+ unsigned long flags;
ASSERT(BufferLen > 0);
- SpinlockAcquire(InRingInfo->RingLock);
+ spin_lock_irqsave(&InRingInfo->ring_lock, flags);
GetRingBufferAvailBytes(InRingInfo, &bytesAvailToRead, &bytesAvailToWrite);
{
DPRINT_DBG(VMBUS, "got callback but not enough to read <avail to read %d read size %d>!!", bytesAvailToRead, BufferLen);
- SpinlockRelease(InRingInfo->RingLock);
+ spin_unlock_irqrestore(&InRingInfo->ring_lock, flags);
return -1;
}
//DumpRingInfo(InRingInfo, "AFTER ");
- SpinlockRelease(InRingInfo->RingLock);
+ spin_unlock_irqrestore(&InRingInfo->ring_lock, flags);
return 0;
}