1# Copyright 2020 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( 16 "//pw_build:pigweed.bzl", 17 "pw_cc_library", 18) 19 20package(default_visibility = ["//visibility:public"]) 21 22licenses(["notice"]) 23 24pw_cc_library( 25 name = "binary_semaphore_headers", 26 hdrs = [ 27 "public/pw_sync_freertos/binary_semaphore_inline.h", 28 "public/pw_sync_freertos/binary_semaphore_native.h", 29 "public_overrides/pw_sync_backend/binary_semaphore_inline.h", 30 "public_overrides/pw_sync_backend/binary_semaphore_native.h", 31 ], 32 includes = [ 33 "public", 34 "public_overrides", 35 ], 36 target_compatible_with = [ 37 "//pw_build/constraints/rtos:freertos", 38 ], 39 deps = [ 40 # TODO(pwbug/317): This should depend on FreeRTOS but our third parties currently 41 # do not have Bazel support. 42 "//pw_assert", 43 "//pw_chrono:system_clock", 44 "//pw_chrono_freertos:system_clock_headers", 45 ], 46) 47 48pw_cc_library( 49 name = "binary_semaphore", 50 srcs = [ 51 "binary_semaphore.cc", 52 ], 53 target_compatible_with = [ 54 "//pw_build/constraints/rtos:freertos", 55 ], 56 deps = [ 57 ":binary_semaphore_headers", 58 "//pw_assert", 59 "//pw_interrupt:context", 60 "//pw_sync:binary_semaphore_facade", 61 ], 62) 63 64pw_cc_library( 65 name = "counting_semaphore_headers", 66 hdrs = [ 67 "public/pw_sync_freertos/counting_semaphore_inline.h", 68 "public/pw_sync_freertos/counting_semaphore_native.h", 69 "public_overrides/pw_sync_backend/counting_semaphore_inline.h", 70 "public_overrides/pw_sync_backend/counting_semaphore_native.h", 71 ], 72 includes = [ 73 "public", 74 "public_overrides", 75 ], 76 target_compatible_with = [ 77 "//pw_build/constraints/rtos:freertos", 78 ], 79 deps = [ 80 # TODO(pwbug/317): This should depend on FreeRTOS but our third parties currently 81 # do not have Bazel support. 82 "//pw_assert", 83 "//pw_sync:counting_semaphore_facade", 84 "//pw_chrono:system_clock", 85 "//pw_chrono_freertos:system_clock_headers", 86 ], 87) 88 89pw_cc_library( 90 name = "counting_semaphore", 91 srcs = [ 92 "counting_semaphore.cc", 93 ], 94 target_compatible_with = [ 95 "//pw_build/constraints/rtos:freertos", 96 ], 97 deps = [ 98 ":counting_semaphore_headers", 99 "//pw_assert", 100 "//pw_interrupt:context", 101 "//pw_sync:counting_semaphore_facade", 102 ], 103) 104 105pw_cc_library( 106 name = "mutex_headers", 107 hdrs = [ 108 "public/pw_sync_freertos/mutex_inline.h", 109 "public/pw_sync_freertos/mutex_native.h", 110 "public_overrides/pw_sync_backend/mutex_inline.h", 111 "public_overrides/pw_sync_backend/mutex_native.h", 112 ], 113 includes = [ 114 "public", 115 "public_overrides", 116 ], 117 target_compatible_with = [ 118 "//pw_build/constraints/rtos:freertos", 119 ], 120 deps = [ 121 # TODO(pwbug/317): This should depend on FreeRTOS but our third parties currently 122 # do not have Bazel support. 123 "//pw_assert", 124 ], 125) 126 127pw_cc_library( 128 name = "mutex", 129 target_compatible_with = [ 130 "//pw_build/constraints/rtos:freertos", 131 ], 132 deps = [ 133 ":mutex_headers", 134 "//pw_sync:mutex_facade", 135 ], 136) 137 138pw_cc_library( 139 name = "thread_notification_headers", 140 hdrs = [ 141 "public/pw_sync_freertos/config.h", 142 "public/pw_sync_freertos/thread_notification_inline.h", 143 "public/pw_sync_freertos/thread_notification_native.h", 144 "public_overrides/thread_notification/pw_sync_backend/thread_notification_inline.h", 145 "public_overrides/thread_notification/pw_sync_backend/thread_notification_native.h", 146 ], 147 includes = [ 148 "public", 149 "public_overrides/thread_notification", 150 ], 151 target_compatible_with = [ 152 "//pw_build/constraints/rtos:freertos", 153 ], 154 deps = [ 155 # TODO(pwbug/317): This should depend on FreeRTOS but our third parties 156 # currently do not have Bazel support. 157 "//pw_interrupt:context", 158 ], 159) 160 161pw_cc_library( 162 name = "thread_notification", 163 srcs = [ 164 "thread_notification.cc", 165 ], 166 target_compatible_with = [ 167 "//pw_build/constraints/rtos:freertos", 168 ], 169 deps = [ 170 ":thread_notification_headers", 171 "//pw_assert", 172 "//pw_interrupt:context", 173 "//pw_sync:thread_notification_facade", 174 ], 175) 176 177pw_cc_library( 178 name = "timed_thread_notification_headers", 179 hdrs = [ 180 "public/pw_sync_freertos/timed_thread_notification_inline.h", 181 "public_overrides/timed_thread_notification/pw_sync_backend/timed_thread_notification_inline.h", 182 ], 183 includes = [ 184 "public", 185 "public_overrides/timed_thread_notification", 186 ], 187 target_compatible_with = [ 188 "//pw_build/constraints/rtos:freertos", 189 ], 190 deps = [ 191 # TODO(pwbug/317): This should depend on FreeRTOS but our third parties 192 # currently do not have Bazel support. 193 "//pw_chrono:system_clock", 194 "//pw_sync:timed_thread_notification_facade", 195 ], 196) 197 198pw_cc_library( 199 name = "timed_thread_notification", 200 srcs = [ 201 "timed_thread_notification.cc", 202 ], 203 target_compatible_with = [ 204 "//pw_build/constraints/rtos:freertos", 205 ], 206 deps = [ 207 ":timed_thread_notification_headers", 208 "//pw_assert", 209 "//pw_chrono_freertos:system_clock_headers", 210 "//pw_interrupt:context", 211 "//pw_sync:timed_thread_notification_facade", 212 ], 213) 214 215pw_cc_library( 216 name = "timed_mutex_headers", 217 hdrs = [ 218 "public/pw_sync_freertos/timed_mutex_inline.h", 219 "public_overrides/pw_sync_backend/timed_mutex_inline.h", 220 ], 221 includes = [ 222 "public", 223 "public_overrides", 224 ], 225 target_compatible_with = [ 226 "//pw_build/constraints/rtos:freertos", 227 ], 228 deps = [ 229 # TODO(pwbug/317): This should depend on FreeRTOS but our third parties 230 # currently do not have Bazel support. 231 "//pw_chrono:system_clock", 232 "//pw_sync:timed_mutex_facade", 233 ], 234) 235 236pw_cc_library( 237 name = "timed_mutex", 238 srcs = [ 239 "timed_mutex.cc", 240 ], 241 target_compatible_with = [ 242 "//pw_build/constraints/rtos:freertos", 243 ], 244 deps = [ 245 ":timed_mutex_headers", 246 "//pw_assert", 247 "//pw_chrono_freertos:system_clock_headers", 248 "//pw_interrupt:context", 249 "//pw_sync:timed_mutex_facade", 250 ], 251) 252 253pw_cc_library( 254 name = "interrupt_spin_lock_headers", 255 hdrs = [ 256 "public/pw_sync_freertos/interrupt_spin_lock_inline.h", 257 "public/pw_sync_freertos/interrupt_spin_lock_native.h", 258 "public_overrides/pw_sync_backend/interrupt_spin_lock_inline.h", 259 "public_overrides/pw_sync_backend/interrupt_spin_lock_native.h", 260 ], 261 includes = [ 262 "public", 263 "public_overrides", 264 ], 265 target_compatible_with = [ 266 "//pw_build/constraints/rtos:freertos", 267 ], 268 # TODO(pwbug/317): This should depend on FreeRTOS but our third parties 269 # currently do not have Bazel support. 270) 271 272pw_cc_library( 273 name = "interrupt_spin_lock", 274 srcs = [ 275 "interrupt_spin_lock.cc", 276 ], 277 target_compatible_with = [ 278 "//pw_build/constraints/rtos:freertos", 279 ], 280 deps = [ 281 ":interrupt_spin_lock_headers", 282 "//pw_assert", 283 "//pw_interrupt:context", 284 "//pw_sync:interrupt_spin_lock_facade", 285 ], 286) 287