index 5b85be3c5942590bf33b9b828b62307ae01f1e99..09db6a04b2aeed56b4ca94818434e7dcd71ff58c 100644 (file)
/*
/*
- * Copyright (c) 2017-2019 Texas Instruments Incorporated - http://www.ti.com
+ * Copyright (c) 2017-2020 Texas Instruments Incorporated - http://www.ti.com
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
}
}
}
}
-static inline Void * _VirtQueue_getVA(VirtQueue_Handle vq, UInt32 pa)
+static inline Void * mapPAtoVA(UInt pa)
{
{
- return (Void *)(pa - vq->basePa + vq->baseVa);
+ return (Void *)(pa);
}
/*!
}
/*!
*/
head = vq->vring.avail->ring[vq->last_avail_idx++ % vq->vring.num];
*/
head = vq->vring.avail->ring[vq->last_avail_idx++ % vq->vring.num];
- *buf = _VirtQueue_getVA(vq, vq->vring.desc[head].addr);
+ *buf = mapPAtoVA(vq->vring.desc[head].addr);
*len = vq->vring.desc[head].len;
}
GateHwi_leave(vq->gateH, key);
*len = vq->vring.desc[head].len;
}
GateHwi_leave(vq->gateH, key);
@@ -461,13 +461,7 @@ VirtQueue_Handle VirtQueue_create(UInt16 remoteProcId, VirtQueue_Params *params,
vq->basePa = (UInt32)Resource_getVringDA(vq->id);
Assert_isTrue(vq->basePa != 0, NULL);
vq->basePa = (UInt32)Resource_getVringDA(vq->id);
Assert_isTrue(vq->basePa != 0, NULL);
- result = Resource_physToVirt(vq->basePa, &(vq->baseVa));
- Assert_isTrue(result == Resource_S_SUCCESS, (Assert_Id)NULL);
- /* Additional check to handle case when Assert is disabled */
- if (result != Resource_S_SUCCESS) {
- return (NULL);
- }
-
+ vq->baseVa = mapPAtoVA(vq->basePa);
vringAddr = (Void *)vq->baseVa;
break;
default:
vringAddr = (Void *)vq->baseVa;
break;
default: