mirror of
https://github.com/RIOT-OS/RIOT.git
synced 2025-12-15 09:33:50 +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
|
||||
* applicable */
|
||||
SCB->ICSR |= SCB_ICSR_PENDSVSET_Msk;
|
||||
SCB->ICSR = SCB_ICSR_PENDSVSET_Msk;
|
||||
}
|
||||
|
||||
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) {
|
||||
case 1: /* SVC number used by cpu_switch_context_exit */
|
||||
SCB->ICSR |= SCB_ICSR_PENDSVSET_Msk;
|
||||
SCB->ICSR = SCB_ICSR_PENDSVSET_Msk;
|
||||
break;
|
||||
default:
|
||||
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 */
|
||||
void __attribute__((used)) isr_svc(void)
|
||||
{
|
||||
SCB->ICSR |= SCB_ICSR_PENDSVSET_Msk;
|
||||
SCB->ICSR = SCB_ICSR_PENDSVSET_Msk;
|
||||
}
|
||||
#endif /* MODULE_CORTEXM_SVC */
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user