diff options
author | Dawid Niedzwiecki <dn@semihalf.com> | 2020-10-07 12:13:52 +0200 |
---|---|---|
committer | Commit Bot <commit-bot@chromium.org> | 2020-10-27 09:35:49 +0000 |
commit | a05f7b9f469e7c171f4a737968ab5cbd11ba1253 (patch) | |
tree | ab128a89ce9206ca967ad104e307d6c0b4c33a52 /driver/ppc | |
parent | 3cba51e9e807e7015d81c2891c47ea4c59587a1c (diff) | |
download | chrome-ec-a05f7b9f469e7c171f4a737968ab5cbd11ba1253.tar.gz |
tree: Use new atomic_* implementation
It is done as a part of porting to Zephyr.
Since the implementation of atomic functions is done for all architectures
use atomic_* instead of deprecated_atomic_*.
Sometimes there was a compilation error "discards 'volatile' qualifier"
due to dropping "volatile" in the argument of the functions, thus
some pointers casts need to be made. It shouldn't cause any issues,
because we are sure about generated asm (store operation will be
performed).
BUG=b:169151160
BRANCH=none
TEST=buildall
Signed-off-by: Dawid Niedzwiecki <dn@semihalf.com>
Change-Id: I98f590c323c3af52035e62825e8acfa358e0805a
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2478949
Tested-by: Jett Rink <jettrink@chromium.org>
Reviewed-by: Jett Rink <jettrink@chromium.org>
Reviewed-by: Tom Hughes <tomhughes@chromium.org>
Diffstat (limited to 'driver/ppc')
-rw-r--r-- | driver/ppc/aoz1380.c | 9 | ||||
-rw-r--r-- | driver/ppc/nx20p348x.c | 4 | ||||
-rw-r--r-- | driver/ppc/sn5s330.c | 4 | ||||
-rw-r--r-- | driver/ppc/syv682x.c | 4 |
4 files changed, 10 insertions, 11 deletions
diff --git a/driver/ppc/aoz1380.c b/driver/ppc/aoz1380.c index c4d3cc6056..4936647f37 100644 --- a/driver/ppc/aoz1380.c +++ b/driver/ppc/aoz1380.c @@ -32,9 +32,8 @@ static uint32_t irq_pending; /* Bitmask of ports signaling an interrupt. */ #define AOZ1380_FLAGS_INT_ON_DISCONNECT BIT(2) static uint32_t flags[CONFIG_USB_PD_PORT_MAX_COUNT]; -#define AOZ1380_SET_FLAG(port, flag) deprecated_atomic_or(&flags[port], (flag)) -#define AOZ1380_CLR_FLAG(port, flag) \ - deprecated_atomic_clear_bits(&flags[port], (flag)) +#define AOZ1380_SET_FLAG(port, flag) atomic_or(&flags[port], (flag)) +#define AOZ1380_CLR_FLAG(port, flag) atomic_clear_bits(&flags[port], (flag)) static int aoz1380_init(int port) { @@ -144,7 +143,7 @@ static void aoz1380_handle_interrupt(int port) static void aoz1380_irq_deferred(void) { int i; - uint32_t pending = deprecated_atomic_read_clear(&irq_pending); + uint32_t pending = atomic_read_clear(&irq_pending); for (i = 0; i < board_get_usb_pd_port_count(); i++) if (BIT(i) & pending) @@ -154,7 +153,7 @@ DECLARE_DEFERRED(aoz1380_irq_deferred); void aoz1380_interrupt(int port) { - deprecated_atomic_or(&irq_pending, BIT(port)); + atomic_or(&irq_pending, BIT(port)); hook_call_deferred(&aoz1380_irq_deferred_data, 0); } diff --git a/driver/ppc/nx20p348x.c b/driver/ppc/nx20p348x.c index c13087fa52..8142681bb4 100644 --- a/driver/ppc/nx20p348x.c +++ b/driver/ppc/nx20p348x.c @@ -384,7 +384,7 @@ static void nx20p348x_handle_interrupt(int port) static void nx20p348x_irq_deferred(void) { int i; - uint32_t pending = deprecated_atomic_read_clear(&irq_pending); + uint32_t pending = atomic_read_clear(&irq_pending); for (i = 0; i < board_get_usb_pd_port_count(); i++) if (BIT(i) & pending) @@ -394,7 +394,7 @@ DECLARE_DEFERRED(nx20p348x_irq_deferred); void nx20p348x_interrupt(int port) { - deprecated_atomic_or(&irq_pending, BIT(port)); + atomic_or(&irq_pending, BIT(port)); hook_call_deferred(&nx20p348x_irq_deferred_data, 0); } diff --git a/driver/ppc/sn5s330.c b/driver/ppc/sn5s330.c index 0de09ca60d..f177efa10c 100644 --- a/driver/ppc/sn5s330.c +++ b/driver/ppc/sn5s330.c @@ -712,7 +712,7 @@ static void sn5s330_handle_interrupt(int port) static void sn5s330_irq_deferred(void) { int i; - uint32_t pending = deprecated_atomic_read_clear(&irq_pending); + uint32_t pending = atomic_read_clear(&irq_pending); for (i = 0; i < board_get_usb_pd_port_count(); i++) if (BIT(i) & pending) @@ -722,7 +722,7 @@ DECLARE_DEFERRED(sn5s330_irq_deferred); void sn5s330_interrupt(int port) { - deprecated_atomic_or(&irq_pending, BIT(port)); + atomic_or(&irq_pending, BIT(port)); hook_call_deferred(&sn5s330_irq_deferred_data, 0); } diff --git a/driver/ppc/syv682x.c b/driver/ppc/syv682x.c index 32508a87cf..714406a366 100644 --- a/driver/ppc/syv682x.c +++ b/driver/ppc/syv682x.c @@ -499,7 +499,7 @@ static void syv682x_handle_interrupt(int port) static void syv682x_irq_deferred(void) { int i; - uint32_t pending = deprecated_atomic_read_clear(&irq_pending); + uint32_t pending = atomic_read_clear(&irq_pending); for (i = 0; i < board_get_usb_pd_port_count(); i++) if (BIT(i) & pending) @@ -509,7 +509,7 @@ DECLARE_DEFERRED(syv682x_irq_deferred); static void syv682x_interrupt_delayed(int port, int delay) { - deprecated_atomic_or(&irq_pending, BIT(port)); + atomic_or(&irq_pending, BIT(port)); hook_call_deferred(&syv682x_irq_deferred_data, delay * MSEC); } |