• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# Copyright 2024 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("@rules_python//python:proto.bzl", "py_proto_library")
16load("//pw_protobuf_compiler:pw_proto_library.bzl", "pw_proto_library")
17
18package(default_visibility = ["//visibility:public"])
19
20licenses(["notice"])
21
22constraint_value(
23    name = "support_backend",
24    constraint_setting = "//pw_cpu_exception:support_constraint_setting",
25)
26
27cc_library(
28    name = "config",
29    hdrs = ["pw_cpu_exception_risc_v_private/config.h"],
30    deps = [":config_override"],
31)
32
33label_flag(
34    name = "config_override",
35    build_setting_default = "//pw_build:default_module_config",
36)
37
38cc_library(
39    name = "cpu_state",
40    hdrs = ["public/pw_cpu_exception_risc_v/cpu_state.h"],
41    includes = ["public"],
42    deps = [
43        "//pw_preprocessor",
44    ],
45)
46
47cc_library(
48    name = "support",
49    srcs = ["support.cc"],
50    deps = [
51        ":config",
52        ":cpu_state",
53        "//pw_cpu_exception:support_facade",
54        "//pw_log",
55        "//pw_preprocessor",
56        "//pw_string",
57    ],
58)
59
60cc_library(
61    name = "proto_dump",
62    srcs = ["proto_dump.cc"],
63    hdrs = ["public/pw_cpu_exception_risc_v/proto_dump.h"],
64    includes = ["public"],
65    deps = [
66        ":config",
67        ":cpu_state",
68        ":cpu_state_protos_cc.pwpb",
69        ":support",
70        "//pw_protobuf",
71        "//pw_status",
72        "//pw_stream",
73    ],
74)
75
76proto_library(
77    name = "cpu_state_protos",
78    srcs = ["pw_cpu_exception_risc_v_protos/cpu_state.proto"],
79    import_prefix = "pw_cpu_exception_risc_v_protos",
80    strip_import_prefix = "/pw_cpu_exception_risc_v/pw_cpu_exception_risc_v_protos",
81)
82
83py_proto_library(
84    name = "cpu_state_protos_pb2",
85    deps = [":cpu_state_protos"],
86)
87
88pw_proto_library(
89    name = "cpu_state_protos_cc",
90    deps = [":cpu_state_protos"],
91)
92
93cc_library(
94    name = "snapshot",
95    srcs = ["snapshot.cc"],
96    hdrs = ["public/pw_cpu_exception_risc_v/snapshot.h"],
97    deps = [
98        ":config",
99        ":cpu_state",
100        ":cpu_state_protos_cc.pwpb",
101        ":proto_dump",
102        "//pw_log",
103        "//pw_protobuf",
104        "//pw_status",
105        "//pw_thread:snapshot",
106        "//pw_thread:thread_cc.pwpb",
107    ],
108)
109