DPDK patches and discussions
 help / color / mirror / Atom feed
From: Jerin Jacob Kollanukkaran <jerinj@marvell.com>
Cc: "dev@dpdk.org" <dev@dpdk.org>,
	"thomas@monjalon.net" <thomas@monjalon.net>,
	Jerin Jacob Kollanukkaran <jerinj@marvell.com>
Subject: [dpdk-dev] [PATCH v2] eal: change init macro as exec environment specific
Date: Wed, 3 Apr 2019 19:28:40 +0000	[thread overview]
Message-ID: <20190403192819.20243-1-jerinj@marvell.com> (raw)
Message-ID: <20190403192840.clljdcaA6GdGm0giYKmJSmKPIJf9yvbzK3sl_c3tXmw@z> (raw)
In-Reply-To: <20170807120408.21975-1-jerin.jacob@caviumnetworks.com>

From: Jerin Jacob <jerinj@marvell.com>

baremetal execution environments may have a different
method to enable RTE_INIT instead of using compiler
constructor and/or OS specific linker scheme.
Allow an option to override RTE_INIT* macros using
rte_os.h or appropriate header file.

Signed-off-by: Jerin Jacob <jerinj@marvell.com>
---

v2:
- Leverage the rte_os.h created by Windows port to override RTE_INIT* macro if needed.
- Removed the exec environment specific librte_eal/<OS>/eal/include/exec-env/rte_exec-env.h
file creation
- Removed the duplication of RTE_INIT_* definition on each rte_exec-env.h file
as it is common for Linux,FreeBSD and Windows port

---
 lib/librte_eal/common/include/rte_common.h | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/lib/librte_eal/common/include/rte_common.h b/lib/librte_eal/common/include/rte_common.h
index 1d3c33021..f2691b4e1 100644
--- a/lib/librte_eal/common/include/rte_common.h
+++ b/lib/librte_eal/common/include/rte_common.h
@@ -106,8 +106,10 @@ typedef uint16_t unaligned_uint16_t;
  *   Priority number must be above 100.
  *   Lowest number is the first to run.
  */
+#ifndef RTE_INIT_PRIO /* Allow to override from eal */
 #define RTE_INIT_PRIO(func, prio) \
 static void __attribute__((constructor(RTE_PRIO(prio)), used)) func(void)
+#endif
 
 /**
  * Run function before main() with low priority.
@@ -129,8 +131,10 @@ static void __attribute__((constructor(RTE_PRIO(prio)), used)) func(void)
  *   Priority number must be above 100.
  *   Lowest number is the last to run.
  */
+#ifndef RTE_FINI_PRIO /* Allow to override from eal */
 #define RTE_FINI_PRIO(func, prio) \
 static void __attribute__((destructor(RTE_PRIO(prio)), used)) func(void)
+#endif
 
 /**
  * Run after main() with high priority.
-- 
2.21.0


  parent reply	other threads:[~2019-04-03 19:28 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-08-07 12:04 [dpdk-dev] [PATCH] " Jerin Jacob
2017-10-11 13:02 ` Thomas Monjalon
2017-10-11 14:33   ` Jerin Jacob
2019-03-01 17:05     ` Ferruh Yigit
2019-03-01 17:16       ` Ferruh Yigit
2019-03-01 17:28       ` Thomas Monjalon
2019-03-12 19:25         ` [dpdk-dev] [EXT] " Jerin Jacob Kollanukkaran
2019-03-12 20:33           ` Thomas Monjalon
2019-03-13  8:02             ` Jerin Jacob Kollanukkaran
2019-03-13  8:16               ` Thomas Monjalon
2019-03-13  8:44                 ` Jerin Jacob Kollanukkaran
2019-03-14 20:44                   ` Jerin Jacob Kollanukkaran
2019-03-14 20:44                     ` Jerin Jacob Kollanukkaran
2019-04-02  1:15                     ` Jerin Jacob Kollanukkaran
2019-04-02  1:15                       ` Jerin Jacob Kollanukkaran
2019-04-02 12:45                       ` Thomas Monjalon
2019-04-02 12:45                         ` Thomas Monjalon
2019-04-02 12:57     ` [dpdk-dev] " Thomas Monjalon
2019-04-02 12:57       ` Thomas Monjalon
2019-04-02 13:20       ` Wiles, Keith
2019-04-02 13:20         ` Wiles, Keith
2019-04-03 19:28 ` Jerin Jacob Kollanukkaran [this message]
2019-04-03 19:28   ` [dpdk-dev] [PATCH v2] " Jerin Jacob Kollanukkaran
2019-04-03 20:07   ` Thomas Monjalon
2019-04-03 20:07     ` Thomas Monjalon
2019-04-03 21:52     ` Thomas Monjalon
2019-04-03 21:52       ` Thomas Monjalon

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20190403192819.20243-1-jerinj@marvell.com \
    --to=jerinj@marvell.com \
    --cc=dev@dpdk.org \
    --cc=thomas@monjalon.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).