J-Alves | 3388b0b | 2021-04-13 10:39:38 +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/ffa.h" |
| 13 | #include "hf/mm.h" |
| 14 | #include "hf/std.h" |
| 15 | |
| 16 | #include "vmapi/hf/call.h" |
| 17 | |
J-Alves | 35e6192 | 2021-05-06 10:01:05 +0100 | [diff] [blame^] | 18 | #include "test/abort.h" |
J-Alves | 3388b0b | 2021-04-13 10:39:38 +0100 | [diff] [blame] | 19 | #include "test/hftest.h" |
| 20 | |
| 21 | alignas(4096) uint8_t kstack[4096]; |
| 22 | |
J-Alves | 3388b0b | 2021-04-13 10:39:38 +0100 | [diff] [blame] | 23 | void test_main_sp(void); |
| 24 | |
J-Alves | 3388b0b | 2021-04-13 10:39:38 +0100 | [diff] [blame] | 25 | noreturn void kmain(void) |
| 26 | { |
| 27 | /* |
| 28 | * Initialize the stage-1 MMU and identity-map the entire address space. |
| 29 | */ |
| 30 | if (!hftest_mm_init()) { |
| 31 | HFTEST_LOG_FAILURE(); |
| 32 | HFTEST_LOG(HFTEST_LOG_INDENT "Memory initialization failed"); |
| 33 | abort(); |
| 34 | } |
| 35 | |
| 36 | test_main_sp(); |
| 37 | |
| 38 | /* Do not expect to get to this point, so abort. */ |
| 39 | abort(); |
| 40 | } |