From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by dpdk.space (Postfix) with ESMTP id 376B7A00E6 for ; Mon, 18 Mar 2019 05:16:04 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 3FC931DBD; Mon, 18 Mar 2019 05:16:03 +0100 (CET) Received: from mx0b-0016f401.pphosted.com (mx0b-0016f401.pphosted.com [67.231.156.173]) by dpdk.org (Postfix) with ESMTP id 55533152A for ; Mon, 18 Mar 2019 05:16:01 +0100 (CET) Received: from pps.filterd (m0045851.ppops.net [127.0.0.1]) by mx0b-0016f401.pphosted.com (8.16.0.27/8.16.0.27) with SMTP id x2I4FGUl030147; Sun, 17 Mar 2019 21:15:59 -0700 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=marvell.com; h=from : to : cc : subject : date : message-id : content-type : content-transfer-encoding : mime-version; s=pfpt0818; bh=NXnJVHfM0z0Pg75/ATF4cSCZF1RSjWmQIq0OeLVFH8Q=; b=ksrwPtjHO78zw03BItWR51N8V+Ea+kFZ6jvxGdygLjZbf+Yf6BiIxIFpTcVSPRSaCrpz 7fzNpkGYqjit59TeSdpeXwYb74tQcj2McJUbNGZYz+csxv2iw5u1tZALnN4qYBAt4tMx WTxL2ngIpR6Cqln6l7jFdDei7dyhIatfmQMMe80O47D/hhoOxFJnO3VFrrGNunbxc3r1 dDavfjEYZEGhGGijOfIgbQHtegIVHZJIVS4fQ2UNaWvm7fcy44lD/ZONi5ewfZjmU1Dx 1v0MOkNrM+BJUVCEjotsph4niaAYezdvWtFJ0vhQGR80xiF7x2XLDtjsZoy1F5GOkOlw Kw== Received: from sc-exch03.marvell.com ([199.233.58.183]) by mx0b-0016f401.pphosted.com with ESMTP id 2r90njkvkc-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT); Sun, 17 Mar 2019 21:15:59 -0700 Received: from SC-EXCH03.marvell.com (10.93.176.83) by SC-EXCH03.marvell.com (10.93.176.83) with Microsoft SMTP Server (TLS) id 15.0.1367.3; Sun, 17 Mar 2019 21:15:58 -0700 Received: from NAM02-SN1-obe.outbound.protection.outlook.com (104.47.36.55) by SC-EXCH03.marvell.com (10.93.176.83) with Microsoft SMTP Server (TLS) id 15.0.1367.3 via Frontend Transport; Sun, 17 Mar 2019 21:15:57 -0700 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=marvell.onmicrosoft.com; s=selector1-marvell-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=NXnJVHfM0z0Pg75/ATF4cSCZF1RSjWmQIq0OeLVFH8Q=; b=qfMZuReD6vRQfs87gSBI2z4vtY3aqH7ajlu8RpJHkG8cf6ZD06voqmxx+2Oqd83hAJlEvXod2L45mwFl8NrIlyX+IarrdwhYsIgh3HNb7l8Dw3Ep9Wu594ywZnNlzYZWwX5TUE7lqZpZZN9khSmXOqSKQ58cSj1Pk9WrFI9lCQ4= Received: from BYAPR18MB2424.namprd18.prod.outlook.com (20.179.91.149) by BYAPR18MB2678.namprd18.prod.outlook.com (20.179.94.89) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1709.14; Mon, 18 Mar 2019 04:15:56 +0000 Received: from BYAPR18MB2424.namprd18.prod.outlook.com ([fe80::2cce:b981:61da:f92b]) by BYAPR18MB2424.namprd18.prod.outlook.com ([fe80::2cce:b981:61da:f92b%2]) with mapi id 15.20.1709.015; Mon, 18 Mar 2019 04:15:56 +0000 From: Jerin Jacob Kollanukkaran To: Amr Mokhtar , Olivier Matz , Andrew Rybchenko CC: "dev@dpdk.org" , "thomas@monjalon.net" , Jerin Jacob Kollanukkaran Thread-Topic: [dpdk-dev] [PATCH] eal: use eal abstraction for defining constructors Thread-Index: AQHU3UFIq5WqvyLb6UyyzRDOQaJAyg== Date: Mon, 18 Mar 2019 04:15:56 +0000 Message-ID: <20190318041512.19526-1-jerinj@marvell.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-clientproxiedby: BM1PR0101CA0051.INDPRD01.PROD.OUTLOOK.COM (2603:1096:b00:19::13) To BYAPR18MB2424.namprd18.prod.outlook.com (2603:10b6:a03:130::21) x-ms-exchange-messagesentrepresentingtype: 1 x-mailer: git-send-email 2.21.0 x-originating-ip: [122.182.198.182] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 79de5085-ad75-4baa-4223-08d6ab586b0d x-microsoft-antispam: BCL:0; PCL:0; RULEID:(2390118)(7020095)(4652040)(8989299)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(5600127)(711020)(4605104)(2017052603328)(7153060)(7193020); SRVR:BYAPR18MB2678; x-ms-traffictypediagnostic: BYAPR18MB2678: x-microsoft-antispam-prvs: x-forefront-prvs: 098076C36C x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(396003)(346002)(39850400004)(366004)(376002)(136003)(199004)(189003)(36756003)(68736007)(26005)(107886003)(81156014)(6436002)(53936002)(6512007)(316002)(54906003)(110136005)(81166006)(97736004)(8676002)(66066001)(50226002)(2616005)(476003)(2906002)(6486002)(256004)(8936002)(99286004)(25786009)(102836004)(386003)(6506007)(305945005)(4326008)(14454004)(52116002)(106356001)(7736002)(71200400001)(71190400001)(105586002)(6116002)(1076003)(3846002)(186003)(486006)(86362001)(478600001)(5660300002); DIR:OUT; SFP:1101; SCL:1; SRVR:BYAPR18MB2678; H:BYAPR18MB2424.namprd18.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; A:1; MX:1; received-spf: None (protection.outlook.com: marvell.com does not designate permitted sender hosts) x-ms-exchange-senderadcheck: 1 x-microsoft-antispam-message-info: kogT2++9olf4pqLMS7RBKwErQTGIre4ywAnx4QIOp/KzlzhJL0rRtIqmlcysJBNj/TJ/Zwin88ETl7a8TekgHcP8QX7LAHQkakIurRdwVvVjfOU4PIir6we6CvQ+6xO+8etTWp07UWHXfsuwz3TTx6QtL1LLFDP6dlFMCtC3tnPlLIGoM6Y89BzqXyqoIXMwzm/wpG3OhXGUUcAXveHKBVw8hs7EZQJSidQl/Q/vuXetAnmYSP9W2HTMjaqpCqFn2juEa+5desHbRW1fSyzW1+CX4SwrD5fcX5nP/WQVOYgVv+bpP84l/0dNMEz/nRRDrbAI2++urgDIMnsRiAi2DNv627ErBwNMwc38Pmi7xSzRZP5d75WCnYLq4tsQGgs7KxJAcGv/TBLCPnlRwkd9MZ3nCmnTf8g0VPMX8bu5hHA= Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-MS-Exchange-CrossTenant-Network-Message-Id: 79de5085-ad75-4baa-4223-08d6ab586b0d X-MS-Exchange-CrossTenant-originalarrivaltime: 18 Mar 2019 04:15:56.4639 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 70e1fb47-1155-421d-87fc-2e58f638b6e0 X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-Transport-CrossTenantHeadersStamped: BYAPR18MB2678 X-OriginatorOrg: marvell.com X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:, , definitions=2019-03-18_03:, , signatures=0 Subject: [dpdk-dev] [PATCH] eal: use eal abstraction for defining constructors 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: , Errors-To: dev-bounces@dpdk.org Sender: "dev" Message-ID: <20190318041556.prwLSh714QSvYlK8PSeo1A-_ys8mToh6Al3EUZBm804@z> From: Jerin Jacob Use eal's RTE_INIT abstraction for defining constructors. Signed-off-by: Jerin Jacob --- app/test-bbdev/main.h | 3 +-- app/test/resource.h | 2 +- app/test/test.h | 3 +-- lib/librte_mempool/rte_mempool.h | 7 +++---- 4 files changed, 6 insertions(+), 9 deletions(-) diff --git a/app/test-bbdev/main.h b/app/test-bbdev/main.h index 20a55efca..2bbe1b822 100644 --- a/app/test-bbdev/main.h +++ b/app/test-bbdev/main.h @@ -103,8 +103,7 @@ void add_test_command(struct test_command *t); .command =3D RTE_STR(name), \ .callback =3D test_func_##name, \ }; \ - static void __attribute__((constructor, used)) \ - test_register_##name(void) \ + RTE_INIT(test_register_##name) \ { \ add_test_command(&test_struct_##name); \ } diff --git a/app/test/resource.h b/app/test/resource.h index 223fa22ae..c75ebd4b5 100644 --- a/app/test/resource.h +++ b/app/test/resource.h @@ -98,7 +98,7 @@ static struct resource linkres_ ##n =3D { \ .begin =3D b, \ .end =3D e, \ }; \ -static void __attribute__((constructor, used)) resinitfn_ ##n(void) \ +RTE_INIT(resinitfn_ ##n) \ { \ resource_register(&linkres_ ##n); \ } diff --git a/app/test/test.h b/app/test/test.h index 7c2443230..9b3846b1e 100644 --- a/app/test/test.h +++ b/app/test/test.h @@ -177,8 +177,7 @@ void add_test_command(struct test_command *t); .command =3D RTE_STR(cmd), \ .callback =3D func, \ }; \ - static void __attribute__((constructor, used)) \ - test_register_##cmd(void) \ + RTE_INIT(test_register_##cmd) \ { \ add_test_command(&test_struct_##cmd); \ } diff --git a/lib/librte_mempool/rte_mempool.h b/lib/librte_mempool/rte_memp= ool.h index 7c9cd9a2f..fd19470d7 100644 --- a/lib/librte_mempool/rte_mempool.h +++ b/lib/librte_mempool/rte_mempool.h @@ -832,10 +832,9 @@ int rte_mempool_register_ops(const struct rte_mempool_= ops *ops); * Note that the rte_mempool_register_ops fails silently here when * more than RTE_MEMPOOL_MAX_OPS_IDX is registered. */ -#define MEMPOOL_REGISTER_OPS(ops) \ - void mp_hdlr_init_##ops(void); \ - void __attribute__((constructor, used)) mp_hdlr_init_##ops(void)\ - { \ +#define MEMPOOL_REGISTER_OPS(ops) \ + RTE_INIT(mp_hdlr_init_##ops) \ + { \ rte_mempool_register_ops(&ops); \ } =20 --=20 2.21.0