summaryrefslogtreecommitdiff
path: root/Kernel/Arch/aarch64/PrekernelCommon.cpp
blob: 5035ae5ab87a1357d64f21eef7f52d3035263741 (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(const char* msg)
{
    auto& uart = Prekernel::UART::the();

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

    Prekernel::halt();
}

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

}