////////////////////////////////////////////////////////////////////////////
//
// Copyright (c) 2002 Xilinx, Inc.  All rights reserved.
//
// Xilinx, Inc.
// XILINX IS PROVIDING THIS DESIGN, CODE, OR INFORMATION "AS IS" AS A 
// COURTESY TO YOU.  BY PROVIDING THIS DESIGN, CODE, OR INFORMATION AS
// ONE POSSIBLE   IMPLEMENTATION OF THIS FEATURE, APPLICATION OR 
// STANDARD, XILINX IS MAKING NO REPRESENTATION THAT THIS IMPLEMENTATION
// IS FREE FROM ANY CLAIMS OF INFRINGEMENT, AND YOU ARE RESPONSIBLE 
// FOR OBTAINING ANY RIGHTS YOU MAY REQUIRE FOR YOUR IMPLEMENTATION.  
// XILINX EXPRESSLY DISCLAIMS ANY WARRANTY WHATSOEVER WITH RESPECT TO 
// THE ADEQUACY OF THE IMPLEMENTATION, INCLUDING BUT NOT LIMITED TO 
// ANY WARRANTIES OR REPRESENTATIONS THAT THIS IMPLEMENTATION IS FREE 
// FROM CLAIMS OF INFRINGEMENT, IMPLIED WARRANTIES OF MERCHANTABILITY 
// AND FITNESS FOR A PARTICULAR PURPOSE.
// 
// $Id: config_cparam.h,v 1.1.2.2 2003/03/13 23:21:34 mohan Exp $
//
//////////////////////////////////////////////////////////////////////////////

/***************************************************************************/
/**
 * @file config_cparam.h 
 *
 * This contains the configuration parameter's for Message Queue, Shared
 * Memory and Dynamic Buffer mgmt routines. The following fields are defined 
 * based on the values in sys/init.c
 ***************************************************************************/

#ifndef CONFIG_CPARAM_H
#define CONFIG_CPARAM_H

#include <os_config.h>

/************************************************************************/
/* Total Memory size for the various memory blocks			*/
/************************************************************************/
#ifdef CONFIG_SEMA
/**
 * The total Memory needed for all PID queue's in the system. This includes
 * Ready queue and Semaphore wait queue.
 * The #define's needn't be changed.
 */
#define PID_QUEUE_MSIZE  ((N_PRIO*MAX_READYQ)+(MAX_SEMA*MAX_SEMA_WAITQ))
#else
#define PID_QUEUE_MSIZE  (N_PRIO*MAX_READYQ)
#endif

#ifdef CONFIG_THREAD_SUPPORT
/**
 * The total memory needed for all the thread context. Calculated based on
 * definition in config_param.h
 */
#define THREAD_BSS_MSIZE (MAX_THREADS * THREAD_BSS_BSIZE)
#endif

#ifdef CONFIG_MSGQ
/**
 * Total Memory size for the various Message Queues		
 * This is how it is calculated from (struct _msgq_init):	
 *  -# 	msize for a single mesg queue = msg_size * msgq_len
 *  -#	Add msize of all the Mesg Q's to get the total msize
 */
#ifndef MSG_QUEUE_MSIZE /* was not defined in os_config.h */
#define MSG_QUEUE_MSIZE  4
#endif
#endif

#ifdef CONFIG_SHM
/**
 * Total Memory size for the various Shared Memory
 * This is how it is calculated from (struct _shm_init):	
 *  -# Add msize of all the shared memory to get the total msize
 */
#ifndef SHM_MSIZE /* was not defined in os_config.h */
#define SHM_MSIZE 	 100
#endif
#endif

#ifdef CONFIG_MALLOC
/**
 * Total Memory size for the Dynamic buffer management	
 * This is how it is calculated from (struct _malloc_init):
 *  -#	msize for a single memory block = mem_bsize * n_blocks
 *  -#	Add msize of all the Memory blocks to get the total msize
 */
#ifndef MALLOC_MSIZE /* was not defined in os_config.h */
#define MALLOC_MSIZE 	 120
#endif
#endif

/************************************************************************/
/* Maximum number of various elements - See config_init.h		*/
/************************************************************************/
#ifndef N_INIT_PROCESS /* was not defined in os_config.h */
#define N_INIT_PROCESS 	1	/**< Number of elements in start_p[] */ 
#endif

#ifdef CONFIG_MSGQ
#ifndef N_MSGQ /* was not defined in os_config.h */
#define N_MSGQ 		1	/**< Number of elements in msgq_config[] */
#endif
#endif

#ifdef CONFIG_SHM
#ifndef N_SHM /* was not defined in os_config.h */
#define N_SHM		1	/**< Number of elements in shm_config[] */
#endif
#endif

#ifdef CONFIG_MALLOC
#ifndef N_MALLOC_BLOCKS /* was not defined in os_config.h */
#define N_MALLOC_BLOCKS	2	/**< Number of elements in malloc_config[] */
#endif
#ifndef TOT_MALLOC_BLOCKS /* was not defined in os_config.h */
#define TOT_MALLOC_BLOCKS 20	/**< Total number of memory blocks in the 
				     system. This is:			
				     - Sum of n_blocks field of all elements 
 				       in malloc_config[]		*/
#endif
#endif

#endif
