Skip to content

Commit

Permalink
pw_bluetooth_sapphire: Configure interrupt spin lock backend for Fuchsia
Browse files Browse the repository at this point in the history
Change-Id: If2bf242c729a8381fb2e492d6c42c1d7e2f2c328
Reviewed-on: https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/247773
Docs-Not-Needed: Ben Lawson <[email protected]>
Lint: Lint 🤖 <[email protected]>
Reviewed-by: Taylor Cramer <[email protected]>
Commit-Queue: Ben Lawson <[email protected]>
  • Loading branch information
BenjaminLawson authored and CQ Bot Account committed Nov 8, 2024
1 parent dbc5ec0 commit a150a8d
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
1 change: 1 addition & 0 deletions pw_bluetooth_sapphire/fuchsia/backends.bazelrc
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ common:fuchsia --@pigweed//pw_log:backend_impl=@pigweed//pw_build:empty_cc_libra
common:fuchsia --@pigweed//pw_unit_test:backend=@pigweed//pw_unit_test:googletest
common:fuchsia --@pigweed//pw_async:task_backend=@pigweed//pw_async_fuchsia:task
common:fuchsia --@pigweed//pw_async:fake_dispatcher_backend=@pigweed//pw_async_fuchsia:fake_dispatcher
common:fuchsia --@pigweed//pw_sync:interrupt_spin_lock_backend=@pigweed//pw_sync_stl:interrupt_spin_lock

# TODO: https://pwbug.dev/374340793 - This is a temporary workaround for now and
# this command line option shouldn't be applied more widely.
Expand Down
4 changes: 4 additions & 0 deletions pw_sync/public/pw_sync/yield_core.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,10 @@
#elif defined(__aarch64__) || defined(__arm__)
#define PW_SYNC_YIELD_CORE_FOR_SMT() asm volatile("yield" ::: "memory")

#elif defined(__Fuchsia__)
#include <zircon/syscalls.h>
#define PW_SYNC_YIELD_CORE_FOR_SMT() zx_thread_legacy_yield(0)

#else
#error "No processor yield implementation for this architecture."

Expand Down

0 comments on commit a150a8d

Please sign in to comment.