mars/mars_mutex.h File Reference

[MPU] MARS Mutex API More...


Functions

int mars_mutex_initialize (uint64_t mutex_ea)
 [MPU] Initializes a mutex.
int mars_mutex_lock (uint64_t mutex_ea)
 [MPU] Locks a mutex.
int mars_mutex_unlock (uint64_t mutex_ea)
 [MPU] Unlocks a mutex.
int mars_mutex_lock_get (uint64_t mutex_ea, struct mars_mutex *mutex)
 [MPU] Locks a mutex.
int mars_mutex_unlock_put (uint64_t mutex_ea, struct mars_mutex *mutex)
 [MPU] Unlocks a mutex.


Detailed Description

[MPU] MARS Mutex API


Function Documentation

int mars_mutex_initialize ( uint64_t  mutex_ea  ) 

[MPU] Initializes a mutex.

This function initializes a mutex instance that can be locked or unlocked from both host and MPU to restrict concurrent accesses.

Parameters:
[in] mutex_ea -ea of mutex instance to initialize
Returns:
MARS_SUCCESS - successfully initialized mutex
MARS_ERROR_NULL - ea is 0
MARS_ERROR_ALIGN - ea not aligned properly

int mars_mutex_lock ( uint64_t  mutex_ea  ) 

[MPU] Locks a mutex.

This function locks a mutex and blocks other requests to lock it.

Parameters:
[in] mutex_ea - ea of mutex instance to lock
Returns:
MARS_SUCCESS - successfully locked mutex
MARS_ERROR_NULL - ea is 0
MARS_ERROR_ALIGN - ea not aligned properly

int mars_mutex_unlock ( uint64_t  mutex_ea  ) 

[MPU] Unlocks a mutex.

This function unlocks a previously locked mutex to allow other lock requests.

Parameters:
[in] mutex_ea - ea of mutex instance to unlock
Returns:
MARS_SUCCESS - successfully unlocked mutex
MARS_ERROR_NULL - ea is 0
MARS_ERROR_ALIGN - ea not aligned properly
MARS_ERROR_STATE - instance not in locked state

int mars_mutex_lock_get ( uint64_t  mutex_ea,
struct mars_mutex mutex 
)

[MPU] Locks a mutex.

This function locks a mutex and blocks other requests to lock it. It also loads the mutex instance from the effective address specified into the local mutex instance.

Parameters:
[in] mutex_ea - ea of mutex instance to lock
[in] mutex - pointer to local mutex instance
Returns:
MARS_SUCCESS - successfully locked mutex
MARS_ERROR_NULL - ea is 0 or mutex is NULL
MARS_ERROR_ALIGN - ea or mutex not aligned properly

int mars_mutex_unlock_put ( uint64_t  mutex_ea,
struct mars_mutex mutex 
)

[MPU] Unlocks a mutex.

This function unlocks a previously locked mutex to allow other lock requests. It also loads the local mutex instance into the effective address specified.

Parameters:
[in] mutex_ea - ea of mutex instance to unlock
[in] mutex - pointer to local mutex instance
Returns:
MARS_SUCCESS - successfully unlocked mutex
MARS_ERROR_NULL - ea is 0 or mutex is NULL
MARS_ERROR_ALIGN - ea or mutex not aligned properly
MARS_ERROR_STATE - instance not in locked state


Generated on Wed Jun 25 11:07:27 2008 for MARS by  doxygen 1.5.2