////////////////////////////////////////////////////////////////////////////
//
// 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 syscall.h 
 *
 * The System call numbers for the system are defined here. These numbers 
 * are then used to index into the system call vector table by the system
 * call handler, when a system call is invoked.
 *
 * The system calls are available for following routines
 *   - Process Management
 *   - Thread Managament
 *   - Semaphore
 *   - Message Queue
 *   - Shared Memory
 *   - Dynamic Buffer Management
 *   - XilNet
 ***************************************************************************/
#ifndef _SYSCALL_H_
#define _SYSCALL_H_

#define MAX_SYSCALL 13

#define _MB_Process_Create 	1	/* Process Management */
#define _MB_Process_Exit  	2
#define _MB_Process_Kill	3
#define _MB_Process_Status	4
#define _MB_Process_Sleep	5
#define _MB_Process_Yield	6
#define _MB_Process_GetPID	7
#define _MB_Process_GetPriority	8
#define _MB_Process_SetPriority 9

#define _MB_Thread_Create	10	/* Thread Management */
#define _MB_Thread_Exit		11
	
#define _MB_Sem_Init	12		/* Semaphore */
#define _MB_Sem_Wait	13
#define _MB_Sem_TryWait	14	
#define _MB_Sem_Post	15
#define _MB_Sem_Destroy	16
	
#define _MB_MsgGet	17		/* Message Queue */
#define _MB_MsgCtl	18
#define _MB_MsgSend	19
#define _MB_MsgRecv	20
	
#define _MB_ShmGet	21		/* Shared Memory */
#define _MB_ShmCtl	22
#define _MB_Shmat	23
#define _MB_Shmdt	24
	
#define _MB_Malloc 	25		/* Dynamic Buffer Management */
#define _MB_Free	26

#define _MB_Timer_GetTime	27
#define _MB_Timer_SetTime	28
#define _MB_Timer_Sleep		29

#define _MB_Mutex_Init		27	/* Mutex handling */		
#define _MB_Mutex_Lock		28
#define _MB_Mutex_Unlock	29
#define _MB_Mutex_Destroy	30

#define _MB_XilSock_Socket	18	/* Xil Net */
#define _MB_XilSock_Bind	19
#define _MB_XilSock_Listen	20
#define _MB_XilSock_Accept	21
#define _MB_XilSock_Recv	22
#define _MB_XilSock_Send	23
#define _MB_XilSock_RecvFrom	24
#define _MB_XilSock_SendTo	25
#define _MB_XilSock_Close	26
#define _MB_Sem_Wait_BLOCKED	27
#define SYSCALL_POP_TO_SCHEDULER 100
struct t_syscall_data {
  int system_call_num; /* predefined system call number */
  /* actual function to be called will be passed these params */
  void *param1;
  void *param2;
  void *param3;
  void *param4;
  void *param5;
  void *param6;
};
#endif
