From a150a8d30a5fc4c70f788aa803ffadb10e74b287 Mon Sep 17 00:00:00 2001 From: Ben Date: Fri, 8 Nov 2024 17:32:09 +0000 Subject: [PATCH] pw_bluetooth_sapphire: Configure interrupt spin lock backend for Fuchsia MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Change-Id: If2bf242c729a8381fb2e492d6c42c1d7e2f2c328 Reviewed-on: https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/247773 Docs-Not-Needed: Ben Lawson Lint: Lint 🤖 Reviewed-by: Taylor Cramer Commit-Queue: Ben Lawson --- pw_bluetooth_sapphire/fuchsia/backends.bazelrc | 1 + pw_sync/public/pw_sync/yield_core.h | 4 ++++ 2 files changed, 5 insertions(+) diff --git a/pw_bluetooth_sapphire/fuchsia/backends.bazelrc b/pw_bluetooth_sapphire/fuchsia/backends.bazelrc index bca99e5507..83f57d2837 100644 --- a/pw_bluetooth_sapphire/fuchsia/backends.bazelrc +++ b/pw_bluetooth_sapphire/fuchsia/backends.bazelrc @@ -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. diff --git a/pw_sync/public/pw_sync/yield_core.h b/pw_sync/public/pw_sync/yield_core.h index 4a04e2b0fb..313b1350ab 100644 --- a/pw_sync/public/pw_sync/yield_core.h +++ b/pw_sync/public/pw_sync/yield_core.h @@ -22,6 +22,10 @@ #elif defined(__aarch64__) || defined(__arm__) #define PW_SYNC_YIELD_CORE_FOR_SMT() asm volatile("yield" ::: "memory") +#elif defined(__Fuchsia__) +#include +#define PW_SYNC_YIELD_CORE_FOR_SMT() zx_thread_legacy_yield(0) + #else #error "No processor yield implementation for this architecture."