Fixed few more anomalies with threaded irqs.

There is a bug that causes the sleeping irq
thread to never wake up. Investigating.
This commit is contained in:
Bahadir Balban
2009-12-13 20:35:04 +02:00
parent 0c4bd69357
commit d85ccdb3fe
10 changed files with 66 additions and 12 deletions

View File

@@ -4,7 +4,7 @@
Import('env')
# The set of source files associated with this SConscript file.
src_local = ['mm.c', 'mmu_ops.S', 'mutex.S']
src_local = ['mm.c', 'mmu_ops.S', 'mutex.S', 'irq.S']
obj = env.Object(src_local)
Return('obj')

27
src/arch/arm/v5/irq.S Normal file
View File

@@ -0,0 +1,27 @@
#include INC_ARCH(asm.h)
/*
* r0 = unsigned long *state, stores current irq state.
*/
BEGIN_PROC(irq_local_disable_save)
mov r1, r0 @ Move address of state to r1
mrs r2, cpsr_fc @ Read cpsr
orr r3, r2, #0x80 @ Disable irq bit in cpsr
msr cpsr_fc, r3 @ Write to cpsr
str r2, [r1] @ Store original cpsr in r2 to state
mov pc, lr
END_PROC(irq_local_disable_save)
/*
* r0 = byte address to read from.
*/
BEGIN_PROC(l4_atomic_dest_readb)
mov r1, r0 @ Move byte address to r1
mov r2, #0 @ Move 0 to r2
swpb r0, r2, [r1] @ Write 0 to byte location, while reading its value to r0
mov pc, lr @ Return byte location value
END_PROC(l4_atomic_dest_readb)