From patchwork Thu Sep 11 19:35:05 2008 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yuji Mano X-Patchwork-Id: 247 X-Patchwork-Delegate: yuji.mano@am.sony.com Return-Path: X-Original-To: patchwork@ozlabs.org Delivered-To: patchwork@ozlabs.org Received: from ozlabs.org (localhost [127.0.0.1]) by ozlabs.org (Postfix) with ESMTP id C9D95DEABD for ; Fri, 12 Sep 2008 06:39:40 +1000 (EST) X-Original-To: cbe-oss-dev@ozlabs.org Delivered-To: cbe-oss-dev@ozlabs.org Received: from IE1EHSOBE006.bigfish.com (outbound-dub.frontbridge.com [213.199.154.16]) by ozlabs.org (Postfix) with ESMTP id 2D3BFDE337 for ; Fri, 12 Sep 2008 06:37:23 +1000 (EST) Received: from mail122-dub-R.bigfish.com (10.5.252.3) by IE1EHSOBE006.bigfish.com (10.5.252.26) with Microsoft SMTP Server id 8.1.291.1; Thu, 11 Sep 2008 20:37:17 +0000 Received: from mail122-dub (localhost.localdomain [127.0.0.1]) by mail122-dub-R.bigfish.com (Postfix) with ESMTP id 5CEA41648182 for ; Thu, 11 Sep 2008 20:37:17 +0000 (UTC) X-BigFish: VS11(zzzz10c0j10d3izz1497iz2dh6bh68o) X-Spam-TCS-SCL: 7:0 Received: by mail122-dub (MessageSwitch) id 1221165432577971_8367; Thu, 11 Sep 2008 20:37:12 +0000 (UCT) Received: from mail8.fw-bc.sony.com (mail8.fw-bc.sony.com [160.33.98.75]) by mail122-dub.bigfish.com (Postfix) with ESMTP id B6E5E1578051 for ; Thu, 11 Sep 2008 20:37:11 +0000 (UTC) Received: from mail3.sjc.in.sel.sony.com (mail3.sjc.in.sel.sony.com [43.134.1.211]) by mail8.fw-bc.sony.com (8.14.2/8.14.2) with ESMTP id m8BKbA3r025094 for ; Thu, 11 Sep 2008 20:37:11 GMT Received: from USSDIXIM02.am.sony.com (ussdixim02.am.sony.com [43.130.140.34]) by mail3.sjc.in.sel.sony.com (8.12.11/8.12.11) with ESMTP id m8BKbAl0021770 for ; Thu, 11 Sep 2008 20:37:10 GMT Received: from ussdixms03.am.sony.com ([43.130.140.23]) by USSDIXIM02.am.sony.com with Microsoft SMTPSVC(5.0.2195.6713); Thu, 11 Sep 2008 13:37:10 -0700 Received: from [43.135.148.175] ([43.135.148.175]) by ussdixms03.am.sony.com with Microsoft SMTPSVC(5.0.2195.6713); Thu, 11 Sep 2008 13:37:09 -0700 Message-ID: <48C972E9.1000507@am.sony.com> Date: Thu, 11 Sep 2008 12:35:05 -0700 From: Yuji Mano User-Agent: Thunderbird 2.0.0.5 (X11/20070719) MIME-Version: 1.0 To: CBE Development X-Enigmail-Version: 0.95.7 X-OriginalArrivalTime: 11 Sep 2008 20:37:09.0835 (UTC) FILETIME=[29D131B0:01C9144E] X-SEL-encryption-scan: scanned Subject: [Cbe-oss-dev] [PATCH 09/11]MARS: Header files cleanup X-BeenThere: cbe-oss-dev@ozlabs.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: Discussion about Open Source Software for the Cell Broadband Engine List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: cbe-oss-dev-bounces+patchwork=ozlabs.org@ozlabs.org Errors-To: cbe-oss-dev-bounces+patchwork=ozlabs.org@ozlabs.org From: Geoff Levand Cleanup header files: o Adjust scope of C linkage specifiers. o Remove unneeded C linkage specifiers. o Use system include path for installed headers. Signed-off-by: Geoff Levand Acked-by: Kazunori Asayama --- a/include/common/mars/mars_debug.h +++ b/include/common/mars/mars_debug.h @@ -42,10 +42,6 @@ * \brief MARS Debug Macros */ -#if defined(__cplusplus) -extern "C" { -#endif - #include #define MARS_DEBUG_ENABLE_PRINT 0 @@ -296,8 +292,4 @@ extern "C" { #define MARS_TIMER_STOP(id) #endif -#if defined(__cplusplus) -} -#endif - #endif --- a/include/common/mars/mars_error.h +++ b/include/common/mars/mars_error.h @@ -43,10 +43,6 @@ * \brief MARS Error Values */ -#if defined(__cplusplus) -extern "C" { -#endif - /** * \brief MARS error values * @@ -68,8 +64,4 @@ enum { MARS_ERROR_BUSY /**< operation returned due to being busy */ }; -#if defined(__cplusplus) -} -#endif - #endif --- a/include/common/mars/mars_kernel_types.h +++ b/include/common/mars/mars_kernel_types.h @@ -38,10 +38,6 @@ #ifndef MARS_KERNEL_TYPES_H #define MARS_KERNEL_TYPES_H -#if defined(__cplusplus) -extern "C" { -#endif - #include #define MARS_KERNEL_PARAMS_ALIGN 128 @@ -53,8 +49,4 @@ struct mars_kernel_params { uint64_t workload_queue_ea; } __attribute__((aligned(MARS_KERNEL_PARAMS_ALIGN))); -#if defined(__cplusplus) -} -#endif - #endif --- a/include/common/mars/mars_mutex_types.h +++ b/include/common/mars/mars_mutex_types.h @@ -44,10 +44,6 @@ * \brief MARS Mutex Types */ -#if defined(__cplusplus) -extern "C" { -#endif - #include /** @@ -95,8 +91,4 @@ struct mars_mutex { uint8_t pad[124]; } __attribute__((aligned(MARS_MUTEX_ALIGN))); -#if defined(__cplusplus) -} -#endif - #endif --- a/include/common/mars/mars_task_barrier_types.h +++ b/include/common/mars/mars_task_barrier_types.h @@ -44,10 +44,6 @@ * \brief MARS Task Barrier Types */ -#if defined(__cplusplus) -extern "C" { -#endif - #include /** @@ -97,8 +93,4 @@ struct mars_task_barrier { uint64_t mars_context_ea; } __attribute__((aligned(MARS_TASK_BARRIER_ALIGN))); -#if defined(__cplusplus) -} -#endif - #endif --- a/include/common/mars/mars_task_event_flag_types.h +++ b/include/common/mars/mars_task_event_flag_types.h @@ -44,10 +44,6 @@ * \brief MARS Task Event Flag Types */ -#if defined(__cplusplus) -extern "C" { -#endif - #include /** @@ -139,8 +135,4 @@ struct mars_task_event_flag { uint64_t mars_context_ea; } __attribute__((aligned(MARS_TASK_EVENT_FLAG_ALIGN))); -#if defined(__cplusplus) -} -#endif - #endif --- a/include/common/mars/mars_task_queue_types.h +++ b/include/common/mars/mars_task_queue_types.h @@ -44,10 +44,6 @@ * \brief MARS Task Queue Types */ -#if defined(__cplusplus) -extern "C" { -#endif - #include /** @@ -156,8 +152,4 @@ struct mars_task_queue { uint64_t mars_context_ea; } __attribute__((aligned(MARS_TASK_QUEUE_ALIGN))); -#if defined(__cplusplus) -} -#endif - #endif --- a/include/common/mars/mars_task_semaphore_types.h +++ b/include/common/mars/mars_task_semaphore_types.h @@ -44,10 +44,6 @@ * \brief MARS Task Semaphore Types */ -#if defined(__cplusplus) -extern "C" { -#endif - #include /** @@ -93,8 +89,4 @@ struct mars_task_semaphore { uint64_t mars_context_ea; } __attribute__((aligned(MARS_TASK_SEMAPHORE_ALIGN))); -#if defined(__cplusplus) -} -#endif - #endif --- a/include/common/mars/mars_task_types.h +++ b/include/common/mars/mars_task_types.h @@ -44,10 +44,6 @@ * \brief MARS Task Types */ -#if defined(__cplusplus) -extern "C" { -#endif - #include /** @@ -166,8 +162,4 @@ struct mars_task_context { uint8_t pad[20]; /* padding */ } __attribute__((aligned(MARS_TASK_CONTEXT_ALIGN))); -#if defined(__cplusplus) -} -#endif - #endif --- a/include/common/mars/mars_workload_types.h +++ b/include/common/mars/mars_workload_types.h @@ -38,10 +38,6 @@ #ifndef MARS_WORKLOAD_TYPES_H #define MARS_WORKLOAD_TYPES_H -#if defined(__cplusplus) -extern "C" { -#endif - #include #define MARS_WORKLOAD_ID_NONE 0xffff /* workload id none */ @@ -147,8 +143,4 @@ struct mars_workload_queue { struct mars_workload_context context[MARS_WORKLOAD_MAX]; } __attribute__((aligned(MARS_WORKLOAD_QUEUE_ALIGN))); -#if defined(__cplusplus) -} -#endif - #endif --- a/include/host/mars/mars.h +++ b/include/host/mars/mars.h @@ -44,9 +44,9 @@ * \brief [host] MARS API */ -#include "mars/mars_context.h" -#include "mars/mars_error.h" -#include "mars/mars_mutex.h" -#include "mars/mars_task.h" +#include +#include +#include +#include #endif --- a/include/host/mars/mars_mutex.h +++ b/include/host/mars/mars_mutex.h @@ -44,12 +44,12 @@ * \brief [host] MARS Mutex API */ +#include + #if defined(__cplusplus) extern "C" { #endif -#include "mars/mars_mutex_types.h" - /** * \ingroup group_mars_mutex * \brief [host] Initializes a mutex. --- a/include/host/mars/mars_task.h +++ b/include/host/mars/mars_task.h @@ -44,18 +44,18 @@ * \brief [host] MARS Task API */ +#include +#include +#include +#include +#include +#include + + #if defined(__cplusplus) extern "C" { #endif -#include "mars/mars_task_barrier.h" -#include "mars/mars_task_event_flag.h" -#include "mars/mars_task_queue.h" -#include "mars/mars_task_semaphore.h" -#include "mars/mars_task_signal.h" -#include "mars/mars_task_types.h" - - /** * \ingroup group_mars_task * \brief [host] Initializes a MARS task. --- a/include/host/mars/mars_task_barrier.h +++ b/include/host/mars/mars_task_barrier.h @@ -44,14 +44,14 @@ * \brief [host] MARS Task Barrier API */ +#include + +struct mars_context; + #if defined(__cplusplus) extern "C" { #endif -#include "mars/mars_task_barrier_types.h" - -struct mars_context; - /** * \ingroup group_mars_task_barrier * \brief [host] Initializes a task barrier. --- a/include/host/mars/mars_task_event_flag.h +++ b/include/host/mars/mars_task_event_flag.h @@ -44,14 +44,14 @@ * \brief [host] MARS Task Event Flag API */ +#include + +struct mars_context; + #if defined(__cplusplus) extern "C" { #endif -#include "mars/mars_task_event_flag_types.h" - -struct mars_context; - /** * \ingroup group_mars_task_event_flag * \brief [host] Initializes a task event flag. --- a/include/host/mars/mars_task_queue.h +++ b/include/host/mars/mars_task_queue.h @@ -44,14 +44,14 @@ * \brief [host] MARS Task Queue Flag API */ +#include + +struct mars_context; + #if defined(__cplusplus) extern "C" { #endif -#include "mars/mars_task_queue_types.h" - -struct mars_context; - /** * \ingroup group_mars_task_queue * \brief [host] Initializes a task queue. --- a/include/host/mars/mars_task_semaphore.h +++ b/include/host/mars/mars_task_semaphore.h @@ -44,14 +44,14 @@ * \brief [host] MARS Task Semaphore API */ +#include + +struct mars_context; + #if defined(__cplusplus) extern "C" { #endif -#include "mars/mars_task_semaphore_types.h" - -struct mars_context; - /** * \ingroup group_mars_task_semaphore * \brief [host] Initializes a task semaphore. --- a/include/host/mars/mars_task_signal.h +++ b/include/host/mars/mars_task_signal.h @@ -44,12 +44,12 @@ * \brief [host] MARS Task Signal API */ +#include + #if defined(__cplusplus) extern "C" { #endif -#include "mars/mars_task_types.h" - /** * \ingroup group_mars_task_signal * \brief [host] Sends a signal to the specified task. --- a/include/host/mars/mars_timer.h +++ b/include/host/mars/mars_timer.h @@ -43,10 +43,6 @@ * \brief [host] MARS Timer API */ -#if defined(__cplusplus) -extern "C" { -#endif - #include #include "mars/mars_debug.h" @@ -69,6 +65,10 @@ struct mars_timer { unsigned long long end; /**< internal - stop time */ }; +#if defined(__cplusplus) +extern "C" { +#endif + /* * \ingroup group_mars_timer * \brief Starts the timer --- a/include/host/mars/mars_workload_queue.h +++ b/include/host/mars/mars_workload_queue.h @@ -38,12 +38,12 @@ #ifndef MARS_WORKLOAD_QUEUE_H #define MARS_WORKLOAD_QUEUE_H +#include "mars/mars_workload_types.h" + #if defined(__cplusplus) extern "C" { #endif -#include "mars/mars_workload_types.h" - int workload_queue_initialize(struct mars_workload_queue *queue); int workload_queue_finalize(struct mars_workload_queue *queue); int workload_queue_exit(struct mars_workload_queue *queue); --- a/include/mpu/mars/mars.h +++ b/include/mpu/mars/mars.h @@ -44,16 +44,8 @@ * \brief [MPU] MARS API */ -#if defined(__cplusplus) -extern "C" { -#endif - -#include "mars/mars_error.h" -#include "mars/mars_mutex.h" -#include "mars/mars_task.h" - -#if defined(__cplusplus) -} -#endif +#include +#include +#include #endif --- a/include/mpu/mars/mars_dma.h +++ b/include/mpu/mars/mars_dma.h @@ -44,10 +44,6 @@ * \brief [MPU] MARS DMA API */ -#if defined(__cplusplus) -extern "C" { -#endif - #include #include "mars/mars_debug.h" @@ -57,6 +53,10 @@ extern "C" { #define MARS_DMA_SIZE_MASK 0xf /* dma 16 byte size mask */ #define MARS_DMA_SIZE_MAX 16384 /* dma single tranfer size max 16KB */ +#if defined(__cplusplus) +extern "C" { +#endif + /* size max 16 KB */ static inline unsigned int _list_init(mfc_list_element_t *list, unsigned int size, unsigned int eal) --- a/include/mpu/mars/mars_kernel.h +++ b/include/mpu/mars/mars_kernel.h @@ -38,10 +38,6 @@ #ifndef MARS_KERNEL_H #define MARS_KERNEL_H -#if defined(__cplusplus) -extern "C" { -#endif - #include #include "mars/mars_dma.h" @@ -78,6 +74,11 @@ struct mars_kernel_syscalls { }; typedef void (*mars_entry)(void *workload_args, void *kernel_syscalls); + +#if defined(__cplusplus) +extern "C" { +#endif + void mars_reentry(void); /* kernel scheduler function */ --- a/include/mpu/mars/mars_mutex.h +++ b/include/mpu/mars/mars_mutex.h @@ -44,12 +44,12 @@ * \brief [MPU] MARS Mutex API */ +#include + #if defined(__cplusplus) extern "C" { #endif -#include "mars/mars_mutex_types.h" - /** * \ingroup group_mars_mutex * \brief [MPU] Initializes a mutex. --- a/include/mpu/mars/mars_syscalls.h +++ b/include/mpu/mars/mars_syscalls.h @@ -38,12 +38,12 @@ #ifndef MARS_SYSCALLS_H #define MARS_SYSCALLS_H +#include + #if defined(__cplusplus) extern "C" { #endif -#include - uint64_t mars_get_mars_context_ea(void); uint32_t mars_get_kernel_id(void); uint16_t mars_get_workload_id(void); --- a/include/mpu/mars/mars_task.h +++ b/include/mpu/mars/mars_task.h @@ -44,17 +44,17 @@ * \brief [MPU] MARS Task API */ +#include +#include +#include +#include +#include +#include + #if defined(__cplusplus) extern "C" { #endif -#include "mars/mars_task_barrier.h" -#include "mars/mars_task_event_flag.h" -#include "mars/mars_task_queue.h" -#include "mars/mars_task_semaphore.h" -#include "mars/mars_task_signal.h" -#include "mars/mars_task_types.h" - /** * \ingroup group_mars_task * \brief [MPU] Entry point for task. --- a/include/mpu/mars/mars_task_barrier.h +++ b/include/mpu/mars/mars_task_barrier.h @@ -44,12 +44,12 @@ * \brief [MPU] MARS Task Barrier API */ +#include + #if defined(__cplusplus) extern "C" { #endif -#include "mars/mars_task_barrier_types.h" - /** * \ingroup group_mars_task_barrier * \brief [MPU] Initializes a task barrier. --- a/include/mpu/mars/mars_task_event_flag.h +++ b/include/mpu/mars/mars_task_event_flag.h @@ -44,12 +44,12 @@ * \brief [MPU] MARS Task Event Flag API */ +#include + #if defined(__cplusplus) extern "C" { #endif -#include "mars/mars_task_event_flag_types.h" - /** * \ingroup group_mars_task_event_flag * \brief [MPU] Initializes a task event flag. --- a/include/mpu/mars/mars_task_queue.h +++ b/include/mpu/mars/mars_task_queue.h @@ -44,12 +44,12 @@ * \brief [MPU] MARS Task Queue API */ +#include + #if defined(__cplusplus) extern "C" { #endif -#include "mars/mars_task_queue_types.h" - /** * \ingroup group_mars_task_queue * \brief [MPU] Initializes a task queue. --- a/include/mpu/mars/mars_task_semaphore.h +++ b/include/mpu/mars/mars_task_semaphore.h @@ -44,12 +44,12 @@ * \brief [MPU] MARS Task Semaphore API */ +#include + #if defined(__cplusplus) extern "C" { #endif -#include "mars/mars_task_semaphore_types.h" - /** * \ingroup group_mars_task_semaphore * \brief [MPU] Initializes a task semaphore. --- a/include/mpu/mars/mars_task_signal.h +++ b/include/mpu/mars/mars_task_signal.h @@ -44,12 +44,12 @@ * \brief [MPU] MARS Task Signal API */ +#include + #if defined(__cplusplus) extern "C" { #endif -#include "mars/mars_task_types.h" - /** * \ingroup group_mars_task_signal * \brief [MPU] Sends a signal to the specified task. --- a/include/mpu/mars/mars_timer.h +++ b/include/mpu/mars/mars_timer.h @@ -43,15 +43,9 @@ * \brief MARS Timer API [MPU] */ -#if defined(__cplusplus) -extern "C" { -#endif - #include #include "mars/mars_debug.h" -static const unsigned int mars_timebase = 79800000; - /* * \ingroup group_mars_timer * \brief MARS timer structure @@ -71,6 +65,12 @@ struct mars_timer { unsigned int end; /**< internal - stop time */ }; +#if defined(__cplusplus) +extern "C" { +#endif + +static const unsigned int mars_timebase = 79800000; + /* * \ingroup group_mars_timer * \brief Starts the timer @@ -116,4 +116,8 @@ static inline void mars_timer_stop(struc timer->us = timer->s * 1.0e6; } +#if defined(__cplusplus) +} +#endif + #endif