assemblyarmgnu-assemblercortex-m

Understanding this part arm assembly code


.syntax unified
.thumb

.cpu cortex-m4
.arch armv7e-m
.fpu fpv4-sp-d16

/* Changes from unprivileged to privileged mode. */
.thumb_func
.section    .kernel
.global     raise_privilege
.type       raise_privilege, %function
raise_privilege:
mrs     r0, control
bic     r0, r0, #1
msr     control, r0
dsb
isb
bx      lr

this is part of arm assembly code. I can check chip manual to figure out the meaning of the instructions. But I don't know how to figure out the behavior of assembler directives like .thumb_func. What's more, I also don't know how to use this part code, it doesn't' look like regular function. So I don't know how to "call" it.


Solution

  • bl raise_privilege