Changeset 4621d23 in mainline for kernel/arch/arm32/src/atomic.c
- Timestamp:
- 2018-09-06T19:54:11Z (7 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 508b0df1
- Parents:
- ffa73c6
- git-author:
- Jiří Zárevúcky <jiri.zarevucky@…> (2018-08-13 03:00:17)
- git-committer:
- Jiří Zárevúcky <jiri.zarevucky@…> (2018-09-06 19:54:11)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
kernel/arch/arm32/src/atomic.c
rffa73c6 r4621d23 36 36 #include <synch/spinlock.h> 37 37 #include <arch/barrier.h> 38 #include <arch/asm.h> 38 39 40 unsigned __atomic_fetch_add_4(volatile unsigned *mem, unsigned val, int model) 41 { 42 /* 43 * This implementation is for UP pre-ARMv6 systems where we do not have 44 * the LDREX and STREX instructions. 45 */ 46 ipl_t ipl = interrupts_disable(); 47 unsigned ret = *mem; 48 *mem += val; 49 interrupts_restore(ipl); 50 return ret; 51 } 52 53 unsigned __atomic_fetch_sub_4(volatile unsigned *mem, unsigned val, int model) 54 { 55 ipl_t ipl = interrupts_disable(); 56 unsigned ret = *mem; 57 *mem -= val; 58 interrupts_restore(ipl); 59 return ret; 60 } 39 61 40 62 IRQ_SPINLOCK_STATIC_INITIALIZE_NAME(cas_lock, "arm-cas-lock");
Note:
See TracChangeset
for help on using the changeset viewer.