Update params in calls to LD/STREXW to be uint32_t

pull/5342/head
Bartek Szatkowski 2017-10-19 13:56:24 -05:00
parent 106f34e2ed
commit c5a5438256
7 changed files with 23 additions and 23 deletions

View File

@ -69,7 +69,7 @@ __STATIC_INLINE int mxc_get_lock(uint32_t *lock, uint32_t value)
do {
// Return if the lock is taken by a different thread
if(__LDREXW((volatile unsigned long *)lock) != 0) {
if(__LDREXW((volatile uint32_t *)lock) != 0) {
return E_BUSY;
}

View File

@ -80,12 +80,12 @@ __STATIC_INLINE int mxc_get_lock(uint32_t *lock, uint32_t value)
do {
// Return if the lock is taken by a different thread
if(__LDREXW((volatile unsigned long *)lock) != 0) {
if(__LDREXW((volatile uint32_t *)lock) != 0) {
return E_BUSY;
}
// Attempt to take the lock
} while(__STREXW(value, (volatile unsigned long *)lock) != 0);
} while(__STREXW(value, (volatile uint32_t *)lock) != 0);
// Do not start any other memory access until memory barrier is complete
__DMB();

View File

@ -130,9 +130,9 @@ static inline void atomic_set_u32(volatile uint32_t *ptr, uint32_t mask)
{
uint32_t newValue;
do {
newValue = (uint32_t)__LDREXW((volatile unsigned long *)ptr) | mask;
newValue = (uint32_t)__LDREXW(ptr) | mask;
} while (__STREXW(newValue,(volatile unsigned long*) ptr));
} while (__STREXW(newValue, ptr));
}
@ -140,9 +140,9 @@ static inline void atomic_clr_u32(volatile uint32_t *ptr, uint32_t mask)
{
uint32_t newValue;
do {
newValue = (uint32_t)__LDREXW((volatile unsigned long *)ptr) &~mask;
newValue = (uint32_t)__LDREXW(ptr) &~mask;
} while (__STREXW(newValue,(volatile unsigned long*) ptr));
} while (__STREXW(newValue, ptr));
}
#if defined ( __GNUC__ ) && !defined ( __CC_ARM )

View File

@ -129,9 +129,9 @@ static inline void atomic_set_u32(volatile uint32_t *ptr, uint32_t mask)
{
uint32_t newValue;
do {
newValue = (uint32_t)__LDREXW((volatile unsigned long *)ptr) | mask;
newValue = (uint32_t)__LDREXW(ptr) | mask;
} while (__STREXW(newValue,(volatile unsigned long*) ptr));
} while (__STREXW(newValue, ptr));
}
@ -139,9 +139,9 @@ static inline void atomic_clr_u32(volatile uint32_t *ptr, uint32_t mask)
{
uint32_t newValue;
do {
newValue = (uint32_t)__LDREXW((volatile unsigned long *)ptr) &~mask;
newValue = (uint32_t)__LDREXW(ptr) &~mask;
} while (__STREXW(newValue,(volatile unsigned long*) ptr));
} while (__STREXW(newValue, ptr));
}
#if defined ( __GNUC__ ) && !defined ( __CC_ARM )

View File

@ -129,9 +129,9 @@ static inline void atomic_set_u32(volatile uint32_t *ptr, uint32_t mask)
{
uint32_t newValue;
do {
newValue = (uint32_t)__LDREXW((volatile unsigned long *)ptr) | mask;
newValue = (uint32_t)__LDREXW(ptr) | mask;
} while (__STREXW(newValue,(volatile unsigned long*) ptr));
} while (__STREXW(newValue, ptr));
}
@ -139,9 +139,9 @@ static inline void atomic_clr_u32(volatile uint32_t *ptr, uint32_t mask)
{
uint32_t newValue;
do {
newValue = (uint32_t)__LDREXW((volatile unsigned long *)ptr) &~mask;
newValue = (uint32_t)__LDREXW(ptr) &~mask;
} while (__STREXW(newValue,(volatile unsigned long*) ptr));
} while (__STREXW(newValue, ptr));
}
#endif /* USE_RTOS */

View File

@ -130,9 +130,9 @@ static inline void atomic_set_u32(volatile uint32_t *ptr, uint32_t mask)
{
uint32_t newValue;
do {
newValue = (uint32_t)__LDREXW((volatile unsigned long *)ptr) | mask;
newValue = (uint32_t)__LDREXW(ptr) | mask;
} while (__STREXW(newValue,(volatile unsigned long*) ptr));
} while (__STREXW(newValue, ptr));
}
@ -140,9 +140,9 @@ static inline void atomic_clr_u32(volatile uint32_t *ptr, uint32_t mask)
{
uint32_t newValue;
do {
newValue = (uint32_t)__LDREXW((volatile unsigned long *)ptr) &~mask;
newValue = (uint32_t)__LDREXW(ptr) &~mask;
} while (__STREXW(newValue,(volatile unsigned long*) ptr));
} while (__STREXW(newValue, ptr));
}
#if defined ( __GNUC__ ) && !defined ( __CC_ARM )

View File

@ -132,9 +132,9 @@ static inline void atomic_set_u32(volatile uint32_t *ptr, uint32_t mask)
{
uint32_t newValue;
do {
newValue = (uint32_t)__LDREXW((volatile unsigned long *)ptr) | mask;
newValue = (uint32_t)__LDREXW(ptr) | mask;
} while (__STREXW(newValue,(volatile unsigned long*) ptr));
} while (__STREXW(newValue, ptr));
}
@ -142,9 +142,9 @@ static inline void atomic_clr_u32(volatile uint32_t *ptr, uint32_t mask)
{
uint32_t newValue;
do {
newValue = (uint32_t)__LDREXW((volatile unsigned long *)ptr) &~mask;
newValue = (uint32_t)__LDREXW(ptr) &~mask;
} while (__STREXW(newValue,(volatile unsigned long*) ptr));
} while (__STREXW(newValue, ptr));
}
#if defined ( __GNUC__ ) && !defined ( __CC_ARM )