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 /board/samus_pd/board.c | |
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 'board/samus_pd/board.c')
-rw-r--r-- | board/samus_pd/board.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/board/samus_pd/board.c b/board/samus_pd/board.c index 0f9c8cfbfe..926baf78cc 100644 --- a/board/samus_pd/board.c +++ b/board/samus_pd/board.c @@ -491,8 +491,8 @@ void pd_send_host_event(int mask) if (!mask) return; - deprecated_atomic_or(&(host_event_status_flags), mask); - deprecated_atomic_or(&(pd_status_flags), PD_STATUS_HOST_EVENT); + atomic_or(&(host_event_status_flags), mask); + atomic_or(&(pd_status_flags), PD_STATUS_HOST_EVENT); pd_send_ec_int(); } @@ -593,7 +593,7 @@ static enum ec_status ec_status_host_cmd(struct host_cmd_handler_args *args) r->status = pd_status_flags; /* Clear host event */ - deprecated_atomic_clear_bits(&(pd_status_flags), PD_STATUS_HOST_EVENT); + atomic_clear_bits(&(pd_status_flags), PD_STATUS_HOST_EVENT); args->response_size = sizeof(*r); @@ -608,10 +608,10 @@ host_event_status_host_cmd(struct host_cmd_handler_args *args) struct ec_response_host_event_status *r = args->response; /* Clear host event bit to avoid sending more unnecessary events */ - deprecated_atomic_clear_bits(&(pd_status_flags), PD_STATUS_HOST_EVENT); + atomic_clear_bits(&(pd_status_flags), PD_STATUS_HOST_EVENT); /* Read and clear the host event status to return to AP */ - r->status = deprecated_atomic_read_clear(&(host_event_status_flags)); + r->status = atomic_read_clear(&(host_event_status_flags)); args->response_size = sizeof(*r); return EC_RES_SUCCESS; |