/****************************************************************************/
/*	Copyright (c) 2009, Bendor Research Pty. Ltd. All rights reserved.		*/
/*	This software is released under the GNU General Public License, version	*/
/*	3, with the exemptions that 1) the header files installed by this 	 	*/
/*	package can be included in closed-source code and 2) the libraries		*/
/*	built by this package can be statically linked into a closed-source 	*/
/*	binary. See the file LICENSE for the details.							*/
/*	This software is provided "AS IS", without any warranty or guarantee.	*/
/*	By using this software you acknowledge that neither Bendor Research nor	*/
/*	any of its personnel or affiliates can be held liable for any damages,	*/
/*	including, but not limited to, loss of business, loss of money, loss of */
/*	life, loss of reputation, arising out of this software being faulty or	*/
/*	not performing as advertised, even if Bendor Research was aware of such	*/
/*	faults in the software. You use this software at your own risk, any and */
/*	all liabilities that arise out of your using this software are strictly	*/
/*	yours.																	*/
/****************************************************************************/

#include "kernel.h"

/****************************************************************************/
/*					Public API functions									*/
/****************************************************************************/

/** @addtogroup bx_irq */
/** @{ */

/**
*	Prepares for a delayed interrupt.
*
*	This function takes a function and two parameters. The function will
*	be called, the two parameters passed to it. If this function is called
*	from an interrupt routine then the parameter function will be called
*	when the interrupt routine returns. If the function is called from a
*	user process, then the parameter function will be called immediately
*	but it will be executed in the kernel's context. If this function is
*	called from the kernel's context, then it is equivalent of simply
*	calling the argument function directly.
*
*	While the argument function is running interrupts may or may not be
*	enabled, depending on the state of the kernel's event queue. However,
*	the argument function is guaranteed to run for completion before any
*	other delayed interrupt functions are called.
*
*	@param	func	The function to call
*	@param	par1	The first argument for the called function
*	@param	par2	The second argument for the called function
*	@retval	1		This call always succeeds
*/

int		BX_SoftInterrupt( BX_DISR_FUNC func, void *par1, void *par2 )
{
	_bx_QueueEvent( _bx_IrqDis(), func, par1, par2 );
	return( 0 );
}

/** @} */
