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 <stdint.h>
10 
11 #include "hf/ffa.h"
12 #include "hf/mm.h"
13 #include "hf/std.h"
14 
15 #include "vmapi/hf/call.h"
16 
17 #include "test/abort.h"
18 #include "test/hftest.h"
19 #include "test/vmapi/ffa.h"
20 
21 alignas(4096) uint8_t kstack[4096];
22 
23 static struct ffa_boot_info_header* boot_info_header;
24 
get_boot_info_header(void)25 struct ffa_boot_info_header* get_boot_info_header(void)
26 {
27 	return boot_info_header;
28 }
29 
30 void test_main_sp(bool);
31 
run_service_set_up(struct hftest_context * ctx,struct fdt * fdt)32 void run_service_set_up(struct hftest_context* ctx, struct fdt* fdt)
33 {
34 	hftest_service_set_up(ctx, fdt);
35 }
36 
kmain(struct ffa_boot_info_header * boot_info_blob)37 [[noreturn]] void kmain(struct ffa_boot_info_header* boot_info_blob)
38 {
39 	boot_info_header = boot_info_blob;
40 
41 	test_main_sp(true);
42 
43 	/* Do not expect to get to this point, so abort. */
44 	abort();
45 }
46