/*****************************************************************************
* Filename:          portmutex.h
* Version:           1.00.a
* Description:       user_mutex (new FSL core) Driver Header File
* Date:              Thu Jul 11 11:23:19 2013 (by Create and Import Peripheral Wizard)
*****************************************************************************/

#ifndef PORT_MUTEX_H              /* prevent circular inclusions */
#define PORT_MUTEX_H              /* by using protection macros */

#ifdef __cplusplus
extern "C"
{
#endif

#include "xstatus.h"

#include "fsl.h"
#define write_into_fsl(val, id)  putfsl(val, id)
#define read_from_fsl(val, id)  getfsl(val, id)

/*
* A macro for accessing FSL peripheral.
*
* This example driver writes all the data in the input arguments
* into the input FSL bus through blocking writes. FSL peripheral will
* automatically read from the FSL bus. Once all the inputs
* have been written, the output from the FSL peripheral is read
* into output arguments through blocking reads.
*
* Arguments:
*    input_slot_id
*        Compile time constant indicating FSL slot from
*        which coprocessor read the input data. Defined in
*        xparameters.h .
*    output_slot_id
*        Compile time constant indicating FSL slot into
*        which the coprocessor write output data. Defined in
*        xparameters.h .
*    input_0    An array of unsigned integers. Array size is 1
*    input_1    An array of unsigned integers. Array size is 1
*    output_0   An array of unsigned integers. Array size is 1
*
* Caveats:
*    The output_slot_id and input_slot_id arguments must be
*    constants available at compile time. Do not pass
*    variables for these arguments.
*
*    Since this is a macro, using it too many times will
*    increase the size of your application. In such cases,
*    or when this macro is too simplistic for your
*    application you may want to create your own instance
*    specific driver function (not a macro) using the
*    macros defined in this file and the slot
*    identifiers defined in xparameters.h .  Please see the
*    example code (user_mutex_app.c) for details.
*/


#define input_slot_id   1
#define output_slot_id  0

int mutex_lock(int mutex_num, int CPU_ID);
int mutex_unlock(int mutex_num, int CPU_ID);

#ifdef __cplusplus
}
#endif

#endif                          /* end of protection macro */
