blob: 8d9d723ff94c4afc348d296fb1f8f6a469457b47 [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
Andrew Scullf8252932019-04-04 13:51:22 +010019#include "hf/dlog.h"
20
Andrew Sculla59f9bc2019-04-03 15:24:35 +010021/**
22 * Causes execution to halt and prevent progress of the current and less
23 * privileged software components. This should be triggered when a
24 * non-recoverable event is identified which leaves the system in an
25 * inconsistent state.
26 *
27 * TODO: Should this also reset the system?
28 */
29noreturn void abort(void)
30{
31 /* TODO: Block all CPUs. */
32 for (;;) {
Andrew Scullf8252932019-04-04 13:51:22 +010033 /* Prevent loop being optimized away. */
34 __asm__ volatile("nop");
Andrew Sculla59f9bc2019-04-03 15:24:35 +010035 }
36}