#include "xstatus.h"
#include "xmutex_hw.h"
#include "xil_types.h"
Classes | |
struct | XMutex_Config |
struct | XMutex |
Defines | |
#define | XMUTEX_H |
Functions | |
int | XMutex_CfgInitialize (XMutex *InstancePtr, XMutex_Config *ConfigPtr, u32 EffectiveAddress) |
void | XMutex_Lock (XMutex *InstancePtr, u8 MutexNumber) |
int | XMutex_Trylock (XMutex *InstancePtr, u8 MutexNumber) |
int | XMutex_Unlock (XMutex *InstancePtr, u8 MutexNumber) |
int | XMutex_IsLocked (XMutex *InstancePtr, u8 MutexNumber) |
void | XMutex_GetStatus (XMutex *InstancePtr, u8 MutexNumber, u32 *Locked, u32 *Owner) |
int | XMutex_GetUser (XMutex *InstancePtr, u8 MutexNumber, u32 *User) |
int | XMutex_SetUser (XMutex *InstancePtr, u8 MutexNumber, u32 User) |
XMutex_Config * | XMutex_LookupConfig (u16 DeviceId) |
int | XMutex_SelfTest (XMutex *InstancePtr) |
#define XMUTEX_H |
int XMutex_CfgInitialize | ( | XMutex * | InstancePtr, | |
XMutex_Config * | ConfigPtr, | |||
u32 | EffectiveAddress | |||
) |
Initializes a specific Mutex instance/driver.
InstancePtr | is a pointer to the XMutex instance to be worked on. | |
ConfigPtr | is the device configuration structure containing required HW build data. | |
EffectiveAddress | is the Physical address of the hardware in a Virtual Memory operating system environment. It is the Base Address in a stand alone environment. |
void XMutex_GetStatus | ( | XMutex * | InstancePtr, | |
u8 | MutexNumber, | |||
u32 * | Locked, | |||
u32 * | Owner | |||
) |
Gets the current status of a Mutex lock within a Mutex device.
InstancePtr | is a pointer to the XMutex instance to be worked on. | |
MutexNumber | is the specific Mutex lock within the device to operate on. Each device may contain multiple Mutex locks. The Mutex number is a zero based number with a range of 0 - (InstancePtr->Config.NumMutex - 1). | |
Locked | is a pointer where the current lock status is stored. Sets memory pointed to by 'Locked' to 1 if the Mutex is locked and 0 if it is unlocked. | |
Owner | is a pointer where the current owner status is stored. . If the Mutex is locked, the memory pointed to by 'Owner' is updated to reflect the CPU ID that has currently locked this Mutex. |
int XMutex_GetUser | ( | XMutex * | InstancePtr, | |
u8 | MutexNumber, | |||
u32 * | User | |||
) |
Gets the USER register of a Mutex lock within a Mutex device.
InstancePtr | is a pointer to the XMutex instance to be worked on. | |
MutexNumber | is the specific Mutex lock within the device to operate on. Each device may contain multiple Mutex locks. The Mutex number is a zero based number with a range of 0 - (InstancePtr->Config.NumMutex - 1). | |
User | is a pointer to an u32 where the current user register value is stored by this function. |
int XMutex_IsLocked | ( | XMutex * | InstancePtr, | |
u8 | MutexNumber | |||
) |
Gets the current lock state of a Mutex lock within a Mutex device.
InstancePtr | is a pointer to the XMutex instance to be worked on. | |
MutexNumber | is the specific Mutex lock within the device to operate on. Each device may contain multiple Mutex locks. The Mutex number is a zero based number with a range of 0 - (InstancePtr->Config.NumMutex - 1). |
void XMutex_Lock | ( | XMutex * | InstancePtr, | |
u8 | MutexNumber | |||
) |
Locks a particular Mutex lock within a Mutex device. Call blocks till the Mutex is locked.
InstancePtr | is a pointer to the XMutex instance to be worked on. | |
MutexNumber | is the specific Mutex lock within the device to operate on. Each device may contain multiple Mutex locks. The Mutex number is a zero based number with a range of 0 - (InstancePtr->Config.NumMutex - 1). |
XMutex_Config* XMutex_LookupConfig | ( | u16 | DeviceId | ) |
int XMutex_SelfTest | ( | XMutex * | InstancePtr | ) |
Selftest a particular Mutex hardware core.
InstancePtr | is a pointer to the XMutex instance to be worked on. |
This test is destructive. It will fail if the Mutex is currently being used. This is also a blocking call, if there is another process which has the Mutex, the first _lock will hand the test until the other process releases it.
int XMutex_SetUser | ( | XMutex * | InstancePtr, | |
u8 | MutexNumber, | |||
u32 | User | |||
) |
Sets the USER register of a Mutex lock within a Mutex device.
InstancePtr | is a pointer to the XMutex instance to be worked on. | |
MutexNumber | is the specific Mutex lock within the device to operate on. Each device may contain multiple Mutex locks. The Mutex number is a zero based number with a range of 0 - (InstancePtr->Config.NumMutex - 1). | |
User | is the value to update the USER register with. |
int XMutex_Trylock | ( | XMutex * | InstancePtr, | |
u8 | MutexNumber | |||
) |
Locks a particular Mutex lock within a Mutex device. Call returns immediately if the Mutex is already locked (This is Non-Blocking call).
InstancePtr | is a pointer to the XMutex instance to be worked on. | |
MutexNumber | is the specific Mutex lock within the device to operate on. Each device may contain multiple Mutex locks. The Mutex number is a zero based number with a range of 0 - (InstancePtr->Config.NumMutex - 1). |
int XMutex_Unlock | ( | XMutex * | InstancePtr, | |
u8 | MutexNumber | |||
) |
Unlocks a particular Mutex lock within a Mutex device.
InstancePtr | is a pointer to the XMutex instance to be worked on. | |
MutexNumber | is the specific Mutex lock within the device to operate on. Each device may contain multiple Mutex locks. The Mutex number is a zero based number with a range of 0 - (InstancePtr->Config.NumMutex - 1). |
Copyright © 1995-2014 Xilinx, Inc. All rights reserved.