当前位置:网站首页>B_ QuRT_ User_ Guide(39)

B_ QuRT_ User_ Guide(39)

2022-07-07 23:30:00 weixin_ thirty-eight million four hundred and ninety-eight thou

B_QuRT_User_Guide(39)

27 Atomic manipulation

QuRT Kernel atomic operations can be performed through QuRT Function access .

27.1 qurt_atomic_set()

27.1.1 Function document

27.1.1.1 static QURT_INLINE unsigned int qurt_atomic_set ( unsigned int ∗ target,unsigned int value )

Set the atomic variable with the specified value .

 Be careful : This function will retry , Until the loading lock and condition storage succeed .

Parameters

in,outtarget Pointer to atomic variable .
invalue The value to set .

Return value
Value successfully set .

Dependencies
None.

27.2 qurt_atomic_and()

27.2.1 Function document

27.2.1.1 static QURT_INLINE void qurt_atomic_and ( unsigned int ∗ target, unsigned int mask )

Bitwise and operation of masked atomic variables .

 Be careful : This function will retry , Until the loading lock and condition storage succeed .

Parameters

in,outtarget Pointer to atomic variable .
inmask Mask by bit and .

Return value
None.

Dependencies
None.

27.3 qurt_atomic_and_return()

27.3.1 Function document

27.3.1.1 static QURT_INLINE unsigned int qurt_atomic_and_return ( unsigned int ∗target, unsigned int mask )

Bitwise and operation of masked atomic variables .

 Be careful : The function retries until the load lock and condition store succeed .

Parameters

in,outtarget Pointer to atomic variable .
inmask Mask by bit and .

Return value
With masked atomic variables AND result .

Dependencies
None.

27.4 qurt_atomic_or()

27.4.1 Function document

27.4.1.1 static QURT_INLINE void qurt_atomic_or ( unsigned int ∗ target, unsigned int mask )

Bitwise OR operation of masked atomic variables .

 Be careful : This function will retry , Until the loading lock and condition storage succeed .

Parameters

in,outtarget Pointer to atomic variable .
inmask Mask by bit or .

Return value
None.

Dependencies
None.

27.5 qurt_atomic_or_return()

27.5.1 Function document

27.5.1.1 static QURT_INLINE unsigned int qurt_atomic_or_return ( unsigned int ∗target, unsigned int mask )

Bitwise OR operation of masked atomic variables .

 Be careful : This function will retry , Until the loading lock and condition storage succeed .

Parameters

in,outtarget Pointer to atomic variable .
inmask Mask by bit or .

Return value
Returns the of the masked atomic variable OR result .

Dependencies
None.

27.6 qurt_atomic_xor()

27.6.1 Function document

27.6.1.1 static QURT_INLINE void qurt_atomic_xor ( unsigned int ∗ target, unsigned int mask )

Bitwise XOR of masked atomic variables .

 Be careful : This function will retry , Until the loading lock and condition storage succeed .

Parameters

in,outtarget Pointer to atomic variable .
inmask Mask by bitwise XOR .

Return value
None.

Dependencies
None.

27.7 qurt_atomic_xor_return()

27.7.1 Function document

27.7.1.1 static QURT_INLINE unsigned int qurt_atomic_xor_return ( unsigned int ∗target, unsigned int mask )

Bitwise XOR of masked atomic variables .

 Be careful : This function will retry , Until the loading lock and condition storage succeed .

Parameters

in,outtarget Pointer to atomic variable .
inmask Mask by bitwise XOR .

Return value
XOR result of masked atomic variables .

Dependencies
None.

27.8 qurt_atomic_set_bit()

27.8.1 Function document

27.8.1.1 static QURT_INLINE void qurt_atomic_set_bit ( unsigned int ∗ target,unsigned int bit )

Set a bit at the specified position in the atomic variable .

 Be careful : This function will retry , Until the loading lock and condition storage succeed .

Parameters

in,outtarget Pointer to atomic variable .
inbit To set up bit Location .

Return value
None.

Dependencies
None.

27.9 qurt_atomic_clear_bit()

27.9.1 Function document

27.9.1.1 static QURT_INLINE void qurt_atomic_clear_bit ( unsigned int ∗ target,unsigned int bit )

Clear the bit at the specified position in the atomic variable .

 Be careful : This function will retry , Until the loading lock and condition storage succeed .

