1 /*
2  * Copyright 2019 The Hafnium Authors.
3  *
4  * 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.
7  */
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  */
abort(void)19 noreturn void abort(void)
20 {
21 	/* TODO: Block all CPUs. */
22 	for (;;) {
23 		/* Prevent loop being optimized away. */
24 		__asm__ volatile("nop");
25 	}
26 }
27