mirror of
https://github.com/RIOT-OS/RIOT.git
synced 2025-12-16 18:13:49 +01:00
cortexm_common: Remove read in ICSR register operations
All bits in the ICSR register in the cortexm system control block are either read-only or don't have an effect when writing a zero. A read-modify-write cycle is thus not required when writing bit flags in the register. This commit removes the reads in the read-modify-store patterns for this register.
This commit is contained in:
parent
ae95e33308
commit
d7c1510b0f
@ -280,7 +280,7 @@ void thread_yield_higher(void)
|
|||||||
{
|
{
|
||||||
/* trigger the PENDSV interrupt to run scheduler and schedule new thread if
|
/* trigger the PENDSV interrupt to run scheduler and schedule new thread if
|
||||||
* applicable */
|
* applicable */
|
||||||
SCB->ICSR |= SCB_ICSR_PENDSVSET_Msk;
|
SCB->ICSR = SCB_ICSR_PENDSVSET_Msk;
|
||||||
}
|
}
|
||||||
|
|
||||||
void __attribute__((naked)) __attribute__((used)) isr_pendsv(void) {
|
void __attribute__((naked)) __attribute__((used)) isr_pendsv(void) {
|
||||||
@ -432,7 +432,7 @@ static void __attribute__((used)) _svc_dispatch(unsigned int *svc_args)
|
|||||||
|
|
||||||
switch (svc_number) {
|
switch (svc_number) {
|
||||||
case 1: /* SVC number used by cpu_switch_context_exit */
|
case 1: /* SVC number used by cpu_switch_context_exit */
|
||||||
SCB->ICSR |= SCB_ICSR_PENDSVSET_Msk;
|
SCB->ICSR = SCB_ICSR_PENDSVSET_Msk;
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
DEBUG("svc: unhandled SVC #%u\n", svc_number);
|
DEBUG("svc: unhandled SVC #%u\n", svc_number);
|
||||||
@ -443,6 +443,6 @@ static void __attribute__((used)) _svc_dispatch(unsigned int *svc_args)
|
|||||||
#else /* MODULE_CORTEXM_SVC */
|
#else /* MODULE_CORTEXM_SVC */
|
||||||
void __attribute__((used)) isr_svc(void)
|
void __attribute__((used)) isr_svc(void)
|
||||||
{
|
{
|
||||||
SCB->ICSR |= SCB_ICSR_PENDSVSET_Msk;
|
SCB->ICSR = SCB_ICSR_PENDSVSET_Msk;
|
||||||
}
|
}
|
||||||
#endif /* MODULE_CORTEXM_SVC */
|
#endif /* MODULE_CORTEXM_SVC */
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user