Parameters

in,outtarget Pointer to atomic variable .
inbit To be cleared bit Location .

Return value
None.

Dependencies
None.

27.10 qurt_atomic_change_bit()

27.10.1 Function document

27.10.1.1 static QURT_INLINE void qurt_atomic_change_bit ( unsigned int ∗ target,unsigned int bit )

stay bit Switch bits in atomic variables of position .

 Be careful : This function will retry , Until the loading lock and condition storage succeed .

Parameters

in,outtarget Pointer to atomic variable .
inbit To switch bit Location .

Return value
None.

Dependencies
None.

27.11 qurt_atomic_add()

27.11.1 Function document

27.11.1.1 static QURT_INLINE void qurt_atomic_add ( unsigned int ∗ target, unsigned int v )

Add integers to atomic variables .

 Be careful : This function will retry , Until the loading lock and condition storage succeed .

Parameters

in,outtarget Pointer to atomic variable .
inv Integer value to add .

Return value
None.

Dependencies
None.

27.12 qurt_atomic_add_return()

27.12.1 Function document

27.12.1.1 static QURT_INLINE unsigned int qurt_atomic_add_return ( unsigned int ∗target, unsigned int v )

Add integers to atomic variables .

 Be careful : This function will retry , Until the loading lock and condition storage succeed .

Parameters

in,outtarget Pointer to atomic variable .
inv Integer value to add .

Return value
The result of arithmetic sum .

Dependencies
None.

27.13 qurt_atomic_add_unless()

27.13.1 Function document

27.13.1.1 static QURT_INLINE unsigned int qurt_atomic_add_unless ( unsigned int ∗target, unsigned int delta, unsigned int unless )

Add the increment value to the atomic variable , Unless the current value in the target matches the variable .

 Be careful : This function will retry , Until the loading lock and condition storage succeed .

Parameters

in,outtarget Pointer to atomic variable .
indelta The value added to the current value .
inunless Only if the current value is not equal to unless Value before adding .

Return value
TRUE 1 - Addition performed .
FALSE 0 - Addition incomplete .
Dependencies
None.

27.14 qurt_atomic_sub()

27.14.1 Function document

27.14.1.1 static QURT_INLINE void qurt_atomic_sub ( unsigned int ∗ target, unsigned int v )

Subtract an integer from the atomic variable .

 Be careful : This function will retry , Until the loading lock and condition storage succeed .

Parameters

in,outtarget Pointer to atomic variable .
inv The integer value to subtract .

Return value
None.
Dependencies
None.

27.15 qurt_atomic_sub_return()

27.15.1 Function document

27.15.1.1 static QURT_INLINE unsigned int qurt_atomic_sub_return ( unsigned int ∗target, unsigned int v )

Subtract an integer from the atomic variable .

 Be careful : This function will retry , Until the loading lock and condition storage succeed .

Parameters

in,outtarget Pointer to atomic variable .
inv The integer value to subtract .

Return value
The result of arithmetic subtraction .

Dependencies
None.

27.16 qurt_atomic_inc()

27.16.1 Function document

27.16.1.1 static QURT_INLINE void qurt_atomic_inc ( unsigned int ∗ target )

Add one to the atomic variable .

 Be careful : This function will retry , Until the loading lock and condition storage succeed .

Parameters

in,outtarget Pointer to atomic variable .

Return value
None.

Dependencies
None.

27.17 qurt_atomic_inc_return()

27.17.1 Function document

27.17.1.1 static QURT_INLINE unsigned int qurt_atomic_inc_return ( unsigned int ∗target )

Add one to the atomic variable .

 Be careful : This function will retry , Until the loading lock and condition storage succeed .

Parameters

in,outtarget Pointer to atomic variable .

Return value
Incremental value .

Dependencies
None.

27.18 qurt_atomic_dec()

27.18.1 Function document

27.18.1.1 static QURT_INLINE void qurt_atomic_dec ( unsigned int ∗ target )

Subtract the atomic variable by one .

 Be careful : This function will retry , Until the loading lock and condition storage succeed .

Parameters

in,outtarget Pointer to atomic variable .

Return value
None.

Dependencies
None.

原网站

版权声明
本文为[weixin_ thirty-eight million four hundred and ninety-eight thou]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/188/202207072054191254.html