Skip to content

Commit 5f19cd9

Browse files
committed
Update params in calls to LD/STREXW to be uint32_t
1 parent 3c2988d commit 5f19cd9

File tree

7 files changed

+23
-23
lines changed

7 files changed

+23
-23
lines changed

targets/TARGET_Maxim/TARGET_MAX32625/mxc/mxc_lock.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ __STATIC_INLINE int mxc_get_lock(uint32_t *lock, uint32_t value)
6969
do {
7070

7171
// Return if the lock is taken by a different thread
72-
if(__LDREXW((volatile unsigned long *)lock) != 0) {
72+
if(__LDREXW((volatile uint32_t *)lock) != 0) {
7373
return E_BUSY;
7474
}
7575

targets/TARGET_Maxim/TARGET_MAX32630/mxc/mxc_lock.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -80,12 +80,12 @@ __STATIC_INLINE int mxc_get_lock(uint32_t *lock, uint32_t value)
8080
do {
8181

8282
// Return if the lock is taken by a different thread
83-
if(__LDREXW((volatile unsigned long *)lock) != 0) {
83+
if(__LDREXW((volatile uint32_t *)lock) != 0) {
8484
return E_BUSY;
8585
}
8686

8787
// Attempt to take the lock
88-
} while(__STREXW(value, (volatile unsigned long *)lock) != 0);
88+
} while(__STREXW(value, (volatile uint32_t *)lock) != 0);
8989

9090
// Do not start any other memory access until memory barrier is complete
9191
__DMB();

targets/TARGET_STM/TARGET_STM32F2/device/stm32f2xx_hal_def.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -130,19 +130,19 @@ static inline void atomic_set_u32(volatile uint32_t *ptr, uint32_t mask)
130130
{
131131
uint32_t newValue;
132132
do {
133-
newValue = (uint32_t)__LDREXW((volatile unsigned long *)ptr) | mask;
133+
newValue = (uint32_t)__LDREXW(ptr) | mask;
134134

135-
} while (__STREXW(newValue,(volatile unsigned long*) ptr));
135+
} while (__STREXW(newValue, ptr));
136136
}
137137

138138

139139
static inline void atomic_clr_u32(volatile uint32_t *ptr, uint32_t mask)
140140
{
141141
uint32_t newValue;
142142
do {
143-
newValue = (uint32_t)__LDREXW((volatile unsigned long *)ptr) &~mask;
143+
newValue = (uint32_t)__LDREXW(ptr) &~mask;
144144

145-
} while (__STREXW(newValue,(volatile unsigned long*) ptr));
145+
} while (__STREXW(newValue, ptr));
146146
}
147147

148148
#if defined ( __GNUC__ ) && !defined ( __CC_ARM )

targets/TARGET_STM/TARGET_STM32F3/device/stm32f3xx_hal_def.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -129,19 +129,19 @@ static inline void atomic_set_u32(volatile uint32_t *ptr, uint32_t mask)
129129
{
130130
uint32_t newValue;
131131
do {
132-
newValue = (uint32_t)__LDREXW((volatile unsigned long *)ptr) | mask;
132+
newValue = (uint32_t)__LDREXW(ptr) | mask;
133133

134-
} while (__STREXW(newValue,(volatile unsigned long*) ptr));
134+
} while (__STREXW(newValue, ptr));
135135
}
136136

137137

138138
static inline void atomic_clr_u32(volatile uint32_t *ptr, uint32_t mask)
139139
{
140140
uint32_t newValue;
141141
do {
142-
newValue = (uint32_t)__LDREXW((volatile unsigned long *)ptr) &~mask;
142+
newValue = (uint32_t)__LDREXW(ptr) &~mask;
143143

144-
} while (__STREXW(newValue,(volatile unsigned long*) ptr));
144+
} while (__STREXW(newValue, ptr));
145145
}
146146

147147
#if defined ( __GNUC__ ) && !defined ( __CC_ARM )

targets/TARGET_STM/TARGET_STM32F4/device/stm32f4xx_hal_def.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -129,19 +129,19 @@ static inline void atomic_set_u32(volatile uint32_t *ptr, uint32_t mask)
129129
{
130130
uint32_t newValue;
131131
do {
132-
newValue = (uint32_t)__LDREXW((volatile unsigned long *)ptr) | mask;
132+
newValue = (uint32_t)__LDREXW(ptr) | mask;
133133

134-
} while (__STREXW(newValue,(volatile unsigned long*) ptr));
134+
} while (__STREXW(newValue, ptr));
135135
}
136136

137137

138138
static inline void atomic_clr_u32(volatile uint32_t *ptr, uint32_t mask)
139139
{
140140
uint32_t newValue;
141141
do {
142-
newValue = (uint32_t)__LDREXW((volatile unsigned long *)ptr) &~mask;
142+
newValue = (uint32_t)__LDREXW(ptr) &~mask;
143143

144-
} while (__STREXW(newValue,(volatile unsigned long*) ptr));
144+
} while (__STREXW(newValue, ptr));
145145
}
146146

147147
#endif /* USE_RTOS */

targets/TARGET_STM/TARGET_STM32F7/device/stm32f7xx_hal_def.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -130,19 +130,19 @@ static inline void atomic_set_u32(volatile uint32_t *ptr, uint32_t mask)
130130
{
131131
uint32_t newValue;
132132
do {
133-
newValue = (uint32_t)__LDREXW((volatile unsigned long *)ptr) | mask;
133+
newValue = (uint32_t)__LDREXW(ptr) | mask;
134134

135-
} while (__STREXW(newValue,(volatile unsigned long*) ptr));
135+
} while (__STREXW(newValue, ptr));
136136
}
137137

138138

139139
static inline void atomic_clr_u32(volatile uint32_t *ptr, uint32_t mask)
140140
{
141141
uint32_t newValue;
142142
do {
143-
newValue = (uint32_t)__LDREXW((volatile unsigned long *)ptr) &~mask;
143+
newValue = (uint32_t)__LDREXW(ptr) &~mask;
144144

145-
} while (__STREXW(newValue,(volatile unsigned long*) ptr));
145+
} while (__STREXW(newValue, ptr));
146146
}
147147

148148
#if defined ( __GNUC__ ) && !defined ( __CC_ARM )

targets/TARGET_STM/TARGET_STM32L4/device/stm32l4xx_hal_def.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -132,19 +132,19 @@ static inline void atomic_set_u32(volatile uint32_t *ptr, uint32_t mask)
132132
{
133133
uint32_t newValue;
134134
do {
135-
newValue = (uint32_t)__LDREXW((volatile unsigned long *)ptr) | mask;
135+
newValue = (uint32_t)__LDREXW(ptr) | mask;
136136

137-
} while (__STREXW(newValue,(volatile unsigned long*) ptr));
137+
} while (__STREXW(newValue, ptr));
138138
}
139139

140140

141141
static inline void atomic_clr_u32(volatile uint32_t *ptr, uint32_t mask)
142142
{
143143
uint32_t newValue;
144144
do {
145-
newValue = (uint32_t)__LDREXW((volatile unsigned long *)ptr) &~mask;
145+
newValue = (uint32_t)__LDREXW(ptr) &~mask;
146146

147-
} while (__STREXW(newValue,(volatile unsigned long*) ptr));
147+
} while (__STREXW(newValue, ptr));
148148
}
149149

150150
#if defined ( __GNUC__ ) && !defined ( __CC_ARM )

0 commit comments

Comments
 (0)