[Cortex] Add preliminary support for core-dependent defines ARMv6m / ARMv7m, ARMv7em

This commit is contained in:
BuFran
2013-07-22 18:43:16 +02:00
committed by Piotr Esden-Tempski
parent 2a588f11aa
commit e1ebcc9da8
15 changed files with 526 additions and 218 deletions

View File

@@ -19,8 +19,15 @@
#include <libopencm3/cm3/sync.h>
#if defined(LPC43XX_M0)
#warning "Currently sync is not supported on Cortex-M0"
/* DMB is supported on CM0 */
void __dmb()
{
__asm__ volatile ("dmb");
}
/* Those are defined only on CM3 or CM4 */
#if defined(__ARM_ARCH_6M__)
#warning "sync not supported on ARMv6-M arch"
#else
uint32_t __ldrex(volatile uint32_t *addr)
@@ -38,11 +45,6 @@ uint32_t __strex(uint32_t val, volatile uint32_t *addr)
return res;
}
void __dmb()
{
__asm__ volatile ("dmb");
}
void mutex_lock(mutex_t *m)
{
uint32_t status = 0;