From a2c6c96d13de37908120dcae297530665836f8e8 Mon Sep 17 00:00:00 2001 From: patacongo Date: Wed, 9 Jan 2008 14:20:31 +0000 Subject: Changes for ZNeo compile git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@539 42af7a65-404d-4744-a932-0658087f49c3 --- nuttx/mm/mm_environment.h | 25 ++++++++++++------------ nuttx/mm/mm_sem.c | 50 +++++++++++++++++++++++++---------------------- 2 files changed, 40 insertions(+), 35 deletions(-) (limited to 'nuttx/mm') diff --git a/nuttx/mm/mm_environment.h b/nuttx/mm/mm_environment.h index 973fe533c..b844c2133 100644 --- a/nuttx/mm/mm_environment.h +++ b/nuttx/mm/mm_environment.h @@ -1,7 +1,7 @@ -/************************************************************ +/**************************************************************************** * mm_environment.h * - * Copyright (C) 2007 Gregory Nutt. All rights reserved. + * Copyright (C) 2007, 2008 Gregory Nutt. All rights reserved. * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without @@ -14,7 +14,7 @@ * notice, this list of conditions and the following disclaimer in * the documentation and/or other materials provided with the * distribution. - * 3. Neither the name Gregory Nutt nor the names of its contributors may be + * 3. Neither the name NuttX nor the names of its contributors may be * used to endorse or promote products derived from this software * without specific prior written permission. * @@ -31,14 +31,14 @@ * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. * - ************************************************************/ + ****************************************************************************/ #ifndef __MM_ENVIRONMENT_H #define __MM_ENVIRONMENT_H -/************************************************************ +/**************************************************************************** * Included Files - ************************************************************/ + ****************************************************************************/ /* The platform configuratioin file will not be included * when the memory manager is built for the host-based @@ -61,9 +61,9 @@ # include #endif -/************************************************************ +/**************************************************************************** * Definitions - ************************************************************/ + ****************************************************************************/ /* Special definitions used when the memory mnager is built * for the host-based test harness. @@ -74,6 +74,7 @@ /* Fake NuttX dependencies */ # define FAR /* Normally in compiler.h */ +# define CONFIG_CPP_HAVE_VARARGS 1 /* Normally in compiler.h */ # define CONFIG_MM_REGIONS 2 /* Normally in config.h */ # define CONFIG_CAN_PASS_STRUCTS 1 /* Normally in config.h */ # undef CONFIG_SMALL_MEMORY /* Normally in config.h */ @@ -116,12 +117,12 @@ extern void mm_addregion(FAR void *heapstart, size_t heapsize); # define mm_errno (*get_errno_ptr()) #endif -/************************************************************ +/**************************************************************************** * Public Types - ************************************************************/ + ****************************************************************************/ -/************************************************************ +/**************************************************************************** * Pulblic Function Prototypes - ************************************************************/ + ****************************************************************************/ #endif /* __MM_ENVIRONMENT_H */ diff --git a/nuttx/mm/mm_sem.c b/nuttx/mm/mm_sem.c index 66c667061..74b24af56 100644 --- a/nuttx/mm/mm_sem.c +++ b/nuttx/mm/mm_sem.c @@ -1,7 +1,7 @@ -/************************************************************ +/**************************************************************************** * mm_sem.c * - * Copyright (C) 2007 Gregory Nutt. All rights reserved. + * Copyright (C) 2007, 2008 Gregory Nutt. All rights reserved. * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without @@ -14,7 +14,7 @@ * notice, this list of conditions and the following disclaimer in * the documentation and/or other materials provided with the * distribution. - * 3. Neither the name Gregory Nutt nor the names of its contributors may be + * 3. Neither the name NuttX nor the names of its contributors may be * used to endorse or promote products derived from this software * without specific prior written permission. * @@ -31,11 +31,11 @@ * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. * - ************************************************************/ + ****************************************************************************/ -/************************************************************ +/**************************************************************************** * Included Files - ************************************************************/ + ****************************************************************************/ #include "mm_environment.h" #include @@ -44,9 +44,9 @@ #include #include "mm_internal.h" -/************************************************************ +/**************************************************************************** * Definitions - ************************************************************/ + ****************************************************************************/ /* Define the following to enable semaphore state monitoring */ //#define MONITOR_MM_SEMAPHORE 1 @@ -59,12 +59,16 @@ # define msemdbg printf # endif #else -# define msemdbg(x...) +# ifdef CONFIG_CPP_HAVE_VARARGS +# define msemdbg(x...) +# else +# define msemdbg (void) +# endif #endif -/************************************************************ +/**************************************************************************** * Private Data - ************************************************************/ + ****************************************************************************/ /* Mutually exclusive access to this data set is enforced with * the following (un-named) semaphore. */ @@ -73,17 +77,17 @@ static sem_t g_mm_semaphore; static pid_t g_holder; static int g_counts_held; -/************************************************************ +/**************************************************************************** * Public Functions - ************************************************************/ + ****************************************************************************/ -/************************************************************ +/**************************************************************************** * Name: mm_seminitialize * * Description: * Initialize the MM mutex * - ************************************************************/ + ****************************************************************************/ void mm_seminitialize(void) { @@ -97,7 +101,7 @@ void mm_seminitialize(void) g_counts_held = 0; } -/************************************************************ +/**************************************************************************** * Name: mm_trysemaphore * * Description: @@ -107,7 +111,7 @@ void mm_seminitialize(void) * impossible to wait on a semaphore (e.g., the idle process * when it performs its background memory cleanup). * - ************************************************************/ + ****************************************************************************/ #ifndef MM_TEST int mm_trysemaphore(void) @@ -141,14 +145,14 @@ int mm_trysemaphore(void) } #endif -/************************************************************ +/**************************************************************************** * Name: mm_takesemaphore * * Description: * Take the MM mutex. This is the normal action before all * memory management actions. * - ************************************************************/ + ****************************************************************************/ void mm_takesemaphore(void) { @@ -186,13 +190,13 @@ void mm_takesemaphore(void) g_holder, g_counts_held); } -/************************************************************ +/**************************************************************************** * Name: mm_givesemaphore * * Description: * Release the MM mutex when it is not longer needed. * - ************************************************************/ + ****************************************************************************/ void mm_givesemaphore(void) { @@ -223,14 +227,14 @@ void mm_givesemaphore(void) } } -/************************************************************ +/**************************************************************************** * Name: mm_getsemaphore * * Description: * Return the current value of the MM semaphore (for test * purposes only) * - ************************************************************/ + ****************************************************************************/ #ifdef MM_TEST int mm_getsemaphore(void) -- cgit v1.2.3