blob: b9129f9b02cba1fa46ea22df6b3571f62b910171 [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
22licenses(["notice"]) # Apache License 2.0
23
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 ],
36 deps = [
37 # TODO: This should depend on ThreadX but our third parties currently
38 # do not have Bazel support.
39 "//pw_chrono:system_clock",
40 ],
41)
42
43pw_cc_library(
44 name = "binary_semaphore",
45 srcs = [
46 "binary_semaphore.cc",
47 ],
48 deps = [
49 ":binary_semaphore_headers",
50 "//pw_chrono_threadx:system_clock_headers",
51 "//pw_interrupt:context",
52 "//pw_sync:binary_semaphore_facade",
53 ],
54)
55
56pw_cc_library(
57 name = "counting_semaphore_headers",
58 hdrs = [
59 "public/pw_sync_threadx/counting_semaphore_inline.h",
60 "public/pw_sync_threadx/counting_semaphore_native.h",
61 "public_overrides/pw_sync_backend/counting_semaphore_inline.h",
62 "public_overrides/pw_sync_backend/counting_semaphore_native.h",
63 ],
64 includes = [
65 "public",
66 "public_overrides",
67 ],
68 deps = [
69 # TODO: This should depend on ThreadX but our third parties currently
70 # do not have Bazel support.
71 "//pw_chrono:system_clock",
72 ],
73)
74
75pw_cc_library(
76 name = "counting_semaphore",
77 srcs = [
78 "counting_semaphore.cc",
79 ],
80 deps = [
81 ":counting_semaphore_headers",
82 "//pw_chrono_threadx:system_clock_headers",
83 "//pw_interrupt:context",
84 "//pw_sync:counting_semaphore_facade",
85 ],
86)
87
88pw_cc_library(
89 name = "mutex_headers",
90 hdrs = [
91 "public/pw_sync_threadx/mutex_inline.h",
92 "public/pw_sync_threadx/mutex_native.h",
93 "public_overrides/pw_sync_backend/mutex_inline.h",
94 "public_overrides/pw_sync_backend/mutex_native.h",
95 ],
96 includes = [
97 "public",
98 "public_overrides",
99 ],
100 deps = [
101 # TODO: This should depend on ThreadX but our third parties currently
102 # do not have Bazel support.
Ewout van Bekkum6f5b8fb2021-04-06 16:15:22 -0700103 "//pw_sync:mutex_facade",
Ewout van Bekkumf7e38b32020-11-16 11:56:41 -0800104 ],
105)
106
107pw_cc_library(
108 name = "mutex",
Ewout van Bekkumf7e38b32020-11-16 11:56:41 -0800109 deps = [
110 ":mutex_headers",
Ewout van Bekkum6f5b8fb2021-04-06 16:15:22 -0700111 "//pw_sync:mutex_facade",
112 ],
113)
114
115pw_cc_library(
116 name = "timed_mutex_headers",
117 hdrs = [
118 "public/pw_sync_threadx/timed_mutex_inline.h",
119 "public_overrides/pw_sync_backend/timed_mutex_inline.h",
120 ],
121 includes = [
122 "public",
123 "public_overrides",
124 ],
125 deps = [
126 # TODO: This should depend on ThreadX but our third parties currently
127 # do not have Bazel support.
128 "//pw_chrono:system_clock",
129 "//pw_sync:timed_mutex_facade",
130 ],
131)
132
133pw_cc_library(
134 name = "timed_mutex",
135 srcs = [
136 "timed_mutex.cc",
137 ],
138 deps = [
139 ":timed_mutex_headers",
Ewout van Bekkumf7e38b32020-11-16 11:56:41 -0800140 "//pw_chrono_threadx:system_clock_headers",
141 "//pw_interrupt:context",
Ewout van Bekkum6f5b8fb2021-04-06 16:15:22 -0700142 "//pw_sync:timed_mutex_facade",
Ewout van Bekkumf7e38b32020-11-16 11:56:41 -0800143 ],
144)
145
146pw_cc_library(
Ewout van Bekkum126e0112021-03-12 10:59:49 -0800147 name = "interrupt_spin_lock_headers",
Ewout van Bekkum5bcd8c42020-11-23 10:46:16 -0800148 hdrs = [
Ewout van Bekkum126e0112021-03-12 10:59:49 -0800149 "public/pw_sync_threadx/interrupt_spin_lock_inline.h",
150 "public/pw_sync_threadx/interrupt_spin_lock_native.h",
151 "public_overrides/pw_sync_backend/interrupt_spin_lock_inline.h",
152 "public_overrides/pw_sync_backend/interrupt_spin_lock_native.h",
Ewout van Bekkum5bcd8c42020-11-23 10:46:16 -0800153 ],
154 includes = [
155 "public",
156 "public_overrides",
157 ],
158 # TODO: This should depend on ThreadX but our third parties currently
159 # do not have Bazel support.
160)
161
162pw_cc_library(
Ewout van Bekkum126e0112021-03-12 10:59:49 -0800163 name = "interrupt_spin_lock",
Ewout van Bekkum5bcd8c42020-11-23 10:46:16 -0800164 srcs = [
Ewout van Bekkum126e0112021-03-12 10:59:49 -0800165 "interrupt_spin_lock.cc",
Ewout van Bekkum5bcd8c42020-11-23 10:46:16 -0800166 ],
167 deps = [
Ewout van Bekkum126e0112021-03-12 10:59:49 -0800168 ":interrupt_spin_lock_headers",
169 "//pw_sync:interrupt_spin_lock_facade",
Ewout van Bekkum5bcd8c42020-11-23 10:46:16 -0800170 ],
171)