Skip to content

Commit

Permalink
Update params in calls to LD/STREXW to be uint32_t
Browse files Browse the repository at this point in the history
  • Loading branch information
bulislaw committed Oct 19, 2017
1 parent bf7fd1f commit 970a488
Show file tree
Hide file tree
Showing 7 changed files with 23 additions and 23 deletions.
2 changes: 1 addition & 1 deletion targets/TARGET_Maxim/TARGET_MAX32625/mxc/mxc_lock.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down
4 changes: 2 additions & 2 deletions targets/TARGET_Maxim/TARGET_MAX32630/mxc/mxc_lock.h
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down
8 changes: 4 additions & 4 deletions targets/TARGET_STM/TARGET_STM32F2/device/stm32f2xx_hal_def.h
Original file line number Diff line number Diff line change
Expand Up @@ -130,19 +130,19 @@ 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));
}


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 )
Expand Down
8 changes: 4 additions & 4 deletions targets/TARGET_STM/TARGET_STM32F3/device/stm32f3xx_hal_def.h
Original file line number Diff line number Diff line change
Expand Up @@ -129,19 +129,19 @@ 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));
}


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 )
Expand Down
8 changes: 4 additions & 4 deletions targets/TARGET_STM/TARGET_STM32F4/device/stm32f4xx_hal_def.h
Original file line number Diff line number Diff line change
Expand Up @@ -129,19 +129,19 @@ 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));
}


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 */
Expand Down
8 changes: 4 additions & 4 deletions targets/TARGET_STM/TARGET_STM32F7/device/stm32f7xx_hal_def.h
Original file line number Diff line number Diff line change
Expand Up @@ -130,19 +130,19 @@ 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));
}


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 )
Expand Down
8 changes: 4 additions & 4 deletions targets/TARGET_STM/TARGET_STM32L4/device/stm32l4xx_hal_def.h
Original file line number Diff line number Diff line change
Expand Up @@ -132,19 +132,19 @@ 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));
}


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 )
Expand Down

0 comments on commit 970a488

Please sign in to comment.