![](http://datasheet.mmic.net.cn/220000/E5550F-S8_datasheet_15476740/E5550F-S8_175.png)
175
SAM4CP [DATASHEET]
43051E–ATPL–08/14
12.6.12.2 CPS
Change Processor State.
Syntax
CPS
effect
iflags
where:
effect
is one of:
IE
Clears the special purpose register.
ID
Sets the special purpose register.
iflags
is a sequence of one or more flags:
i
Set or clear PRIMASK.
f
Set or clear FAULTMASK.
Operation
CPS changes the PRIMASK and FAULTMASK special register values. See
“Exception Mask Registers”
for more
information about these registers.
Restrictions
The restrictions are:
Use CPS only from privileged software, it has no effect if used in unprivileged software.
CPS cannot be conditional and so must not be used inside an IT block.
Condition Flags
This instruction does not change the condition flags.
Examples
CPSID i ; Disable interrupts and configurable fault handlers (set PRIMASK)
CPSID f ; Disable interrupts and all fault handlers (set FAULTMASK)
CPSIE i ; Enable interrupts and configurable fault handlers (clear PRIMASK)
CPSIE f ; Enable interrupts and fault handlers (clear FAULTMASK)
12.6.12.3 DMB
Data Memory Barrier.
Syntax
DMB{
cond
}
where:
cond
is an optional condition code, see
“Conditional Execution”
.
Operation
DMB acts as a data memory barrier. It ensures that all explicit memory accesses that appear, in program order, before
the DMB instruction are completed before any explicit memory accesses that appear, in program order, after the DMB
instruction. DMB does not affect the ordering or execution of instructions that do not access memory.
Condition Flags
This instruction does not change the flags.
Examples
DMB ; Data Memory Barrier