Ewout van Bekkum | 41daf16 | 2021-03-03 13:57:28 -0800 | [diff] [blame] | 1 | # Copyright 2021 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 | e11ed69 | 2021-03-05 11:02:18 -0800 | [diff] [blame] | 25 | name = "binary_semaphore_headers", |
| 26 | hdrs = [ |
| 27 | "public/pw_sync_embos/binary_semaphore_inline.h", |
| 28 | "public/pw_sync_embos/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(pwbug/317): This should depend on embOS but our third parties |
| 38 | # currently do not have Bazel support. |
| 39 | "//pw_chrono:system_clock", |
| 40 | "//pw_chrono_embos:system_clock_headers", |
| 41 | ], |
| 42 | ) |
| 43 | |
| 44 | pw_cc_library( |
| 45 | name = "binary_semaphore", |
| 46 | srcs = [ |
| 47 | "binary_semaphore.cc", |
| 48 | ], |
| 49 | deps = [ |
| 50 | ":binary_semaphore_headers", |
| 51 | "//pw_interrupt:context", |
| 52 | "//pw_sync:binary_semaphore_facade", |
| 53 | ], |
| 54 | ) |
| 55 | |
| 56 | pw_cc_library( |
| 57 | name = "counting_semaphore_headers", |
| 58 | hdrs = [ |
| 59 | "public/pw_sync_embos/counting_semaphore_inline.h", |
| 60 | "public/pw_sync_embos/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(pwbug/317): This should depend on embOS but our third parties |
| 70 | # currently do not have Bazel support. |
| 71 | "//pw_chrono:system_clock", |
| 72 | "//pw_chrono_embos:system_clock_headers", |
| 73 | ], |
| 74 | ) |
| 75 | |
| 76 | pw_cc_library( |
| 77 | name = "counting_semaphore", |
| 78 | srcs = [ |
| 79 | "counting_semaphore.cc", |
| 80 | ], |
| 81 | deps = [ |
| 82 | ":counting_semaphore_headers", |
| 83 | "//pw_interrupt:context", |
| 84 | "//pw_sync:counting_semaphore_facade", |
| 85 | ], |
| 86 | ) |
| 87 | |
| 88 | |
| 89 | pw_cc_library( |
Ewout van Bekkum | 99a6c20 | 2021-03-05 08:44:29 -0800 | [diff] [blame] | 90 | name = "mutex_headers", |
| 91 | hdrs = [ |
| 92 | "public/pw_sync_embos/mutex_inline.h", |
| 93 | "public/pw_sync_embos/mutex_native.h", |
| 94 | "public_overrides/pw_sync_backend/mutex_inline.h", |
| 95 | "public_overrides/pw_sync_backend/mutex_native.h", |
| 96 | ], |
| 97 | includes = [ |
| 98 | "public", |
| 99 | "public_overrides", |
| 100 | ], |
| 101 | deps = [ |
| 102 | # TODO(pwbug/317): This should depend on embOS but our third parties |
| 103 | # currently do not have Bazel support. |
Ewout van Bekkum | 6f5b8fb | 2021-04-06 16:15:22 -0700 | [diff] [blame] | 104 | "//pw_sync:mutex_facade", |
Ewout van Bekkum | 99a6c20 | 2021-03-05 08:44:29 -0800 | [diff] [blame] | 105 | ], |
| 106 | ) |
| 107 | |
| 108 | pw_cc_library( |
| 109 | name = "mutex", |
Ewout van Bekkum | 99a6c20 | 2021-03-05 08:44:29 -0800 | [diff] [blame] | 110 | deps = [ |
| 111 | ":mutex_headers", |
Ewout van Bekkum | 99a6c20 | 2021-03-05 08:44:29 -0800 | [diff] [blame] | 112 | "//pw_sync:mutex_facade", |
| 113 | ], |
| 114 | ) |
| 115 | |
| 116 | pw_cc_library( |
Ewout van Bekkum | 6f5b8fb | 2021-04-06 16:15:22 -0700 | [diff] [blame] | 117 | name = "timed_mutex_headers", |
| 118 | hdrs = [ |
| 119 | "public/pw_sync_embos/timed_mutex_inline.h", |
| 120 | "public_overrides/pw_sync_backend/timed_mutex_inline.h", |
| 121 | ], |
| 122 | includes = [ |
| 123 | "public", |
| 124 | "public_overrides", |
| 125 | ], |
| 126 | deps = [ |
| 127 | # TODO(pwbug/317): This should depend on embOS but our third parties |
| 128 | # currently do not have Bazel support. |
| 129 | "//pw_chrono:system_clock", |
| 130 | "//pw_sync:timed_mutex_facade", |
| 131 | ], |
| 132 | ) |
| 133 | |
| 134 | pw_cc_library( |
| 135 | name = "timed_mutex", |
| 136 | srcs = [ |
| 137 | "timed_mutex.cc", |
| 138 | ], |
| 139 | deps = [ |
| 140 | ":timed_mutex_headers", |
| 141 | "//pw_interrupt:context", |
| 142 | "//pw_sync:timed_mutex_facade", |
| 143 | "//pw_chrono_embos:system_clock_headers", |
| 144 | ], |
| 145 | ) |
| 146 | |
| 147 | |
| 148 | pw_cc_library( |
Ewout van Bekkum | 126e011 | 2021-03-12 10:59:49 -0800 | [diff] [blame] | 149 | name = "interrupt_spin_lock_headers", |
Ewout van Bekkum | 41daf16 | 2021-03-03 13:57:28 -0800 | [diff] [blame] | 150 | hdrs = [ |
Ewout van Bekkum | 126e011 | 2021-03-12 10:59:49 -0800 | [diff] [blame] | 151 | "public/pw_sync_embos/interrupt_spin_lock_inline.h", |
| 152 | "public/pw_sync_embos/interrupt_spin_lock_native.h", |
| 153 | "public_overrides/pw_sync_backend/interrupt_spin_lock_inline.h", |
| 154 | "public_overrides/pw_sync_backend/interrupt_spin_lock_native.h", |
Ewout van Bekkum | 41daf16 | 2021-03-03 13:57:28 -0800 | [diff] [blame] | 155 | ], |
| 156 | includes = [ |
| 157 | "public", |
| 158 | "public_overrides", |
| 159 | ], |
| 160 | # TODO(pwbug/317): This should depend on embOS but our third parties |
| 161 | # currently do not have Bazel support. |
| 162 | ) |
| 163 | |
| 164 | pw_cc_library( |
Ewout van Bekkum | 126e011 | 2021-03-12 10:59:49 -0800 | [diff] [blame] | 165 | name = "interrupt_spin_lock", |
Ewout van Bekkum | 41daf16 | 2021-03-03 13:57:28 -0800 | [diff] [blame] | 166 | srcs = [ |
Ewout van Bekkum | 126e011 | 2021-03-12 10:59:49 -0800 | [diff] [blame] | 167 | "interrupt_spin_lock.cc", |
Ewout van Bekkum | 41daf16 | 2021-03-03 13:57:28 -0800 | [diff] [blame] | 168 | ], |
| 169 | deps = [ |
Ewout van Bekkum | 126e011 | 2021-03-12 10:59:49 -0800 | [diff] [blame] | 170 | ":interrupt_spin_lock_headers", |
| 171 | "//pw_sync:interrupt_spin_lock_facade", |
Ewout van Bekkum | 41daf16 | 2021-03-03 13:57:28 -0800 | [diff] [blame] | 172 | ], |
| 173 | ) |
| 174 | |