summaryrefslogtreecommitdiff
path: root/Kernel/Arch/aarch64/PrekernelCommon.cpp
blob: 5f7310daa379a5475ac701c96e256d1acd9c61b7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
/*
 * Copyright (c) 2021, James Mintram <me@jamesrm.com>
 *
 * SPDX-License-Identifier: BSD-2-Clause
 */

#include <Kernel/Arch/aarch64/Prekernel.h>

#include <Kernel/Arch/aarch64/ASM_wrapper.h>
#include <Kernel/Arch/aarch64/UART.h>

namespace Prekernel {

[[noreturn]] void panic(char const* msg)
{
    auto& uart = Prekernel::UART::the();

    if (msg) {
        uart.print_str(msg);
    }

    Prekernel::halt();
}

[[noreturn]] void halt()
{
    for (;;) {
        asm volatile("wfi");
    }
}

}