////////////////////////////////////////////////////////////////////////////
//
// 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.
// 
// Date   : 2002, November.
// Author : Raj Nagarajan (rajn@xilinx.com)
// Company: Xilinx
// Group  : Emerging Software Technologies
//
// $Id :$
//
//////////////////////////////////////////////////////////////////////////////

/***************************************************************************/
/**
 * @file shm.h
 *
 * This contains the function decleration for shared memory routines.
 ***************************************************************************/
#ifndef _SHM_H
#define _SHM_H

#include <os_config.h>
#include <config_cparam.h>
#include <sys/ipc.h>

/**
 * Each Shared Memory is associated with this structure.
 */
struct shmid_ds {
	signed char 	shmid ;		/**< Shared Memory ID */
	unsigned char 	key ;		/**< key to identify the shm segment */
	unsigned char 	size ;		/**< Size of the shared memory */
	unsigned char 	nattach ;	/**< No. of current attachments */
	unsigned char 	*shmem ;	/**< Shared memory location */
} ;

/*
 * Functions defined in sys/shm.h
 */
int sys_shmget( unsigned int key, unsigned int size, unsigned int flag ) ;
int sys_shmctl( unsigned int shmid, unsigned int cmd, struct shmid_ds *buf ) ;
void *sys_shmat( unsigned int shmid, void *addr, unsigned int flag ) ;
int sys_shmdt( void *addr ) ;

#endif
