Ewout van Bekkum | 5bcd8c4 | 2020-11-23 10:46:16 -0800 | [diff] [blame] | 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 | |
| 15 | load( |
| 16 | "//pw_build:pigweed.bzl", |
| 17 | "pw_cc_library", |
| 18 | ) |
| 19 | |
| 20 | package(default_visibility = ["//visibility:public"]) |
| 21 | |
| 22 | licenses(["notice"]) # Apache License 2.0 |
| 23 | |
| 24 | pw_cc_library( |
Ewout van Bekkum | f7e38b3 | 2020-11-16 11:56:41 -0800 | [diff] [blame] | 25 | 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 Brough | c2d5781 | 2021-04-18 22:52:00 +0800 | [diff] [blame] | 36 | target_compatible_with = [ |
| 37 | "//pw_build/constraints/rtos:threadx", |
| 38 | ], |
Ewout van Bekkum | f7e38b3 | 2020-11-16 11:56:41 -0800 | [diff] [blame] | 39 | deps = [ |
| 40 | # TODO: This should depend on ThreadX but our third parties currently |
| 41 | # do not have Bazel support. |
| 42 | "//pw_chrono:system_clock", |
| 43 | ], |
| 44 | ) |
| 45 | |
| 46 | pw_cc_library( |
| 47 | name = "binary_semaphore", |
| 48 | srcs = [ |
| 49 | "binary_semaphore.cc", |
| 50 | ], |
Nathaniel Brough | c2d5781 | 2021-04-18 22:52:00 +0800 | [diff] [blame] | 51 | target_compatible_with = [ |
| 52 | "//pw_build/constraints/rtos:threadx", |
| 53 | ], |
Ewout van Bekkum | f7e38b3 | 2020-11-16 11:56:41 -0800 | [diff] [blame] | 54 | 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 | |
| 62 | pw_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 Brough | c2d5781 | 2021-04-18 22:52:00 +0800 | [diff] [blame] | 74 | target_compatible_with = [ |
| 75 | "//pw_build/constraints/rtos:threadx", |
| 76 | ], |
Ewout van Bekkum | f7e38b3 | 2020-11-16 11:56:41 -0800 | [diff] [blame] | 77 | deps = [ |
| 78 | # TODO: This should depend on ThreadX but our third parties currently |
| 79 | # do not have Bazel support. |
| 80 | "//pw_chrono:system_clock", |
| 81 | ], |
| 82 | ) |
| 83 | |
| 84 | pw_cc_library( |
| 85 | name = "counting_semaphore", |
| 86 | srcs = [ |
| 87 | "counting_semaphore.cc", |
| 88 | ], |
Nathaniel Brough | c2d5781 | 2021-04-18 22:52:00 +0800 | [diff] [blame] | 89 | target_compatible_with = [ |
| 90 | "//pw_build/constraints/rtos:threadx", |
| 91 | ], |
Ewout van Bekkum | f7e38b3 | 2020-11-16 11:56:41 -0800 | [diff] [blame] | 92 | deps = [ |
| 93 | ":counting_semaphore_headers", |
| 94 | "//pw_chrono_threadx:system_clock_headers", |
| 95 | "//pw_interrupt:context", |
| 96 | "//pw_sync:counting_semaphore_facade", |
| 97 | ], |
| 98 | ) |
| 99 | |
| 100 | pw_cc_library( |
| 101 | name = "mutex_headers", |
| 102 | hdrs = [ |
| 103 | "public/pw_sync_threadx/mutex_inline.h", |
| 104 | "public/pw_sync_threadx/mutex_native.h", |
| 105 | "public_overrides/pw_sync_backend/mutex_inline.h", |
| 106 | "public_overrides/pw_sync_backend/mutex_native.h", |
| 107 | ], |
| 108 | includes = [ |
| 109 | "public", |
| 110 | "public_overrides", |
| 111 | ], |
Nathaniel Brough | c2d5781 | 2021-04-18 22:52:00 +0800 | [diff] [blame] | 112 | target_compatible_with = [ |
| 113 | "//pw_build/constraints/rtos:threadx", |
| 114 | ], |
Ewout van Bekkum | f7e38b3 | 2020-11-16 11:56:41 -0800 | [diff] [blame] | 115 | deps = [ |
| 116 | # TODO: This should depend on ThreadX but our third parties currently |
| 117 | # do not have Bazel support. |
Ewout van Bekkum | 6f5b8fb | 2021-04-06 16:15:22 -0700 | [diff] [blame] | 118 | "//pw_sync:mutex_facade", |
Ewout van Bekkum | f7e38b3 | 2020-11-16 11:56:41 -0800 | [diff] [blame] | 119 | ], |
| 120 | ) |
| 121 | |
| 122 | pw_cc_library( |
| 123 | name = "mutex", |
Nathaniel Brough | c2d5781 | 2021-04-18 22:52:00 +0800 | [diff] [blame] | 124 | target_compatible_with = [ |
| 125 | "//pw_build/constraints/rtos:threadx", |
| 126 | ], |
Ewout van Bekkum | f7e38b3 | 2020-11-16 11:56:41 -0800 | [diff] [blame] | 127 | deps = [ |
| 128 | ":mutex_headers", |
Ewout van Bekkum | 6f5b8fb | 2021-04-06 16:15:22 -0700 | [diff] [blame] | 129 | "//pw_sync:mutex_facade", |
| 130 | ], |
| 131 | ) |
| 132 | |
| 133 | pw_cc_library( |
| 134 | name = "timed_mutex_headers", |
| 135 | hdrs = [ |
| 136 | "public/pw_sync_threadx/timed_mutex_inline.h", |
| 137 | "public_overrides/pw_sync_backend/timed_mutex_inline.h", |
| 138 | ], |
| 139 | includes = [ |
| 140 | "public", |
| 141 | "public_overrides", |
| 142 | ], |
Nathaniel Brough | c2d5781 | 2021-04-18 22:52:00 +0800 | [diff] [blame] | 143 | target_compatible_with = [ |
| 144 | "//pw_build/constraints/rtos:threadx", |
| 145 | ], |
Ewout van Bekkum | 6f5b8fb | 2021-04-06 16:15:22 -0700 | [diff] [blame] | 146 | deps = [ |
| 147 | # TODO: This should depend on ThreadX but our third parties currently |
| 148 | # do not have Bazel support. |
| 149 | "//pw_chrono:system_clock", |
| 150 | "//pw_sync:timed_mutex_facade", |
| 151 | ], |
| 152 | ) |
| 153 | |
| 154 | pw_cc_library( |
| 155 | name = "timed_mutex", |
| 156 | srcs = [ |
| 157 | "timed_mutex.cc", |
| 158 | ], |
Nathaniel Brough | c2d5781 | 2021-04-18 22:52:00 +0800 | [diff] [blame] | 159 | target_compatible_with = [ |
| 160 | "//pw_build/constraints/rtos:threadx", |
| 161 | ], |
Ewout van Bekkum | 6f5b8fb | 2021-04-06 16:15:22 -0700 | [diff] [blame] | 162 | deps = [ |
| 163 | ":timed_mutex_headers", |
Ewout van Bekkum | f7e38b3 | 2020-11-16 11:56:41 -0800 | [diff] [blame] | 164 | "//pw_chrono_threadx:system_clock_headers", |
| 165 | "//pw_interrupt:context", |
Ewout van Bekkum | 6f5b8fb | 2021-04-06 16:15:22 -0700 | [diff] [blame] | 166 | "//pw_sync:timed_mutex_facade", |
Ewout van Bekkum | f7e38b3 | 2020-11-16 11:56:41 -0800 | [diff] [blame] | 167 | ], |
| 168 | ) |
| 169 | |
| 170 | pw_cc_library( |
Ewout van Bekkum | 126e011 | 2021-03-12 10:59:49 -0800 | [diff] [blame] | 171 | name = "interrupt_spin_lock_headers", |
Ewout van Bekkum | 5bcd8c4 | 2020-11-23 10:46:16 -0800 | [diff] [blame] | 172 | hdrs = [ |
Ewout van Bekkum | 126e011 | 2021-03-12 10:59:49 -0800 | [diff] [blame] | 173 | "public/pw_sync_threadx/interrupt_spin_lock_inline.h", |
| 174 | "public/pw_sync_threadx/interrupt_spin_lock_native.h", |
| 175 | "public_overrides/pw_sync_backend/interrupt_spin_lock_inline.h", |
| 176 | "public_overrides/pw_sync_backend/interrupt_spin_lock_native.h", |
Ewout van Bekkum | 5bcd8c4 | 2020-11-23 10:46:16 -0800 | [diff] [blame] | 177 | ], |
| 178 | includes = [ |
| 179 | "public", |
| 180 | "public_overrides", |
| 181 | ], |
| 182 | # TODO: This should depend on ThreadX but our third parties currently |
| 183 | # do not have Bazel support. |
Nathaniel Brough | c2d5781 | 2021-04-18 22:52:00 +0800 | [diff] [blame] | 184 | target_compatible_with = [ |
| 185 | "//pw_build/constraints/rtos:threadx", |
| 186 | ], |
Ewout van Bekkum | 5bcd8c4 | 2020-11-23 10:46:16 -0800 | [diff] [blame] | 187 | ) |
| 188 | |
| 189 | pw_cc_library( |
Ewout van Bekkum | 126e011 | 2021-03-12 10:59:49 -0800 | [diff] [blame] | 190 | name = "interrupt_spin_lock", |
Ewout van Bekkum | 5bcd8c4 | 2020-11-23 10:46:16 -0800 | [diff] [blame] | 191 | srcs = [ |
Ewout van Bekkum | 126e011 | 2021-03-12 10:59:49 -0800 | [diff] [blame] | 192 | "interrupt_spin_lock.cc", |
Ewout van Bekkum | 5bcd8c4 | 2020-11-23 10:46:16 -0800 | [diff] [blame] | 193 | ], |
Nathaniel Brough | c2d5781 | 2021-04-18 22:52:00 +0800 | [diff] [blame] | 194 | target_compatible_with = [ |
| 195 | "//pw_build/constraints/rtos:threadx", |
| 196 | ], |
Ewout van Bekkum | 5bcd8c4 | 2020-11-23 10:46:16 -0800 | [diff] [blame] | 197 | deps = [ |
Ewout van Bekkum | 126e011 | 2021-03-12 10:59:49 -0800 | [diff] [blame] | 198 | ":interrupt_spin_lock_headers", |
| 199 | "//pw_sync:interrupt_spin_lock_facade", |
Ewout van Bekkum | 5bcd8c4 | 2020-11-23 10:46:16 -0800 | [diff] [blame] | 200 | ], |
| 201 | ) |