1# Copyright 2021 The Pigweed Authors 2# 3# Licensed under the Apache License, Version 2.0 (the "License"); you may not 4# use this file except in compliance with the License. You may obtain a copy of 5# the License at 6# 7# https://www.apache.org/licenses/LICENSE-2.0 8# 9# Unless required by applicable law or agreed to in writing, software 10# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 11# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 12# License for the specific language governing permissions and limitations under 13# the License. 14 15load("@rules_cc//cc:cc_library.bzl", "cc_library") 16load("@rules_python//sphinxdocs:sphinx_docs_library.bzl", "sphinx_docs_library") 17load("//pw_build:compatibility.bzl", "incompatible_with_mcu") 18 19package(default_visibility = ["//visibility:public"]) 20 21licenses(["notice"]) 22 23cc_library( 24 name = "binary_semaphore", 25 srcs = [ 26 "binary_semaphore.cc", 27 ], 28 hdrs = [ 29 "public/pw_sync_embos/binary_semaphore_inline.h", 30 "public/pw_sync_embos/binary_semaphore_native.h", 31 "public_overrides/pw_sync_backend/binary_semaphore_inline.h", 32 "public_overrides/pw_sync_backend/binary_semaphore_native.h", 33 ], 34 implementation_deps = ["//pw_assert:check"], 35 includes = [ 36 "public", 37 "public_overrides", 38 ], 39 target_compatible_with = [ 40 "//pw_build/constraints/rtos:embos", 41 ], 42 # TODO: b/234876414 - This should depend on embOS but our third parties 43 # currently do not have Bazel support. 44 deps = [ 45 "//pw_assert:assert", 46 "//pw_chrono:system_clock", 47 "//pw_interrupt:context", 48 "//pw_sync:binary_semaphore.facade", 49 ], 50) 51 52cc_library( 53 name = "counting_semaphore", 54 srcs = [ 55 "counting_semaphore.cc", 56 ], 57 hdrs = [ 58 "public/pw_sync_embos/counting_semaphore_inline.h", 59 "public/pw_sync_embos/counting_semaphore_native.h", 60 "public_overrides/pw_sync_backend/counting_semaphore_inline.h", 61 "public_overrides/pw_sync_backend/counting_semaphore_native.h", 62 ], 63 implementation_deps = ["//pw_assert:check"], 64 includes = [ 65 "public", 66 "public_overrides", 67 ], 68 target_compatible_with = [ 69 "//pw_build/constraints/rtos:embos", 70 ], 71 # TODO: b/234876414 - This should depend on embOS but our third parties 72 # currently do not have Bazel support. 73 deps = [ 74 "//pw_assert:assert", 75 "//pw_chrono:system_clock", 76 "//pw_interrupt:context", 77 "//pw_sync:counting_semaphore.facade", 78 ], 79) 80 81cc_library( 82 name = "mutex", 83 hdrs = [ 84 "public/pw_sync_embos/mutex_inline.h", 85 "public/pw_sync_embos/mutex_native.h", 86 "public_overrides/pw_sync_backend/mutex_inline.h", 87 "public_overrides/pw_sync_backend/mutex_native.h", 88 ], 89 includes = [ 90 "public", 91 "public_overrides", 92 ], 93 target_compatible_with = [ 94 "//pw_build/constraints/rtos:embos", 95 ], 96 # TODO: b/234876414 - This should depend on embOS but our third parties 97 # currently do not have Bazel support. 98 deps = [ 99 ":mutex_headers", 100 "//pw_assert:assert", 101 "//pw_sync:mutex.facade", 102 ], 103) 104 105cc_library( 106 name = "timed_mutex", 107 srcs = [ 108 "timed_mutex.cc", 109 ], 110 hdrs = [ 111 "public/pw_sync_embos/timed_mutex_inline.h", 112 "public_overrides/pw_sync_backend/timed_mutex_inline.h", 113 ], 114 implementation_deps = ["//pw_assert:check"], 115 includes = [ 116 "public", 117 "public_overrides", 118 ], 119 target_compatible_with = [ 120 "//pw_build/constraints/rtos:embos", 121 ], 122 # TODO: b/234876414 - This should depend on embOS but our third parties 123 # currently do not have Bazel support. 124 deps = [ 125 "//pw_chrono:system_clock", 126 "//pw_interrupt:context", 127 "//pw_sync:timed_mutex.facade", 128 ], 129) 130 131cc_library( 132 name = "interrupt_spin_lock_headers", 133 target_compatible_with = [ 134 "//pw_build/constraints/rtos:embos", 135 ], 136) 137 138cc_library( 139 name = "interrupt_spin_lock", 140 srcs = [ 141 "interrupt_spin_lock.cc", 142 ], 143 hdrs = [ 144 "public/pw_sync_embos/interrupt_spin_lock_inline.h", 145 "public/pw_sync_embos/interrupt_spin_lock_native.h", 146 "public_overrides/pw_sync_backend/interrupt_spin_lock_inline.h", 147 "public_overrides/pw_sync_backend/interrupt_spin_lock_native.h", 148 ], 149 implementation_deps = ["//pw_assert:check"], 150 includes = [ 151 "public", 152 "public_overrides", 153 ], 154 target_compatible_with = [ 155 "//pw_build/constraints/rtos:embos", 156 ], 157 # TODO: b/234876414 - This should depend on embOS but our third parties 158 # currently do not have Bazel support. 159 deps = [ 160 "//pw_sync:interrupt_spin_lock.facade", 161 ], 162) 163 164sphinx_docs_library( 165 name = "docs", 166 srcs = [ 167 "docs.rst", 168 ], 169 prefix = "pw_sync_embos/", 170 target_compatible_with = incompatible_with_mcu(), 171) 172