blob: 2d30b3c998b2661951f55fdd2e73130c38cdd183 [file] [log] [blame]
Andrew Sculla59f9bc2019-04-03 15:24:35 +01001/*
2 * Copyright 2019 The Hafnium Authors.
3 *
Andrew Walbrane959ec12020-06-17 15:01:09 +01004 * Use of this source code is governed by a BSD-style
5 * license that can be found in the LICENSE file or at
6 * https://opensource.org/licenses/BSD-3-Clause.
Andrew Sculla59f9bc2019-04-03 15:24:35 +01007 */
8
9#include "hf/abort.h"
10
11/**
12 * Causes execution to halt and prevent progress of the current and less
13 * privileged software components. This should be triggered when a
14 * non-recoverable event is identified which leaves the system in an
15 * inconsistent state.
16 *
17 * TODO: Should this also reset the system?
18 */
19noreturn void abort(void)
20{
21 /* TODO: Block all CPUs. */
22 for (;;) {
Andrew Scullf8252932019-04-04 13:51:22 +010023 /* Prevent loop being optimized away. */
24 __asm__ volatile("nop");
Andrew Sculla59f9bc2019-04-03 15:24:35 +010025 }
26}