blob: cb78f9e6f09a91bf21a6e46498674ac12c268a18 [file] [log] [blame]
Ewout van Bekkum5bcd8c42020-11-23 10:46:16 -08001# 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
Rob Mohr5fc25412021-06-23 09:35:23 -070022licenses(["notice"])
Ewout van Bekkum5bcd8c42020-11-23 10:46:16 -080023
24pw_cc_library(
Ewout van Bekkumf7e38b32020-11-16 11:56:41 -080025 name = "binary_semaphore_headers",
26 hdrs = [
27 "public/pw_sync_threadx/binary_semaphore_inline.h",
28 "public/pw_sync_threadx/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 ],
Nathaniel Broughc2d57812021-04-18 22:52:00 +080036 target_compatible_with = [
37 "//pw_build/constraints/rtos:threadx",
38 ],
Ewout van Bekkumf7e38b32020-11-16 11:56:41 -080039 deps = [
Ewout van Bekkum72ebcdc2021-11-04 12:07:04 -070040 # TODO(pwbug/317): This should depend on ThreadX but our third parties
41 # currently do not have Bazel support.
Ewout van Bekkumf7e38b32020-11-16 11:56:41 -080042 "//pw_chrono:system_clock",
43 ],
44)
45
46pw_cc_library(
47 name = "binary_semaphore",
48 srcs = [
49 "binary_semaphore.cc",
50 ],
Nathaniel Broughc2d57812021-04-18 22:52:00 +080051 target_compatible_with = [
52 "//pw_build/constraints/rtos:threadx",
53 ],
Ewout van Bekkumf7e38b32020-11-16 11:56:41 -080054 deps = [
55 ":binary_semaphore_headers",
56 "//pw_chrono_threadx:system_clock_headers",
57 "//pw_interrupt:context",
58 "//pw_sync:binary_semaphore_facade",
59 ],
60)
61
62pw_cc_library(
63 name = "counting_semaphore_headers",
64 hdrs = [
65 "public/pw_sync_threadx/counting_semaphore_inline.h",
66 "public/pw_sync_threadx/counting_semaphore_native.h",
67 "public_overrides/pw_sync_backend/counting_semaphore_inline.h",
68 "public_overrides/pw_sync_backend/counting_semaphore_native.h",
69 ],
70 includes = [
71 "public",
72 "public_overrides",
73 ],
Nathaniel Broughc2d57812021-04-18 22:52:00 +080074 target_compatible_with = [
75 "//pw_build/constraints/rtos:threadx",
76 ],
Ewout van Bekkumf7e38b32020-11-16 11:56:41 -080077 deps = [
Ewout van Bekkum72ebcdc2021-11-04 12:07:04 -070078 # TODO(pwbug/317): This should depend on ThreadX but our third parties
79 # currently do not have Bazel support.
Ewout van Bekkumf7e38b32020-11-16 11:56:41 -080080 # do not have Bazel support.
81 "//pw_chrono:system_clock",
82 ],
83)
84
85pw_cc_library(
86 name = "counting_semaphore",
87 srcs = [
88 "counting_semaphore.cc",
89 ],
Nathaniel Broughc2d57812021-04-18 22:52:00 +080090 target_compatible_with = [
91 "//pw_build/constraints/rtos:threadx",
92 ],
Ewout van Bekkumf7e38b32020-11-16 11:56:41 -080093 deps = [
94 ":counting_semaphore_headers",
95 "//pw_chrono_threadx:system_clock_headers",
96 "//pw_interrupt:context",
97 "//pw_sync:counting_semaphore_facade",
98 ],
99)
100
101pw_cc_library(
102 name = "mutex_headers",
103 hdrs = [
104 "public/pw_sync_threadx/mutex_inline.h",
105 "public/pw_sync_threadx/mutex_native.h",
106 "public_overrides/pw_sync_backend/mutex_inline.h",
107 "public_overrides/pw_sync_backend/mutex_native.h",
108 ],
109 includes = [
110 "public",
111 "public_overrides",
112 ],
Nathaniel Broughc2d57812021-04-18 22:52:00 +0800113 target_compatible_with = [
114 "//pw_build/constraints/rtos:threadx",
115 ],
Ewout van Bekkumf7e38b32020-11-16 11:56:41 -0800116 deps = [
Ewout van Bekkum72ebcdc2021-11-04 12:07:04 -0700117 # TODO(pwbug/317): This should depend on ThreadX but our third parties currently
Ewout van Bekkumf7e38b32020-11-16 11:56:41 -0800118 # do not have Bazel support.
Ewout van Bekkum6f5b8fb2021-04-06 16:15:22 -0700119 "//pw_sync:mutex_facade",
Ewout van Bekkumf7e38b32020-11-16 11:56:41 -0800120 ],
121)
122
123pw_cc_library(
124 name = "mutex",
Nathaniel Broughc2d57812021-04-18 22:52:00 +0800125 target_compatible_with = [
126 "//pw_build/constraints/rtos:threadx",
127 ],
Ewout van Bekkumf7e38b32020-11-16 11:56:41 -0800128 deps = [
129 ":mutex_headers",
Ewout van Bekkum6f5b8fb2021-04-06 16:15:22 -0700130 "//pw_sync:mutex_facade",
131 ],
132)
133
134pw_cc_library(
135 name = "timed_mutex_headers",
136 hdrs = [
137 "public/pw_sync_threadx/timed_mutex_inline.h",
138 "public_overrides/pw_sync_backend/timed_mutex_inline.h",
139 ],
140 includes = [
141 "public",
142 "public_overrides",
143 ],
Nathaniel Broughc2d57812021-04-18 22:52:00 +0800144 target_compatible_with = [
145 "//pw_build/constraints/rtos:threadx",
146 ],
Ewout van Bekkum6f5b8fb2021-04-06 16:15:22 -0700147 deps = [
Ewout van Bekkum72ebcdc2021-11-04 12:07:04 -0700148 # TODO(pwbug/317): This should depend on ThreadX but our third parties currently
Ewout van Bekkum6f5b8fb2021-04-06 16:15:22 -0700149 # do not have Bazel support.
150 "//pw_chrono:system_clock",
151 "//pw_sync:timed_mutex_facade",
152 ],
153)
154
155pw_cc_library(
156 name = "timed_mutex",
157 srcs = [
158 "timed_mutex.cc",
159 ],
Nathaniel Broughc2d57812021-04-18 22:52:00 +0800160 target_compatible_with = [
161 "//pw_build/constraints/rtos:threadx",
162 ],
Ewout van Bekkum6f5b8fb2021-04-06 16:15:22 -0700163 deps = [
164 ":timed_mutex_headers",
Ewout van Bekkumf7e38b32020-11-16 11:56:41 -0800165 "//pw_chrono_threadx:system_clock_headers",
166 "//pw_interrupt:context",
Ewout van Bekkum6f5b8fb2021-04-06 16:15:22 -0700167 "//pw_sync:timed_mutex_facade",
Ewout van Bekkumf7e38b32020-11-16 11:56:41 -0800168 ],
169)
170
171pw_cc_library(
Ewout van Bekkum126e0112021-03-12 10:59:49 -0800172 name = "interrupt_spin_lock_headers",
Ewout van Bekkum5bcd8c42020-11-23 10:46:16 -0800173 hdrs = [
Ewout van Bekkum126e0112021-03-12 10:59:49 -0800174 "public/pw_sync_threadx/interrupt_spin_lock_inline.h",
175 "public/pw_sync_threadx/interrupt_spin_lock_native.h",
176 "public_overrides/pw_sync_backend/interrupt_spin_lock_inline.h",
177 "public_overrides/pw_sync_backend/interrupt_spin_lock_native.h",
Ewout van Bekkum5bcd8c42020-11-23 10:46:16 -0800178 ],
179 includes = [
180 "public",
181 "public_overrides",
182 ],
Ewout van Bekkum72ebcdc2021-11-04 12:07:04 -0700183 # TODO(pwbug/317): This should depend on ThreadX but our third parties currently
Ewout van Bekkum5bcd8c42020-11-23 10:46:16 -0800184 # do not have Bazel support.
Nathaniel Broughc2d57812021-04-18 22:52:00 +0800185 target_compatible_with = [
186 "//pw_build/constraints/rtos:threadx",
187 ],
Ewout van Bekkum5bcd8c42020-11-23 10:46:16 -0800188)
189
190pw_cc_library(
Ewout van Bekkum126e0112021-03-12 10:59:49 -0800191 name = "interrupt_spin_lock",
Ewout van Bekkum5bcd8c42020-11-23 10:46:16 -0800192 srcs = [
Ewout van Bekkum126e0112021-03-12 10:59:49 -0800193 "interrupt_spin_lock.cc",
Ewout van Bekkum5bcd8c42020-11-23 10:46:16 -0800194 ],
Nathaniel Broughc2d57812021-04-18 22:52:00 +0800195 target_compatible_with = [
196 "//pw_build/constraints/rtos:threadx",
197 ],
Ewout van Bekkum5bcd8c42020-11-23 10:46:16 -0800198 deps = [
Ewout van Bekkum126e0112021-03-12 10:59:49 -0800199 ":interrupt_spin_lock_headers",
200 "//pw_sync:interrupt_spin_lock_facade",
Ewout van Bekkum5bcd8c42020-11-23 10:46:16 -0800201 ],
202)