The following definitions make use of extended asm, which is not supported by Arm Compiler 5.
static inline void dmb(void) { asm("dmb" ::: "memory"); } static inline void dsb(void) { asm("dsb" ::: "memory"); } static inline void isb(void) { asm("isb" ::: "memory"); }
These functions are used here:
void mmu_configure(void *tlb) { assert(!mmu_is_enabled()); /* Translation Table Base Register 0 */ cp15_write_ttbr0((unsigned int)tlb); /* Domain Access Register */ /* only domain 15: access are not checked */ cp15_write_dacr(0xC0000000); dsb(); isb(); }
Can these instructions be replaced by the intrinsics __dmb(0xF), __dsb(0xF) and __isb(0xF) to achieve same behavior of the compiler?
void mmu_configure(void *tlb) { assert(!mmu_is_enabled()); /* Translation Table Base Register 0 */ cp15_write_ttbr0((unsigned int)tlb); /* Domain Access Register */ /* only domain 15: access are not checked */ cp15_write_dacr(0xC0000000); __dsb(0xF); __isb(0xF); }
Yes, that is the intent and usage of these intrinsic functions.
Note that Arm Compiler 5 is a very old toolchain. Arm Compiler 6 (latest is v6.15) has enhanced support for these and other intrinsics as defined by the Arm C Language Extensions (ACLE):
developer.arm.com/.../acle