blob: 7a4394ef2656445eb570e94fb470734e0a4c8b4f [file] [log] [blame]
Andrew Scullf0551c82018-12-15 20:38:47 +00001/*
Andrew Walbran692b3252019-03-07 15:51:31 +00002 * Copyright 2018 The Hafnium Authors.
Andrew Scullf0551c82018-12-15 20:38:47 +00003 *
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 Scullf0551c82018-12-15 20:38:47 +00007 */
8
9#include <stdalign.h>
10#include <stdint.h>
11
Raghu Krishnamurthyfffe7612020-12-08 14:57:28 -080012#include "hf/arch/vm/interrupts.h"
13
Andrew Walbran1e7c7742019-12-13 17:10:02 +000014#include "test/hftest.h"
Raghu Krishnamurthy50af6602021-12-12 15:23:09 -080015#include "test/hftest_impl.h"
Andrew Scullf0551c82018-12-15 20:38:47 +000016
17alignas(4096) uint8_t kstack[4096];
18
Raghu Krishnamurthy50af6602021-12-12 15:23:09 -080019extern void abort(void);
Raghu Krishnamurthy1c264f32021-02-27 20:37:13 -080020
Madhukar Pappireddy538b6882024-08-20 16:50:52 -050021void run_service_set_up(struct hftest_context *ctx, struct fdt *fdt)
22{
23 hftest_service_set_up(ctx, fdt);
24}
25
26noreturn void kmain(const void *fdt_ptr)
Raghu Krishnamurthy1c264f32021-02-27 20:37:13 -080027{
28 /*
29 * Initialize the stage-1 MMU and identity-map the entire address space.
30 */
31 if (!hftest_mm_init()) {
32 HFTEST_LOG_FAILURE();
33 HFTEST_LOG(HFTEST_LOG_INDENT "Memory initialization failed");
34 abort();
35 }
36
37 /* Setup basic exception handling. */
38 exception_setup(NULL, NULL);
39
40 hftest_service_main(fdt_ptr);
41}