if (Channel->OfferMsg.MonitorAllocated)
{
/* Each u32 represents 32 channels */
- BitSet((u32*)gVmbusConnection.SendInterruptPage + (Channel->OfferMsg.ChildRelId >> 5), Channel->OfferMsg.ChildRelId & 31);
+ set_bit(Channel->OfferMsg.ChildRelId & 31,
+ (unsigned long *) gVmbusConnection.SendInterruptPage +
+ (Channel->OfferMsg.ChildRelId >> 5) );
monitorPage = (HV_MONITOR_PAGE*)gVmbusConnection.MonitorPages;
monitorPage++; /* Get the child to parent monitor page */
- BitSet((u32*) &monitorPage->TriggerGroup[Channel->MonitorGroup].Pending, Channel->MonitorBit);
+ set_bit(Channel->MonitorBit,
+ (unsigned long *) &monitorPage->TriggerGroup[Channel->MonitorGroup].Pending);
+
}
else
{
if (Channel->OfferMsg.MonitorAllocated)
{
/* Each u32 represents 32 channels */
- BitClear((u32*)gVmbusConnection.SendInterruptPage + (Channel->OfferMsg.ChildRelId >> 5), Channel->OfferMsg.ChildRelId & 31);
+ clear_bit(Channel->OfferMsg.ChildRelId & 31,
+ (unsigned long *) gVmbusConnection.SendInterruptPage + (Channel->OfferMsg.ChildRelId >> 5));
monitorPage = (HV_MONITOR_PAGE*)gVmbusConnection.MonitorPages;
monitorPage++; /* Get the child to parent monitor page */
- BitClear((u32*) &monitorPage->TriggerGroup[Channel->MonitorGroup].Pending, Channel->MonitorBit);
+ clear_bit(Channel->MonitorBit,
+ (unsigned long *) &monitorPage->TriggerGroup[Channel->MonitorGroup].Pending);
}
DPRINT_EXIT(VMBUS);
{
for (bit = 0; bit < 32; bit++)
{
- if (BitTestAndClear(&recvInterruptPage[dword], bit))
+ if (test_and_clear_bit(bit, (unsigned long *) &recvInterruptPage[dword]))
{
relid = (dword << 5) + bit;
DPRINT_ENTER(VMBUS);
/* Each u32 represents 32 channels */
- BitSet((u32*)gVmbusConnection.SendInterruptPage + (childRelId >> 5), childRelId & 31);
+ set_bit(childRelId & 31,
+ (unsigned long *) gVmbusConnection.SendInterruptPage + (childRelId >> 5));
+
ret = HvSignalEvent();
DPRINT_EXIT(VMBUS);
event = (HV_SYNIC_EVENT_FLAGS*)page_addr + VMBUS_MESSAGE_SINT;
/* Since we are a child, we only need to check bit 0 */
- if (BitTestAndClear(&event->Flags32[0], 0))
+ if (test_and_clear_bit(0, (unsigned long *) &event->Flags32[0]))
{
DPRINT_DBG(VMBUS, "received event %d", event->Flags32[0]);
ret |= 0x2;
/* Osd routines */
-extern void BitSet(unsigned int* addr, int value);
-extern void BitClear(unsigned int* addr, int value);
-extern int BitTest(unsigned int* addr, int value);
-extern int BitTestAndClear(unsigned int* addr, int value);
-extern int BitTestAndSet(unsigned int* addr, int value);
-
extern int InterlockedIncrement(int *val);
extern int InterlockedDecrement(int *val);
extern int InterlockedCompareExchange(int *val, int new, int curr);
void *data;
};
-
-void BitSet(unsigned int* addr, int bit)
-{
- set_bit(bit, (unsigned long*)addr);
-}
-
-int BitTest(unsigned int* addr, int bit)
-{
- return test_bit(bit, (unsigned long*)addr);
-}
-
-void BitClear(unsigned int* addr, int bit)
-{
- clear_bit(bit, (unsigned long*)addr);
-}
-
-int BitTestAndClear(unsigned int* addr, int bit)
-{
- return test_and_clear_bit(bit, (unsigned long*)addr);
-}
-
-int BitTestAndSet(unsigned int* addr, int bit)
-{
- return test_and_set_bit(bit, (unsigned long*)addr);
-}
-
-
int InterlockedIncrement(int *val)
{
return atomic_inc_return((atomic_t*)val);