1 # Copyright 2020 The Pigweed Authors
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
7 # https://www.apache.org/licenses/LICENSE-2.0
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
15 import("//build_overrides/pigweed.gni")
17 import("$dir_pw_build/facade.gni")
18 import("$dir_pw_docgen/docs.gni")
21 config("default_config") {
22 include_dirs = [ "public" ]
25 group("pw_cpu_exception") {
32 # This module has three facades, each of whose backends are set with a
33 # different GN variable.
35 # - entry: This is the library that handles early exception entry and prepares
36 # any CPU state that must be available to the exception handler via the
37 # pw_CpuState object. The backend for this facade will be architecture-
39 # Set this facade's backend via `pw_cpu_exception_ENTRY_BACKEND`
41 # - handler: This facade is backed by an application-specific handler that
42 # determines what to do when an exception is encountered. This may be
43 # capturing a crash report before resetting the device, or in some cases
44 # handling the exception to allow execution to continue.
45 # Set this facade's backend via `pw_cpu_exception_HANDLER_BACKEND`
47 # - support: This facade provides architecture-independent functions that may be
48 # helpful for dumping CPU state in various forms. This allows an application
49 # to create an application-specific handler that is portable across multiple
51 # Set this facade's backend via `pw_cpu_exception_SUPPORT_BACKEND`
54 backend = pw_cpu_exception_ENTRY_BACKEND
55 public_configs = [ ":default_config" ]
56 public_deps = [ "$dir_pw_preprocessor" ]
57 deps = [ ":handler.facade" ]
58 public = [ "public/pw_cpu_exception/entry.h" ]
61 pw_facade("handler") {
62 backend = pw_cpu_exception_HANDLER_BACKEND
63 public_configs = [ ":default_config" ]
64 public_deps = [ "$dir_pw_preprocessor" ]
65 sources = [ "start_exception_handler.cc" ]
66 public = [ "public/pw_cpu_exception/handler.h" ]
69 # This library is technically optional. It is recommended to use `support` when
70 # doing basic dumps of CPU state. As an alternative, projects may choose to
71 # directly depend on the entry backend if they require direct access to
72 # pw_cpu_exception_State members.
73 pw_facade("support") {
74 backend = pw_cpu_exception_SUPPORT_BACKEND
75 public_configs = [ ":default_config" ]
76 public = [ "public/pw_cpu_exception/support.h" ]
79 pw_source_set("basic_handler") {
84 sources = [ "basic_handler.cc" ]
87 pw_doc_group("docs") {
88 sources = [ "docs.rst" ]