xref: /aosp_15_r20/external/pigweed/pw_sync_threadx/BUILD.bazel (revision 61c4878ac05f98d0ceed94b57d316916de578985)
1*61c4878aSAndroid Build Coastguard Worker# Copyright 2020 The Pigweed Authors
2*61c4878aSAndroid Build Coastguard Worker#
3*61c4878aSAndroid Build Coastguard Worker# Licensed under the Apache License, Version 2.0 (the "License"); you may not
4*61c4878aSAndroid Build Coastguard Worker# use this file except in compliance with the License. You may obtain a copy of
5*61c4878aSAndroid Build Coastguard Worker# the License at
6*61c4878aSAndroid Build Coastguard Worker#
7*61c4878aSAndroid Build Coastguard Worker#     https://www.apache.org/licenses/LICENSE-2.0
8*61c4878aSAndroid Build Coastguard Worker#
9*61c4878aSAndroid Build Coastguard Worker# Unless required by applicable law or agreed to in writing, software
10*61c4878aSAndroid Build Coastguard Worker# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
11*61c4878aSAndroid Build Coastguard Worker# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
12*61c4878aSAndroid Build Coastguard Worker# License for the specific language governing permissions and limitations under
13*61c4878aSAndroid Build Coastguard Worker# the License.
14*61c4878aSAndroid Build Coastguard Worker
15*61c4878aSAndroid Build Coastguard Workerpackage(default_visibility = ["//visibility:public"])
16*61c4878aSAndroid Build Coastguard Worker
17*61c4878aSAndroid Build Coastguard Workerlicenses(["notice"])
18*61c4878aSAndroid Build Coastguard Worker
19*61c4878aSAndroid Build Coastguard Workercc_library(
20*61c4878aSAndroid Build Coastguard Worker    name = "binary_semaphore",
21*61c4878aSAndroid Build Coastguard Worker    srcs = [
22*61c4878aSAndroid Build Coastguard Worker        "binary_semaphore.cc",
23*61c4878aSAndroid Build Coastguard Worker    ],
24*61c4878aSAndroid Build Coastguard Worker    hdrs = [
25*61c4878aSAndroid Build Coastguard Worker        "public/pw_sync_threadx/binary_semaphore_inline.h",
26*61c4878aSAndroid Build Coastguard Worker        "public/pw_sync_threadx/binary_semaphore_native.h",
27*61c4878aSAndroid Build Coastguard Worker        "public_overrides/pw_sync_backend/binary_semaphore_inline.h",
28*61c4878aSAndroid Build Coastguard Worker        "public_overrides/pw_sync_backend/binary_semaphore_native.h",
29*61c4878aSAndroid Build Coastguard Worker    ],
30*61c4878aSAndroid Build Coastguard Worker    includes = [
31*61c4878aSAndroid Build Coastguard Worker        "public",
32*61c4878aSAndroid Build Coastguard Worker        "public_overrides",
33*61c4878aSAndroid Build Coastguard Worker    ],
34*61c4878aSAndroid Build Coastguard Worker    target_compatible_with = [
35*61c4878aSAndroid Build Coastguard Worker        "//pw_build/constraints/rtos:threadx",
36*61c4878aSAndroid Build Coastguard Worker    ],
37*61c4878aSAndroid Build Coastguard Worker    # TODO: b/290364219 - Add threadx as a dependency.
38*61c4878aSAndroid Build Coastguard Worker    deps = [
39*61c4878aSAndroid Build Coastguard Worker        "//pw_chrono:system_clock",
40*61c4878aSAndroid Build Coastguard Worker        "//pw_interrupt:context",
41*61c4878aSAndroid Build Coastguard Worker        "//pw_sync:binary_semaphore.facade",
42*61c4878aSAndroid Build Coastguard Worker    ],
43*61c4878aSAndroid Build Coastguard Worker)
44*61c4878aSAndroid Build Coastguard Worker
45*61c4878aSAndroid Build Coastguard Workercc_library(
46*61c4878aSAndroid Build Coastguard Worker    name = "counting_semaphore",
47*61c4878aSAndroid Build Coastguard Worker    srcs = [
48*61c4878aSAndroid Build Coastguard Worker        "counting_semaphore.cc",
49*61c4878aSAndroid Build Coastguard Worker    ],
50*61c4878aSAndroid Build Coastguard Worker    hdrs = [
51*61c4878aSAndroid Build Coastguard Worker        "public/pw_sync_threadx/counting_semaphore_inline.h",
52*61c4878aSAndroid Build Coastguard Worker        "public/pw_sync_threadx/counting_semaphore_native.h",
53*61c4878aSAndroid Build Coastguard Worker        "public_overrides/pw_sync_backend/counting_semaphore_inline.h",
54*61c4878aSAndroid Build Coastguard Worker        "public_overrides/pw_sync_backend/counting_semaphore_native.h",
55*61c4878aSAndroid Build Coastguard Worker    ],
56*61c4878aSAndroid Build Coastguard Worker    includes = [
57*61c4878aSAndroid Build Coastguard Worker        "public",
58*61c4878aSAndroid Build Coastguard Worker        "public_overrides",
59*61c4878aSAndroid Build Coastguard Worker    ],
60*61c4878aSAndroid Build Coastguard Worker    target_compatible_with = [
61*61c4878aSAndroid Build Coastguard Worker        "//pw_build/constraints/rtos:threadx",
62*61c4878aSAndroid Build Coastguard Worker    ],
63*61c4878aSAndroid Build Coastguard Worker    # TODO: b/290364219 - Add threadx as a dependency.
64*61c4878aSAndroid Build Coastguard Worker    deps = [
65*61c4878aSAndroid Build Coastguard Worker        "//pw_chrono:system_clock",
66*61c4878aSAndroid Build Coastguard Worker        "//pw_interrupt:context",
67*61c4878aSAndroid Build Coastguard Worker        "//pw_sync:counting_semaphore.facade",
68*61c4878aSAndroid Build Coastguard Worker    ],
69*61c4878aSAndroid Build Coastguard Worker)
70*61c4878aSAndroid Build Coastguard Worker
71*61c4878aSAndroid Build Coastguard Workercc_library(
72*61c4878aSAndroid Build Coastguard Worker    name = "mutex",
73*61c4878aSAndroid Build Coastguard Worker    hdrs = [
74*61c4878aSAndroid Build Coastguard Worker        "public/pw_sync_threadx/mutex_inline.h",
75*61c4878aSAndroid Build Coastguard Worker        "public/pw_sync_threadx/mutex_native.h",
76*61c4878aSAndroid Build Coastguard Worker        "public_overrides/pw_sync_backend/mutex_inline.h",
77*61c4878aSAndroid Build Coastguard Worker        "public_overrides/pw_sync_backend/mutex_native.h",
78*61c4878aSAndroid Build Coastguard Worker    ],
79*61c4878aSAndroid Build Coastguard Worker    includes = [
80*61c4878aSAndroid Build Coastguard Worker        "public",
81*61c4878aSAndroid Build Coastguard Worker        "public_overrides",
82*61c4878aSAndroid Build Coastguard Worker    ],
83*61c4878aSAndroid Build Coastguard Worker    target_compatible_with = [
84*61c4878aSAndroid Build Coastguard Worker        "//pw_build/constraints/rtos:threadx",
85*61c4878aSAndroid Build Coastguard Worker    ],
86*61c4878aSAndroid Build Coastguard Worker    # TODO: b/290364219 - Add threadx as a dependency.
87*61c4878aSAndroid Build Coastguard Worker    deps = [
88*61c4878aSAndroid Build Coastguard Worker        "//pw_sync:mutex.facade",
89*61c4878aSAndroid Build Coastguard Worker    ],
90*61c4878aSAndroid Build Coastguard Worker)
91*61c4878aSAndroid Build Coastguard Worker
92*61c4878aSAndroid Build Coastguard Workercc_library(
93*61c4878aSAndroid Build Coastguard Worker    name = "timed_mutex",
94*61c4878aSAndroid Build Coastguard Worker    srcs = [
95*61c4878aSAndroid Build Coastguard Worker        "timed_mutex.cc",
96*61c4878aSAndroid Build Coastguard Worker    ],
97*61c4878aSAndroid Build Coastguard Worker    hdrs = [
98*61c4878aSAndroid Build Coastguard Worker        "public/pw_sync_threadx/timed_mutex_inline.h",
99*61c4878aSAndroid Build Coastguard Worker        "public_overrides/pw_sync_backend/timed_mutex_inline.h",
100*61c4878aSAndroid Build Coastguard Worker    ],
101*61c4878aSAndroid Build Coastguard Worker    includes = [
102*61c4878aSAndroid Build Coastguard Worker        "public",
103*61c4878aSAndroid Build Coastguard Worker        "public_overrides",
104*61c4878aSAndroid Build Coastguard Worker    ],
105*61c4878aSAndroid Build Coastguard Worker    target_compatible_with = [
106*61c4878aSAndroid Build Coastguard Worker        "//pw_build/constraints/rtos:threadx",
107*61c4878aSAndroid Build Coastguard Worker    ],
108*61c4878aSAndroid Build Coastguard Worker    # TODO: b/290364219 - Add threadx as a dependency.
109*61c4878aSAndroid Build Coastguard Worker    deps = [
110*61c4878aSAndroid Build Coastguard Worker        "//pw_chrono:system_clock",
111*61c4878aSAndroid Build Coastguard Worker        "//pw_interrupt:context",
112*61c4878aSAndroid Build Coastguard Worker        "//pw_sync:timed_mutex.facade",
113*61c4878aSAndroid Build Coastguard Worker    ],
114*61c4878aSAndroid Build Coastguard Worker)
115*61c4878aSAndroid Build Coastguard Worker
116*61c4878aSAndroid Build Coastguard Workercc_library(
117*61c4878aSAndroid Build Coastguard Worker    name = "interrupt_spin_lock",
118*61c4878aSAndroid Build Coastguard Worker    srcs = [
119*61c4878aSAndroid Build Coastguard Worker        "interrupt_spin_lock.cc",
120*61c4878aSAndroid Build Coastguard Worker    ],
121*61c4878aSAndroid Build Coastguard Worker    hdrs = [
122*61c4878aSAndroid Build Coastguard Worker        "public/pw_sync_threadx/interrupt_spin_lock_inline.h",
123*61c4878aSAndroid Build Coastguard Worker        "public/pw_sync_threadx/interrupt_spin_lock_native.h",
124*61c4878aSAndroid Build Coastguard Worker        "public_overrides/pw_sync_backend/interrupt_spin_lock_inline.h",
125*61c4878aSAndroid Build Coastguard Worker        "public_overrides/pw_sync_backend/interrupt_spin_lock_native.h",
126*61c4878aSAndroid Build Coastguard Worker    ],
127*61c4878aSAndroid Build Coastguard Worker    includes = [
128*61c4878aSAndroid Build Coastguard Worker        "public",
129*61c4878aSAndroid Build Coastguard Worker        "public_overrides",
130*61c4878aSAndroid Build Coastguard Worker    ],
131*61c4878aSAndroid Build Coastguard Worker    target_compatible_with = [
132*61c4878aSAndroid Build Coastguard Worker        "//pw_build/constraints/rtos:threadx",
133*61c4878aSAndroid Build Coastguard Worker    ],
134*61c4878aSAndroid Build Coastguard Worker    # TODO: b/290364219 - Add threadx as a dependency.
135*61c4878aSAndroid Build Coastguard Worker    deps = [
136*61c4878aSAndroid Build Coastguard Worker        "//pw_sync:interrupt_spin_lock.facade",
137*61c4878aSAndroid Build Coastguard Worker    ],
138*61c4878aSAndroid Build Coastguard Worker)
139