From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pg0-f67.google.com (mail-pg0-f67.google.com [74.125.83.67]) by dpdk.org (Postfix) with ESMTP id 807303777 for ; Wed, 22 Mar 2017 03:26:50 +0100 (CET) Received: by mail-pg0-f67.google.com with SMTP id 81so19972736pgh.3 for ; Tue, 21 Mar 2017 19:26:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id; bh=3EuYYCQCCsF9dcXKVDEyGUWAtAg1lv/NmVf+0E7Uumg=; b=NS4i0ylV1tf601+jQEkF4VNZsaIlPxtL9cJf5DVQFDAZa85QNd/sZ15EpK0KtxFTqr 2D9wJuRgT+kvBCPoy1FwqAPZnAjsQku15dag069/Q3uDMy/KD5m+RyHk4rTSHxFNsgrJ HwzYPLT0hKsOPbY04eMgL00hiLy9uU9g1z070m0jiFViw0kNaMSL/dkCM7UrHVG7zoCJ vs1HvVfOBCGD05u5ytThMkyc5BXHA+XAAsOeCC+2aSN4nbzv2G1yLFkHUEXRtOhJjU2F hHik/Jg9S52FnZ8o7Vg0l1aZdeyxbWyBeYw1T/fEhYxH/W6AMHwYpCOkWpQF0J9Mez2X OMTg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=3EuYYCQCCsF9dcXKVDEyGUWAtAg1lv/NmVf+0E7Uumg=; b=anZEyuIssghRkKA388K4C7uLOo5J7CpLdvgGU7Kx2Q0u9xQbPOfo8V5op4VbQl9yMm eocROPJ5Og+IG6pSx2HQ6sPy2GYgiWUyQ2vrEg/1y2TNSQxZsW8ZtYfXzcQvY+LHq/cN s8ZMcUkiMLNlncutgQOXNz+msKDaw9eOPdu+aike79z8JJAop4gdmq4U4Y78UUwUmXBg BujwsLKhQl3GhAVaSHygNwf9wDcZJT2bS0jLQSd/IxBYEFAQ44mxZbpT2NNXyGXULhBh pHQfNX4N+wktTHFUp7bvNfwRdzS2czztpiBgv1lEqGAZobfjiVY6prA3TTYS6+sHIZfB baMQ== X-Gm-Message-State: AFeK/H0g6Gs1MITbLFzF0HGPnNZfaQoR22D0314bi+zO3DJClKOgQScZ7PxV5bx5YkW2pA== X-Received: by 10.84.229.137 with SMTP id c9mr52317381plk.41.1490149609562; Tue, 21 Mar 2017 19:26:49 -0700 (PDT) Received: from localhost.localdomain (27-140-235-100.wx2.zaq.ne.jp. [27.140.235.100]) by smtp.gmail.com with ESMTPSA id l28sm15325853pgc.11.2017.03.21.19.26.47 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 21 Mar 2017 19:26:48 -0700 (PDT) From: Hiroki SHIROKURA To: dev@dpdk.org Cc: Hiroki SHIROKURA Date: Wed, 22 Mar 2017 11:26:23 +0900 Message-Id: <1490149583-32371-1-git-send-email-slank.dev@gmail.com> X-Mailer: git-send-email 2.7.4 Subject: [dpdk-dev] [PATCH v2] example/performance-thread: lthread support C++ 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: Wed, 22 Mar 2017 02:26:50 -0000 Lthread is awesome but it doesn't support C++. So I write patch to support lthread to support C++. Added "extern C {}" to lthread-headers Signed-off-by: Hiroki SHIROKURA Acked-by: Keith Wiles --- examples/performance-thread/common/arch/x86/ctx.h | 8 ++++++++ examples/performance-thread/common/lthread.h | 8 ++++++++ examples/performance-thread/common/lthread_api.h | 8 ++++++++ examples/performance-thread/common/lthread_cond.h | 8 ++++++++ examples/performance-thread/common/lthread_diag.h | 9 +++++++++ examples/performance-thread/common/lthread_diag_api.h | 8 ++++++++ examples/performance-thread/common/lthread_int.h | 8 ++++++++ examples/performance-thread/common/lthread_mutex.h | 8 ++++++++ examples/performance-thread/common/lthread_objcache.h | 7 +++++++ examples/performance-thread/common/lthread_pool.h | 7 +++++++ examples/performance-thread/common/lthread_queue.h | 7 +++++++ examples/performance-thread/common/lthread_sched.h | 7 +++++++ examples/performance-thread/common/lthread_timer.h | 7 +++++++ examples/performance-thread/common/lthread_tls.h | 7 +++++++ 14 files changed, 107 insertions(+) diff --git a/examples/performance-thread/common/arch/x86/ctx.h b/examples/performance-thread/common/arch/x86/ctx.h index 0386050..a41ce05 100644 --- a/examples/performance-thread/common/arch/x86/ctx.h +++ b/examples/performance-thread/common/arch/x86/ctx.h @@ -35,6 +35,10 @@ #ifndef CTX_H #define CTX_H +#ifdef __cplusplus +extern "C" { +#endif + /* * CPU context registers */ @@ -54,4 +58,8 @@ void ctx_switch(struct ctx *new_ctx, struct ctx *curr_ctx); +#ifdef __cplusplus +} +#endif + #endif /* RTE_CTX_H_ */ diff --git a/examples/performance-thread/common/lthread.h b/examples/performance-thread/common/lthread.h index 8c77af8..5c2c1a5 100644 --- a/examples/performance-thread/common/lthread.h +++ b/examples/performance-thread/common/lthread.h @@ -62,6 +62,10 @@ #ifndef LTHREAD_H_ #define LTHREAD_H_ +#ifdef __cplusplus +extern "C" { +#endif + #include #include "lthread_api.h" @@ -96,4 +100,8 @@ _lthread_init(struct lthread *lt, void _lthread_set_stack(struct lthread *lt, void *stack, size_t stack_size); +#ifdef __cplusplus +} +#endif + #endif /* LTHREAD_H_ */ diff --git a/examples/performance-thread/common/lthread_api.h b/examples/performance-thread/common/lthread_api.h index ec97610..ff245a0 100644 --- a/examples/performance-thread/common/lthread_api.h +++ b/examples/performance-thread/common/lthread_api.h @@ -124,6 +124,10 @@ #ifndef LTHREAD_H #define LTHREAD_H +#ifdef __cplusplus +extern "C" { +#endif + #include #include #include @@ -829,4 +833,8 @@ int lthread_cond_signal(struct lthread_cond *c); */ int lthread_cond_broadcast(struct lthread_cond *c); +#ifdef __cplusplus +} +#endif + #endif /* LTHREAD_H */ diff --git a/examples/performance-thread/common/lthread_cond.h b/examples/performance-thread/common/lthread_cond.h index 5bd02a7..5e5f14b 100644 --- a/examples/performance-thread/common/lthread_cond.h +++ b/examples/performance-thread/common/lthread_cond.h @@ -62,6 +62,10 @@ #ifndef LTHREAD_COND_H_ #define LTHREAD_COND_H_ +#ifdef __cplusplus +extern "C" { +#endif + #include "lthread_queue.h" #define MAX_COND_NAME_SIZE 64 @@ -74,4 +78,8 @@ struct lthread_cond { uint64_t diag_ref; /* optional ref to user diag data */ } __rte_cache_aligned; +#ifdef __cplusplus +} +#endif + #endif /* LTHREAD_COND_H_ */ diff --git a/examples/performance-thread/common/lthread_diag.h b/examples/performance-thread/common/lthread_diag.h index 2877d31..3dce8e0 100644 --- a/examples/performance-thread/common/lthread_diag.h +++ b/examples/performance-thread/common/lthread_diag.h @@ -34,6 +34,10 @@ #ifndef LTHREAD_DIAG_H_ #define LTHREAD_DIAG_H_ +#ifdef __cplusplus +extern "C" { +#endif + #include #include @@ -129,4 +133,9 @@ extern uint64_t diag_mask; #define DIAG_USED __rte_unused #endif /* LTHREAD_DIAG */ + +#ifdef __cplusplus +} +#endif + #endif /* LTHREAD_DIAG_H_ */ diff --git a/examples/performance-thread/common/lthread_diag_api.h b/examples/performance-thread/common/lthread_diag_api.h index 7ee514f..2fda095 100644 --- a/examples/performance-thread/common/lthread_diag_api.h +++ b/examples/performance-thread/common/lthread_diag_api.h @@ -33,6 +33,10 @@ #ifndef LTHREAD_DIAG_API_H_ #define LTHREAD_DIAG_API_H_ +#ifdef __cplusplus +extern "C" { +#endif + #include #include @@ -322,4 +326,8 @@ lthread_cond_diag_ref(struct lthread_cond *c); uint64_t lthread_mutex_diag_ref(struct lthread_mutex *m); +#ifdef __cplusplus +} +#endif + #endif /* LTHREAD_DIAG_API_H_ */ diff --git a/examples/performance-thread/common/lthread_int.h b/examples/performance-thread/common/lthread_int.h index 031d8af..3f7fb92 100644 --- a/examples/performance-thread/common/lthread_int.h +++ b/examples/performance-thread/common/lthread_int.h @@ -62,6 +62,10 @@ #include #define LTHREAD_INT_H +#ifdef __cplusplus +extern "C" { +#endif + #include #include #include @@ -197,4 +201,8 @@ struct lthread { uint64_t diag_ref; /* ref to user diag data */ } __rte_cache_aligned; +#ifdef __cplusplus +} +#endif + #endif /* LTHREAD_INT_H */ diff --git a/examples/performance-thread/common/lthread_mutex.h b/examples/performance-thread/common/lthread_mutex.h index 4d30b2e..e78db91 100644 --- a/examples/performance-thread/common/lthread_mutex.h +++ b/examples/performance-thread/common/lthread_mutex.h @@ -35,6 +35,10 @@ #ifndef LTHREAD_MUTEX_H_ #define LTHREAD_MUTEX_H_ +#ifdef __cplusplus +extern "C" { +#endif + #include "lthread_queue.h" @@ -49,4 +53,8 @@ struct lthread_mutex { uint64_t diag_ref; /* optional ref to user diag data */ } __rte_cache_aligned; +#ifdef __cplusplus +} +#endif + #endif /* LTHREAD_MUTEX_H_ */ diff --git a/examples/performance-thread/common/lthread_objcache.h b/examples/performance-thread/common/lthread_objcache.h index d7e3582..6e5195b 100644 --- a/examples/performance-thread/common/lthread_objcache.h +++ b/examples/performance-thread/common/lthread_objcache.h @@ -33,6 +33,10 @@ #ifndef LTHREAD_OBJCACHE_H_ #define LTHREAD_OBJCACHE_H_ +#ifdef __cplusplus +extern "C" { +#endif + #include #include @@ -154,5 +158,8 @@ _lthread_objcache_free(struct lthread_objcache *c, void *obj) } +#ifdef __cplusplus +} +#endif #endif /* LTHREAD_OBJCACHE_H_ */ diff --git a/examples/performance-thread/common/lthread_pool.h b/examples/performance-thread/common/lthread_pool.h index 27680ea..fb0c578 100644 --- a/examples/performance-thread/common/lthread_pool.h +++ b/examples/performance-thread/common/lthread_pool.h @@ -69,6 +69,10 @@ #ifndef LTHREAD_POOL_H_ #define LTHREAD_POOL_H_ +#ifdef __cplusplus +extern "C" { +#endif + #include #include #include @@ -328,5 +332,8 @@ _qnode_pool_destroy(struct qnode_pool *p) return 0; } +#ifdef __cplusplus +} +#endif #endif /* LTHREAD_POOL_H_ */ diff --git a/examples/performance-thread/common/lthread_queue.h b/examples/performance-thread/common/lthread_queue.h index 2c55fce..4fc2074 100644 --- a/examples/performance-thread/common/lthread_queue.h +++ b/examples/performance-thread/common/lthread_queue.h @@ -69,6 +69,10 @@ #ifndef LTHREAD_QUEUE_H_ #define LTHREAD_QUEUE_H_ +#ifdef __cplusplus +extern "C" { +#endif + #include #include @@ -298,5 +302,8 @@ _lthread_queue_remove(struct lthread_queue *q) return NULL; } +#ifdef __cplusplus +} +#endif #endif /* LTHREAD_QUEUE_H_ */ diff --git a/examples/performance-thread/common/lthread_sched.h b/examples/performance-thread/common/lthread_sched.h index 4ce56c2..7cddda9 100644 --- a/examples/performance-thread/common/lthread_sched.h +++ b/examples/performance-thread/common/lthread_sched.h @@ -62,6 +62,10 @@ #ifndef LTHREAD_SCHED_H_ #define LTHREAD_SCHED_H_ +#ifdef __cplusplus +extern "C" { +#endif + #include "lthread_int.h" #include "lthread_queue.h" #include "lthread_objcache.h" @@ -148,5 +152,8 @@ extern struct lthread_sched *schedcore[]; void _sched_timer_cb(struct rte_timer *tim, void *arg); void _sched_shutdown(__rte_unused void *arg); +#ifdef __cplusplus +} +#endif #endif /* LTHREAD_SCHED_H_ */ diff --git a/examples/performance-thread/common/lthread_timer.h b/examples/performance-thread/common/lthread_timer.h index b5e6fb0..b044b90 100644 --- a/examples/performance-thread/common/lthread_timer.h +++ b/examples/performance-thread/common/lthread_timer.h @@ -35,6 +35,10 @@ #ifndef LTHREAD_TIMER_H_ #define LTHREAD_TIMER_H_ +#ifdef __cplusplus +extern "C" { +#endif + #include "lthread_int.h" #include "lthread_sched.h" @@ -75,5 +79,8 @@ _timer_stop(struct lthread *lt) } } +#ifdef __cplusplus +} +#endif #endif /* LTHREAD_TIMER_H_ */ diff --git a/examples/performance-thread/common/lthread_tls.h b/examples/performance-thread/common/lthread_tls.h index 86cbfad..fff3c0d 100644 --- a/examples/performance-thread/common/lthread_tls.h +++ b/examples/performance-thread/common/lthread_tls.h @@ -34,6 +34,10 @@ #ifndef LTHREAD_TLS_H_ #define LTHREAD_TLS_H_ +#ifdef __cplusplus +extern "C" { +#endif + #include "lthread_api.h" #define RTE_PER_LTHREAD_SECTION_SIZE \ @@ -53,5 +57,8 @@ void _lthread_tls_destroy(struct lthread *lt); void _lthread_key_pool_init(void); void _lthread_tls_alloc(struct lthread *lt); +#ifdef __cplusplus +} +#endif #endif /* LTHREAD_TLS_H_ */ -- 2.7.4