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("@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_threadx/binary_semaphore_inline.h", 30 "public/pw_sync_threadx/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:threadx", 41 ], 42 # TODO: b/290364219 - Add threadx as a dependency. 43 deps = [ 44 "//pw_assert:assert", 45 "//pw_chrono:system_clock", 46 "//pw_interrupt:context", 47 "//pw_sync:binary_semaphore.facade", 48 ], 49) 50 51cc_library( 52 name = "counting_semaphore", 53 srcs = [ 54 "counting_semaphore.cc", 55 ], 56 hdrs = [ 57 "public/pw_sync_threadx/counting_semaphore_inline.h", 58 "public/pw_sync_threadx/counting_semaphore_native.h", 59 "public_overrides/pw_sync_backend/counting_semaphore_inline.h", 60 "public_overrides/pw_sync_backend/counting_semaphore_native.h", 61 ], 62 implementation_deps = ["//pw_assert:check"], 63 includes = [ 64 "public", 65 "public_overrides", 66 ], 67 target_compatible_with = [ 68 "//pw_build/constraints/rtos:threadx", 69 ], 70 # TODO: b/290364219 - Add threadx as a dependency. 71 deps = [ 72 "//pw_assert:assert", 73 "//pw_chrono:system_clock", 74 "//pw_interrupt:context", 75 "//pw_sync:counting_semaphore.facade", 76 ], 77) 78 79cc_library( 80 name = "mutex", 81 hdrs = [ 82 "public/pw_sync_threadx/mutex_inline.h", 83 "public/pw_sync_threadx/mutex_native.h", 84 "public_overrides/pw_sync_backend/mutex_inline.h", 85 "public_overrides/pw_sync_backend/mutex_native.h", 86 ], 87 includes = [ 88 "public", 89 "public_overrides", 90 ], 91 target_compatible_with = [ 92 "//pw_build/constraints/rtos:threadx", 93 ], 94 # TODO: b/290364219 - Add threadx as a dependency. 95 deps = [ 96 "//pw_assert:assert", 97 "//pw_sync:mutex.facade", 98 ], 99) 100 101cc_library( 102 name = "timed_mutex", 103 srcs = [ 104 "timed_mutex.cc", 105 ], 106 hdrs = [ 107 "public/pw_sync_threadx/timed_mutex_inline.h", 108 "public_overrides/pw_sync_backend/timed_mutex_inline.h", 109 ], 110 implementation_deps = ["//pw_assert:check"], 111 includes = [ 112 "public", 113 "public_overrides", 114 ], 115 target_compatible_with = [ 116 "//pw_build/constraints/rtos:threadx", 117 ], 118 # TODO: b/290364219 - Add threadx as a dependency. 119 deps = [ 120 "//pw_chrono:system_clock", 121 "//pw_interrupt:context", 122 "//pw_sync:timed_mutex.facade", 123 ], 124) 125 126cc_library( 127 name = "interrupt_spin_lock", 128 srcs = [ 129 "interrupt_spin_lock.cc", 130 ], 131 hdrs = [ 132 "public/pw_sync_threadx/interrupt_spin_lock_inline.h", 133 "public/pw_sync_threadx/interrupt_spin_lock_native.h", 134 "public_overrides/pw_sync_backend/interrupt_spin_lock_inline.h", 135 "public_overrides/pw_sync_backend/interrupt_spin_lock_native.h", 136 ], 137 implementation_deps = ["//pw_assert:check"], 138 includes = [ 139 "public", 140 "public_overrides", 141 ], 142 target_compatible_with = [ 143 "//pw_build/constraints/rtos:threadx", 144 ], 145 # TODO: b/290364219 - Add threadx as a dependency. 146 deps = [ 147 "//pw_sync:interrupt_spin_lock.facade", 148 ], 149) 150 151sphinx_docs_library( 152 name = "docs", 153 srcs = [ 154 "docs.rst", 155 ], 156 prefix = "pw_sync_threadx/", 157 target_compatible_with = incompatible_with_mcu(), 158) 159