diff options
author | Tom Hughes <tomhughes@chromium.org> | 2022-01-07 11:16:19 -0800 |
---|---|---|
committer | Commit Bot <commit-bot@chromium.org> | 2022-01-19 01:26:16 +0000 |
commit | 9f5b54a28bcbdb7fba3dede077ea0edf0f71c7fe (patch) | |
tree | e8966c0f8d0377583913dba24041e485e6a572b9 /chip | |
parent | a1debe37594d5ed59fb0652b50eefd2f5c12981a (diff) | |
download | chrome-ec-9f5b54a28bcbdb7fba3dede077ea0edf0f71c7fe.tar.gz |
tree: Replace asm for disabling interrupts with function
Most of the code is already using interrupt_enable/disable, so this
makes it consistent.
Commands used:
git grep --name-only 'cpsid i' |\
xargs sed -i 's#asm volatile("cpsid i");#interrupt_disable();#g'
git grep --name-only 'cpsie i' |\
xargs sed -i 's#asm volatile("cpsie i");#interrupt_enable();#g'
git checkout core/cortex-m/task.c core/cortex-m0/task.c
BRANCH=none
BUG=b:213601206
TEST=make buildall -j
Signed-off-by: Tom Hughes <tomhughes@chromium.org>
Change-Id: Ic9fc4d5adaf7254f7432685dea68611d9d535b9a
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3373621
Reviewed-by: Jack Rosenthal <jrosenth@chromium.org>
Diffstat (limited to 'chip')
-rw-r--r-- | chip/lm4/clock.c | 6 | ||||
-rw-r--r-- | chip/stm32/clock-stm32f0.c | 6 | ||||
-rw-r--r-- | chip/stm32/clock-stm32f4.c | 4 | ||||
-rw-r--r-- | chip/stm32/clock-stm32h7.c | 4 | ||||
-rw-r--r-- | chip/stm32/clock-stm32l4.c | 4 |
5 files changed, 12 insertions, 12 deletions
diff --git a/chip/lm4/clock.c b/chip/lm4/clock.c index a54a6a88f0..31ace04ce5 100644 --- a/chip/lm4/clock.c +++ b/chip/lm4/clock.c @@ -449,7 +449,7 @@ static int command_sleep(int argc, char **argv) void (*rom_clock_set)(uint32_t rcc) = func_table[23]; /* Disable interrupts. */ - asm volatile("cpsid i"); + interrupt_disable(); switch (clock) { case 1: /* 16MHz IOSC */ @@ -486,7 +486,7 @@ static int command_sleep(int argc, char **argv) /* Enable the port. */ LM4_UART_CTL(0) |= 0x0001; } - asm volatile("cpsie i"); + interrupt_enable(); } if (uartfbrd) { @@ -495,7 +495,7 @@ static int command_sleep(int argc, char **argv) } /* Enable interrupts. */ - asm volatile("cpsid i"); + interrupt_disable(); /* gate peripheral clocks */ if (level & 1) { diff --git a/chip/stm32/clock-stm32f0.c b/chip/stm32/clock-stm32f0.c index 0f63bdd394..d791d63df3 100644 --- a/chip/stm32/clock-stm32f0.c +++ b/chip/stm32/clock-stm32f0.c @@ -259,7 +259,7 @@ void __enter_hibernate(uint32_t seconds, uint32_t microseconds) set_rtc_alarm(seconds, microseconds, &rtc, 0); /* interrupts off now */ - asm volatile("cpsid i"); + interrupt_disable(); #ifdef CONFIG_HIBERNATE_WAKEUP_PINS /* enable the wake up pins */ @@ -298,7 +298,7 @@ void __idle(void) struct rtc_time_reg rtc0, rtc1; while (1) { - asm volatile("cpsid i"); + interrupt_disable(); t0 = get_time(); next_delay = __hw_clock_event_get() - t0.le.lo; @@ -376,7 +376,7 @@ void __idle(void) #ifdef CONFIG_LOW_POWER_IDLE_LIMITED en_int: #endif - asm volatile("cpsie i"); + interrupt_enable(); } } #endif /* CONFIG_LOW_POWER_IDLE */ diff --git a/chip/stm32/clock-stm32f4.c b/chip/stm32/clock-stm32f4.c index d6427fffc7..83a7b0a84e 100644 --- a/chip/stm32/clock-stm32f4.c +++ b/chip/stm32/clock-stm32f4.c @@ -462,7 +462,7 @@ void __idle(void) struct rtc_time_reg rtc0, rtc1; while (1) { - asm volatile("cpsid i"); + interrupt_disable(); t0 = get_time(); next_delay = __hw_clock_event_get() - t0.le.lo; @@ -537,7 +537,7 @@ void __idle(void) /* Normal idle : only CPU clock stopped */ asm("wfi"); } - asm volatile("cpsie i"); + interrupt_enable(); } } diff --git a/chip/stm32/clock-stm32h7.c b/chip/stm32/clock-stm32h7.c index 696105b4f1..ae60d596f1 100644 --- a/chip/stm32/clock-stm32h7.c +++ b/chip/stm32/clock-stm32h7.c @@ -471,7 +471,7 @@ void __idle(void) uint16_t lptim0; while (1) { - asm volatile("cpsid i"); + interrupt_disable(); t0 = get_time(); next_delay = __hw_clock_event_get() - t0.le.lo; @@ -538,7 +538,7 @@ void __idle(void) /* normal idle : only CPU clock stopped */ asm("wfi"); } - asm volatile("cpsie i"); + interrupt_enable(); } } diff --git a/chip/stm32/clock-stm32l4.c b/chip/stm32/clock-stm32l4.c index b07b5fb2d4..730f5d6bb9 100644 --- a/chip/stm32/clock-stm32l4.c +++ b/chip/stm32/clock-stm32l4.c @@ -1039,7 +1039,7 @@ void __idle(void) struct rtc_time_reg rtc0, rtc1; while (1) { - asm volatile("cpsid i"); + interrupt_disable(); t0 = get_time(); next_delay = __hw_clock_event_get() - t0.le.lo; @@ -1103,7 +1103,7 @@ void __idle(void) /* Normal idle : only CPU clock stopped */ asm("wfi"); } - asm volatile("cpsie i"); + interrupt_enable(); } } |