(pChannel))->Size) < expectedMinBytes) {
CHANNEL_U64_MISMATCH(expectedTypeGuid, channelName,
"size", expectedMinBytes,
- ((CHANNEL_HEADER __iomem *)
- (pChannel))->Size, fileName,
+ readq(&((CHANNEL_HEADER __iomem *)
+ (pChannel))->Size),
+ fileName,
lineNumber, logCtx);
return 0;
}
!= expectedVersionId) {
CHANNEL_U32_MISMATCH(expectedTypeGuid, channelName,
"version", expectedVersionId,
- ((CHANNEL_HEADER __iomem *)
- (pChannel))->VersionId, fileName,
- lineNumber, logCtx);
+ readl(&((CHANNEL_HEADER __iomem *)
+ (pChannel))->VersionId),
+ fileName, lineNumber, logCtx);
return 0;
}
if (expectedSignature > 0) /* caller wants us to verify
!= expectedSignature) {
CHANNEL_U64_MISMATCH(expectedTypeGuid, channelName,
"signature", expectedSignature,
- ((CHANNEL_HEADER __iomem *)
- (pChannel))->Signature, fileName,
+ readq(&((CHANNEL_HEADER __iomem *)
+ (pChannel))->Signature),
+ fileName,
lineNumber, logCtx);
return 0;
}
* correctly at DEVICE_CREATE time, INSTEAD OF waiting until
* DEVICE_CONFIGURE time.
*/
-#define WAIT_FOR_VALID_GUID(guid) \
- do { \
- while (uuid_le_cmp(guid, NULL_UUID_LE) == 0) { \
- LOGERR("Waiting for non-0 GUID (why???)...\n"); \
- UIS_THREAD_WAIT_SEC(5); \
- } \
- LOGERR("OK... GUID is non-0 now\n"); \
- } while (0)
+static inline void
+wait_for_valid_guid(uuid_le __iomem *guid)
+{
+ uuid_le tmpguid;
+
+ while (1) {
+ memcpy_fromio((void *)&tmpguid,
+ (void __iomem *)guid, sizeof(uuid_le));
+ if (uuid_le_cmp(tmpguid, NULL_UUID_LE) != 0)
+ break;
+ LOGERR("Waiting for non-0 GUID (why???)...\n");
+ UIS_THREAD_WAIT_SEC(5);
+ }
+ LOGERR("OK... GUID is non-0 now\n");
+}
/* CopyFragsInfoFromSkb returns the number of entries added to frags array
* Returns -1 on failure.
struct guest_msgs cmd;
if (!uuid_le_cmp(dev->channelTypeGuid,
UltraVhbaChannelProtocolGuid)) {
- WAIT_FOR_VALID_GUID(((CHANNEL_HEADER
+ wait_for_valid_guid(&((CHANNEL_HEADER
__iomem *) (dev->
chanptr))->
Type);
} else
if (!uuid_le_cmp(dev->channelTypeGuid,
UltraVnicChannelProtocolGuid)) {
- WAIT_FOR_VALID_GUID(((CHANNEL_HEADER
+ wait_for_valid_guid(&((CHANNEL_HEADER
__iomem *) (dev->
chanptr))->
Type);