Fix for x86_64 build fail
[platform/upstream/connectedhomeip.git] / third_party / pigweed / repo / pw_cpu_exception / public / pw_cpu_exception / entry.h
1 // Copyright 2019 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 #pragma once
15
16 // Platform-independent mechanism to catch hardware CPU faults in user code.
17 // This module encapsulates low level CPU exception handling assembly for the
18 // platform. By default, this module invokes the following user-defined function
19 // after early exception handling completes:
20 //
21 //   pw_cpu_exception_DefaultHandler(pw_cpu_exception_State* state)
22 //
23 // If platform-dependent access to the CPU registers is needed, then
24 // applications can include the respective backend module directly; for example
25 // cpu_exception_armv7m.
26 //
27 // IMPORTANT: To use this module, you MUST implement
28 //            pw_cpu_exception_DefaultHandler() in some part of your
29 //            application.
30
31 #include "pw_preprocessor/compiler.h"
32 #include "pw_preprocessor/util.h"
33
34 // Low-level raw exception entry handler.
35 //
36 // Captures faulting CPU state into a platform-specific pw_cpu_exception_State
37 // object, then calls the user-provided fault handler.
38 //
39 // This function should be called immediately after a fault; typically by being
40 // in the interrupt vector table entries for the hard fault exceptions.
41 //
42 // Note: applications should almost never invoke this directly; if you do, make
43 // sure you know what you are doing.
44 PW_EXTERN_C PW_NO_PROLOGUE void pw_cpu_exception_Entry(void);