/******************************************************************************/
/*                 Copyright C 1998-2002 Broadcom Corporation                 */
/*                                                                            */
/* This material is the confidential trade secret and proprietary information */
/* of Broadcom Corporation.  It may not be reproduced, used, sold or          */
/* transferred to any third party without the prior written consent of        */
/* Broadcom Corporation.   All rights reserved.                               */
/******************************************************************************/
/*   FileName        : bcm_osWrap.h                                           */
/*   Purpose         : Empty wrap for os specific usage (tasks, semaphores..) */
/*                     When real os is used, this file is replaced by os one  */
/*   Limitations     : None                                                   */
/*   Author          : Emmanuel Hanssens                                      */
/*   Creation Date   : 27-Feb-2002                                            */
/*   History         : Compiled by CVS                                        */
/******************************************************************************/
/*   $Id: bcm_osWrap.h,v 1.9 2004/09/17 12:42:02 hanssens Exp $  */
/******************************************************************************/
#ifndef BCM_OS_WRAP_H
# define BCM_OS_WRAP_H

/* {{{ tasks */

/* create and start a task with highest priority and stack size of 1024 bytes.
 * The task should be in pre-emptive mode (may be interrupted) but not sliced
 * (should not be de-scheduled to re-schedule another task) */
# define SPAWN_INTERRUPT_TASK(name, taskId, task, taskArgs)  \
  taskId = 0                   /* just to avoid unused variable warning */

/* create and start a task with background priority and stack size of 4096
 * bytes.  The task should be in pre-emptive mode (may be interrupted) and
 * sliced (may be de-scheduled to schedule another task) */
# define SPAWN_BACKGROUND_TASK(name, taskId, task, taskArgs) \
  taskId = 0                   /* just to avoid unused variable warning */

/* }}} */

/* {{{ semaphores */

# define SEMAPHORE_TYPE unsigned long
/* create a priority semaphore (allocation based on thread priority) */
# define CREATE_PRIORITY_SEMAPHORE(name, count, semId) \
  semId = 0                     /* just to avoid unused variable warning */

/* create a fifo semaphore (allocation based on request order) */
# define CREATE_FIFO_SEMAPHORE(name, count, semId) \
  semId = 0                     /* just to avoid unused variable warning */

/* request the lock on the semaphore with time out (in ms, 0 = wait forever) */
# define ACQUIRE_SEMAPHORE(semId, timeOut)

/* release the lock on the semaphore */
# define RELEASE_SEMAPHORE(semId)

/* }}} */

/* {{{ messages */

/* create a message buffer queue */
# define CREATE_MESSAGE(name, queueId)

/* wait until a message has been posted */
# define WAIT_ON_MESSAGE(queueId, msgId, data)

/* post a message at end of message queue */
# define SEND_MESSAGE(queueId, msgId, data)

/* post a message at begin of message queue (in front of pending messages) */
# define SEND_URGENT_MESSAGE(queueId, msgId, data)

/* }}} */

/* {{{ interrupts */

/* attach function to interrupt id, function getting devId as param */
# define REGISTER_FOR_INTERRUPT(intId, fn, devId)

/* mask the interrupt */
# define MASK_INTERRUPT(intId)

/* unmask the interrupt */
# define UN_MASK_INTERRUPT(intId)

/* clear level 1 interrupt when level 0 (hw int) have been read */
# define CLEAR_PENDING_INTERRUPT(intId)

/* }}} */

/* {{{ timing */

/* thread sleep for time */
#  define SLEEP_MILLISECONDS(time)

/* }}} */

#endif
