crypto/qat: use I/O device memory read/write API
authorSantosh Shukla <santosh.shukla@caviumnetworks.com>
Wed, 18 Jan 2017 01:21:28 +0000 (06:51 +0530)
committerThomas Monjalon <thomas.monjalon@6wind.com>
Wed, 18 Jan 2017 16:18:27 +0000 (17:18 +0100)
Replace the raw I/O device memory read/write access with eal
abstraction for I/O device memory read/write access to fix portability
issues across different architectures.

CC: John Griffin <john.griffin@intel.com>
CC: Fiona Trahe <fiona.trahe@intel.com>
CC: Deepak Kumar Jain <deepak.k.jain@intel.com>
Signed-off-by: Santosh Shukla <santosh.shukla@caviumnetworks.com>
Signed-off-by: Jerin Jacob <jerin.jacob@caviumnetworks.com>
drivers/crypto/qat/qat_adf/adf_transport_access_macros.h

index 47f1c91..d218f85 100644 (file)
 #ifndef ADF_TRANSPORT_ACCESS_MACROS_H
 #define ADF_TRANSPORT_ACCESS_MACROS_H
 
+#include <rte_io.h>
+
 /* CSR write macro */
-#define ADF_CSR_WR(csrAddr, csrOffset, val) \
-       (void)((*((volatile uint32_t *)(((uint8_t *)csrAddr) + csrOffset)) \
-                       = (val)))
+#define ADF_CSR_WR(csrAddr, csrOffset, val)            \
+       rte_write32(val, (((uint8_t *)csrAddr) + csrOffset))
 
 /* CSR read macro */
-#define ADF_CSR_RD(csrAddr, csrOffset) \
-       (*((volatile uint32_t *)(((uint8_t *)csrAddr) + csrOffset)))
+#define ADF_CSR_RD(csrAddr, csrOffset)                 \
+       rte_read32((((uint8_t *)csrAddr) + csrOffset))
 
 #define ADF_BANK_INT_SRC_SEL_MASK_0 0x4444444CUL
 #define ADF_BANK_INT_SRC_SEL_MASK_X 0x44444444UL