修改内核文件 core_cm3.c文件uint32_t __STREXB(uint8_t value, uint8_t *addr)
{
uint32_t result=0;
//__ASM volatile ("strexb %0, %2, [%1]" : "=r" (result) : "r" (addr), "r" (value) );
__ASM volatile ("strexb %0, %2, [%1]" : "=&r" (result) : "r" (addr), "r" (value) );
return(result);
}
/**
* [url=home.php?mod=space&uid=247401]@brief[/url] STR Exclusive (16 bit)
*
* @param value value to store
* @param *addr address pointer
* [url=home.php?mod=space&uid=266161]@return[/url] successful / failed
*
* Exclusive STR command for 16 bit values
*/
uint32_t __STREXH(uint16_t value, uint16_t *addr)
{
uint32_t result=0;
//__ASM volatile ("strexh %0, %2, [%1]" : "=r" (result) : "r" (addr), "r" (value) );
__ASM volatile ("strexh %0, %2, [%1]" : "=&r" (result) : "r" (addr), "r" (value) );
return(result);
}
/**
1. @brief STR Exclusive (32 bit)
2. 3. @param value value to store
3. @param *addr address pointer
4. @return successful / failed
5. 7. Exclusive STR command for 32 bit values
*/
uint32_t __STREXW(uint32_t value, uint32_t *addr)
{
uint32_t result=0;
//__ASM volatile ("strex %0, %2, [%1]" : "=r" (result) : "r" (addr), "r" (value) );
__ASM volatile ("strex %0, %2, [%1]" : "=&r" (result) : "r" (addr), "r" (value) );
return(result);
}
|