From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from EUR01-DB5-obe.outbound.protection.outlook.com (mail-db5eur01on0077.outbound.protection.outlook.com [104.47.2.77]) by dpdk.org (Postfix) with ESMTP id 351315F11 for ; Thu, 1 Mar 2018 08:35:04 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nxp.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=D5ZayIA0Luz9imyBsjRBDBVd6ar0B8p+oHMOVrgQX24=; b=qf5I+3luoSn9pgFuB1NFSeLdNy0dRCUor0V8OK1xGbNtCmd6FRk30TdGvZVlNLtAVC9J9myQOLbuJ5ZaJfQ4s1sdt+6wPcZfXnY+wj+REX89748sQArV39PCi2eQD2bneIwT3esiQd+vgUb95ZtVAclnq2bjJ9L2VnXhwnqyppc= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=hemant.agrawal@nxp.com; Received: from bf-netperf1.ap.freescale.net (14.142.187.166) by AM2PR04MB0753.eurprd04.prod.outlook.com (2a01:111:e400:8411::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.527.15; Thu, 1 Mar 2018 07:35:02 +0000 From: Hemant Agrawal To: dev@dpdk.org, bruce.richardson@intel.com Cc: thomas@monjalon.net Date: Thu, 1 Mar 2018 13:03:13 +0530 Message-Id: <1519889597-5805-7-git-send-email-hemant.agrawal@nxp.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1519889597-5805-1-git-send-email-hemant.agrawal@nxp.com> References: <1519752352-15442-1-git-send-email-hemant.agrawal@nxp.com> <1519889597-5805-1-git-send-email-hemant.agrawal@nxp.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [14.142.187.166] X-ClientProxiedBy: PN1PR0101CA0043.INDPRD01.PROD.OUTLOOK.COM (2603:1096:c00:c::29) To AM2PR04MB0753.eurprd04.prod.outlook.com (2a01:111:e400:8411::13) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: 6538b73b-7e9a-47aa-7b70-08d57f46f208 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(7020095)(4652020)(48565401081)(4534165)(7168020)(4627221)(201703031133081)(201702281549075)(5600026)(4604075)(2017052603307)(7153060)(7193020); SRVR:AM2PR04MB0753; X-Microsoft-Exchange-Diagnostics: 1; AM2PR04MB0753; 3:JJZnp6+nsvS71haEaZLKWRDzvfdQJ2ViE/cHomhX8JoUP3igesClx2J+A+us/35s8zZHEJ/pAwG2F0UpoGToUVaHB9y7rwSL9XiZIbh4j4QhnFIOb3L7479u87T2PfosKvmDora0CcJfjybNIBZGwBU3gphMYIeAN0RSIOxsRfg/UPpSUUZzb4AyjRMJfi2C2fF08Zaw86KvBMBgsXK2hoPVIL2NCXjrdZq7YPg1NKa/dv1unlfc8HqzwoZ+sSis; 25:oSoDMIIOzudg/R/7vFSG8BFY5sFPs43SYwdQn6piIivALm8fImnEU/Z0Gy7iAuz+p8NW8Xq2xJqp8vZR2K6mMjXznlKqXJ7ynAkVdDyDDtKplS2a8bY92iVVIrBAkP3YBwU9KpCsFthHp99MzoSmdt09N2F0lqjpoQpaRPxEFdfyXbYtC9QZuZNIxrhxw+esgSSq7MOj7BSGarJ5fM0rw4vhf0Zyb8aluQMBtvzKK2O8dEskRnZsrH8il8lwQ4gUUB7yzIcxXxipI52KHyQ25Pdo5QVITQtBnq8o+EPafN0UPLf4IMqFwIPscS4e6w4y7PiRz473hVJefsJ0wu8U2w==; 31:6rpHMqUi4fnOLA5LgglU8tyJx6Ry0eqUkjJhB8DbHPNkFRGaoGEZ2qiSFuJLnwta2I3shQrsq5kVdJlpQdqeiou1RDp3DCK0fzlo6dWsyBo0ZWvkOm8U+IN/OI4jCTIKO9/6iJJTmKbZWnb9Ao+x+3d72nxqFLwY3dVF7uebEzPGjo8/gQjkV0JdJgAN3/+w+sbQW3w5l3FfTxcu56To4xIDKnXUSleDBGA3gNfl6XI= X-MS-TrafficTypeDiagnostic: AM2PR04MB0753: X-Microsoft-Exchange-Diagnostics: 1; AM2PR04MB0753; 20:V2ZlxI/TTSC2ZWm8elX7ZZy6wmpls9wmVvFxmdE1SvarPn7eS4W46cqbUc+7B9GbFyIwfuB/y2rb06OY8QhkC+Q+xMdjtet4YoGcwyRJzNqDIDkL9ShaktCaL9P58KILV9492yu2/CMTo1/Wqsu8ZZBX1/nSNgSvUCfAnVBlg3Y7ic96REODYaSRtNUL8DnKMo12AT+Lm3j53qYcuwDmuUq1NVTg+Ln9ubEaLk1iv8zyjSJ9wbIg0mYh9OQZ3lGa27UCQUgbErggMUfJk6gUaX9RfbLMC5MTSVD+CX36mcDQXU96/3ITWu5vGImDo2NL+MxDOkG9SG5ws+oEHjNGXOWaK2LtCLT7kkAlVm0UU3ajU+yTO9BUAZo6ktcmC+scPIUh0P2hBMp6xrgzdWYzz6M/+aXevimLs1o/t6fUWDNFPYVRDZjWDEEPExUqRl4sfsKlnjLnQ+Vzv1xAma/V9q1btkqSkvTMQNGii7NSO3wIaRETUw0T+KU67wPvBKMm; 4:POIPGogIYtFQVn44nfBiyyJ9uvlcsSNpjNuNb7KzUENrK4ddLDvtA1yPuiRbKX04y1l6JkwAcpJTGoXU3VNKlqlFll/GUkVTkkvSA5Vqtp5kZCMtJF2gX6aqz24M/oJzTXe7G4/PbKRYhO69DKWpVvvL2Yo286Xl9kttCMs9Jeye0e8BASjuPGCu0MU6NslgG3dPk/dsI7cUCd5aNshm1IrXBpbOToB+8vm3htFv88MUSAvaOF6allxPc1Nrih065JLdXf+6cw1TPAY0hFdwtftMRFw1FNQ9T1P6/R65GJvWFtVSFT0l/jU1BaW5A7qh X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(185117386973197); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(8211001083)(6040501)(2401047)(8121501046)(5005006)(3002001)(3231220)(944501224)(52105095)(93006095)(93001095)(10201501046)(6055026)(6041288)(20161123558120)(20161123560045)(20161123562045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123564045)(6072148)(201708071742011); SRVR:AM2PR04MB0753; BCL:0; PCL:0; RULEID:; SRVR:AM2PR04MB0753; X-Forefront-PRVS: 05986C03E0 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(376002)(396003)(39380400002)(366004)(346002)(39860400002)(199004)(189003)(7736002)(8676002)(26005)(16526019)(386003)(55236004)(106356001)(81166006)(50226002)(47776003)(81156014)(6506007)(66066001)(8936002)(16586007)(316002)(2906002)(4326008)(25786009)(6116002)(5660300001)(3846002)(186003)(86362001)(305945005)(6512007)(2950100002)(6666003)(97736004)(50466002)(48376002)(478600001)(5009440100003)(52116002)(36756003)(53936002)(68736007)(76176011)(51416003)(6486002)(105586002)(110426004)(473944003); DIR:OUT; SFP:1101; SCL:1; SRVR:AM2PR04MB0753; H:bf-netperf1.ap.freescale.net; FPR:; SPF:None; PTR:InfoNoRecords; A:1; MX:1; LANG:en; Received-SPF: None (protection.outlook.com: nxp.com does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; AM2PR04MB0753; 23:uLeGWSmGgfoKb53gETgVkOLLYRpVwxIxTc3Bjgbri?= =?us-ascii?Q?IE0hqiET0pCne4zTCURNhAGDubrhAdBXWJhz5GrsXqRnDw7BY+yFV+5DQ96+?= =?us-ascii?Q?0zpAU1QT0jDKCx1zaU7AEvOBpaUNb3lO5xv6kv4Pf8Ree1saU1t9jaK0xdVV?= =?us-ascii?Q?x/9Y7gCfXXQMQNrKXuR/LMJPkTtc7jOtRRXRlavubd8hRkKH7LaGSc2ZU1Mt?= =?us-ascii?Q?QBep2Hx15NZCu3iOBjbOP1v3zGiT17mIBzkW4Mns11URSzYDyRE5dQ4Ion5X?= =?us-ascii?Q?RjyekvxgvEuMkWDG1JFpzjR2YUba9Wku655oDoOVEBM/4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D?= X-Microsoft-Exchange-Diagnostics: 1; AM2PR04MB0753; 6:4l126dXyAu6ygnBfyCV2zxoChEaFOtuzBu5vF0H212DAkA8hbpai7eghMqivIAjag8TcARWOyPUA8W4j0dSttGh73zpB2P20RpATTQxTdiLH11YM1zimJ8m6l12j4e3Du3RwCxPWk+ZGviPSGKXQGvDeJY+3xDVPLD+nge+whWwqv+m8dzNRy6UdEZHD0cKwVux732F0DMwizgCew8b9ch+KWStWEVYYm+sMdjQmb1wHv8Ek8FXyQTibsks4CW5KN88ERtcYbUZ3qksX4BYMFsTUWQz63pekSXhFCk5/lchTfiLvErNwMdlRKUEDoe54sOIXZbkaNCSOHY7app2dBTp3MSp+I0dd0jFtc0ZjYLg=; 5:4ge9DkZfqv3HlOHFIlFqWj0qzyhhUt1QUOy4FHQiM3b/EGJV9ZzJctuFeYJZrgar92XZi4kmKwqv8ksDyBSPcH42zIA+HJtqe2utrMnoJYlP2f3aTVThtRlyLi0/fL33TAUvJLGQxuxrM2LrCe1DW0zBuVqNmUECmf54PLHe9PM=; 24:7s88bFYE5FaxRmp/ImHlvEaoLM837EsSSxpzC6U/UGhzwIq2B5nb7lka5+Gh92owrT/oqBEHq7GOp9q8YMNKTm6NgCw1tnwuY5BwXB6qKTs=; 7:S3f0ymWwm/MK2jPK3iueCDZRCI+HPqzH1QRQtS8UTH4fto8gy2r7NQA4HdJD15RC3g3hLAV1OmngS2fv++S/IpIJIZbZ323b2Y5qN4oOiC7r/xwUjUh3lqPXTgb1faLTRQ0zOBYmXvhKp3dCpnwUxztzsXxR5o7SrHXKowO6z4PHvwgYko8kXb3pHeyBthJHukzTeH5dWU0wVhDsGpjaqHvA0+kf9mkuFpLdUAP1uFgWpCAN6oEBr8YA7ZOeE/N1 SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 01 Mar 2018 07:35:02.0373 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 6538b73b-7e9a-47aa-7b70-08d57f46f208 X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM2PR04MB0753 Subject: [dpdk-dev] [PATCH v2 06/10] bus/dpaa: enabling dpaa compilation for other platforms X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 01 Mar 2018 07:35:04 -0000 Signed-off-by: Hemant Agrawal --- drivers/bus/dpaa/include/compat.h | 30 ++++++++++++++++++++++++++++-- 1 file changed, 28 insertions(+), 2 deletions(-) diff --git a/drivers/bus/dpaa/include/compat.h b/drivers/bus/dpaa/include/compat.h index 53707bb..e4b5702 100644 --- a/drivers/bus/dpaa/include/compat.h +++ b/drivers/bus/dpaa/include/compat.h @@ -39,6 +39,7 @@ #include #include #include +#include /* The following definitions are primarily to allow the single-source driver * interfaces to be included by arbitrary program code. Ie. for interfaces that @@ -127,13 +128,15 @@ static inline void out_be32(volatile void *__p, u32 val) *p = rte_cpu_to_be_32(val); } +#define hwsync() rte_rmb() +#define lwsync() rte_wmb() + #define dcbt_ro(p) __builtin_prefetch(p, 0) #define dcbt_rw(p) __builtin_prefetch(p, 1) +#if defined(RTE_ARCH_ARM64) #define dcbz(p) { asm volatile("dc zva, %0" : : "r" (p) : "memory"); } #define dcbz_64(p) dcbz(p) -#define hwsync() rte_rmb() -#define lwsync() rte_wmb() #define dcbf(p) { asm volatile("dc cvac, %0" : : "r"(p) : "memory"); } #define dcbf_64(p) dcbf(p) #define dccivac(p) { asm volatile("dc civac, %0" : : "r"(p) : "memory"); } @@ -144,9 +147,27 @@ static inline void out_be32(volatile void *__p, u32 val) asm volatile("prfm pldl1keep, [%0, #64]" : : "r" (p)); \ } while (0) +#elif defined(RTE_ARCH_ARM) +#define dcbz(p) memset((p), 0, 32) +#define dcbz_64(p) memset((p), 0, 64) +#define dcbf(p) RTE_SET_USED(p) +#define dcbf_64(p) dcbf(p) +#define dccivac(p) RTE_SET_USED(p) +#define dcbit_ro(p) RTE_SET_USED(p) + +#else +#define dcbz(p) RTE_SET_USED(p) +#define dcbz_64(p) dcbz(p) +#define dcbf(p) RTE_SET_USED(p) +#define dcbf_64(p) dcbf(p) +#define dccivac(p) RTE_SET_USED(p) +#define dcbit_ro(p) RTE_SET_USED(p) +#endif + #define barrier() { asm volatile ("" : : : "memory"); } #define cpu_relax barrier +#if defined(RTE_ARCH_ARM64) static inline uint64_t mfatb(void) { uint64_t ret, ret_new, timeout = 200; @@ -160,6 +181,11 @@ static inline uint64_t mfatb(void) DPAA_BUG_ON(!timeout && (ret != ret_new)); return ret * 64; } +#else + +#define mfatb rte_rdtsc + +#endif /* Spin for a few cycles without bothering the bus */ static inline void cpu_spin(int cycles) -- 2.7.4