mirror of
https://github.com/drasko/codezero.git
synced 2026-01-20 06:43:16 +01:00
Added forgotten files
This commit is contained in:
25
src/arch/arm/v5/atomic.S
Normal file
25
src/arch/arm/v5/atomic.S
Normal file
@@ -0,0 +1,25 @@
|
||||
/*
|
||||
* Copyright (C) 2010 B Labs
|
||||
*
|
||||
* Author: Bahadir Balban
|
||||
*/
|
||||
|
||||
#include INC_ARCH(asm.h)
|
||||
|
||||
/*
|
||||
* Atomically and destructively reads a byte. E.g.
|
||||
* byte is read and zero is written back. This is
|
||||
* useful on reading irq counts
|
||||
*
|
||||
* @r0 = byte address
|
||||
*/
|
||||
BEGIN_PROC(l4_atomic_dest_readb)
|
||||
mov r1, #0
|
||||
swpb r2, r1, [r0]
|
||||
mov r0, r2
|
||||
mov pc, lr
|
||||
END_PROC(l4_atomic_dest_readb)
|
||||
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user