blob: 21588f0866425b9ffca06ba0cd31e9daa2678d9b [file] [log] [blame]
Andrew Sculla59f9bc2019-04-03 15:24:35 +01001/*
2 * Copyright 2019 The Hafnium Authors.
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * https://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16
17#include "hf/abort.h"
18
19/**
20 * Causes execution to halt and prevent progress of the current and less
21 * privileged software components. This should be triggered when a
22 * non-recoverable event is identified which leaves the system in an
23 * inconsistent state.
24 *
25 * TODO: Should this also reset the system?
26 */
27noreturn void abort(void)
28{
29 /* TODO: Block all CPUs. */
30 for (;;) {
Andrew Scullf8252932019-04-04 13:51:22 +010031 /* Prevent loop being optimized away. */
32 __asm__ volatile("nop");
Andrew Sculla59f9bc2019-04-03 15:24:35 +010033 }
34}