J-Alves | 35e6192 | 2021-05-06 10:01:05 +0100 | [diff] [blame^] | 1 | /* |
| 2 | * Copyright 2021 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 <stdalign.h> |
| 10 | #include <stdint.h> |
| 11 | |
| 12 | #include "hf/mm.h" |
| 13 | #include "hf/std.h" |
| 14 | |
| 15 | #include "test/hftest.h" |
| 16 | #include "test/hftest_impl.h" |
| 17 | |
| 18 | HFTEST_ENABLE(); |
| 19 | |
| 20 | static struct hftest_context global_context; |
| 21 | |
| 22 | struct hftest_context *hftest_get_context(void) |
| 23 | { |
| 24 | return &global_context; |
| 25 | } |
| 26 | |
| 27 | noreturn void abort(void) |
| 28 | { |
| 29 | HFTEST_LOG("Service contained failures."); |
| 30 | /* Cause a fault, as a secondary/SP can't power down the machine. */ |
| 31 | *((volatile uint8_t *)1) = 1; |
| 32 | |
| 33 | /* This should never be reached, but to make the compiler happy... */ |
| 34 | for (;;) { |
| 35 | } |
| 36 | } |