Add isb and prevent CPU from postponing threadOnException memory writes
This commit is contained in:
parent
a4634c0290
commit
0f098853f2
@ -42,6 +42,12 @@ static inline void __dmb(void)
|
||||
__asm__ __volatile__("mcr p15, 0, %[val], c7, c10, 5" :: [val] "r" (0) : "memory");
|
||||
}
|
||||
|
||||
/// Performs an Instruction Synchronization Barrier (officially "flush prefetch buffer") operation.
|
||||
static inline void __isb(void)
|
||||
{
|
||||
__asm__ __volatile__("mcr p15, 0, %[val], c7, c5, 4" :: [val] "r" (0) : "memory");
|
||||
}
|
||||
|
||||
/// Performs a clrex operation.
|
||||
static inline void __clrex(void)
|
||||
{
|
||||
|
@ -117,4 +117,7 @@ static inline void threadOnException(ExceptionHandler handler, void* stack_top,
|
||||
*(u32*)(tls + 0x40) = (u32)handler;
|
||||
*(u32*)(tls + 0x44) = (u32)stack_top;
|
||||
*(u32*)(tls + 0x48) = (u32)exception_data;
|
||||
|
||||
__dsb();
|
||||
__isb();
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user