summaryrefslogtreecommitdiff
path: root/Kernel/Arch/aarch64/dummy.cpp
blob: d82c4e96f9e98f987a88d9632ddfd13b86112307 (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
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
/*
 * Copyright (c) 2021, Nico Weber <thakis@chromium.org>
 *
 * SPDX-License-Identifier: BSD-2-Clause
 */

#include <AK/Types.h>
#include <Kernel/KSyms.h>
#include <Kernel/Sections.h>

// init.cpp
extern size_t __stack_chk_guard;
READONLY_AFTER_INIT size_t __stack_chk_guard;

// This is a temporary file to get a non-empty Kernel binary on aarch64.
// The prekernel currently never jumps to the kernel. This is dead code.
void dummy();
void dummy() { }

// Assertions.h
[[noreturn]] void __assertion_failed(const char*, const char*, unsigned, const char*);

[[noreturn]] void __assertion_failed(const char*, const char*, unsigned, const char*)
{
    for (;;) { }
}

// kmalloc.h
size_t kmalloc_good_size(size_t);
size_t kmalloc_good_size(size_t) { return 0; }

void kfree_sized(void*, size_t);
void kfree_sized(void*, size_t) { }

void* kmalloc(size_t);
void* kmalloc(size_t) { return nullptr; }

void* operator new(size_t size) { return kmalloc(size); }
void* operator new(size_t size, std::align_val_t) { return kmalloc(size); }

namespace Kernel {
void dump_backtrace(PrintToScreen) { }
}

extern "C" {

// StdLib.cpp
[[noreturn]] void __stack_chk_fail();
[[noreturn]] void __stack_chk_fail()
{
    for (;;) { }
}

int memcmp(const void*, const void*, size_t);
int memcmp(const void*, const void*, size_t) { return 0; }

int strcmp(char const*, const char*);
int strcmp(char const*, const char*) { return 0; }

// kstdio.h
void kernelputstr(const char*, size_t);
void kernelputstr(const char*, size_t) { }

void kernelcriticalputstr(const char*, size_t);
void kernelcriticalputstr(const char*, size_t) { }

void kernelearlyputstr(const char*, size_t);
void kernelearlyputstr(const char*, size_t) { }

// MiniStdLib.cpp
void* memcpy(void*, const void*, size_t);
void* memcpy(void*, const void*, size_t) { return nullptr; }

void* memmove(void*, const void*, size_t);
void* memmove(void*, const void*, size_t) { return nullptr; }

void* memset(void*, int, size_t);
void* memset(void*, int, size_t) { return nullptr; }

size_t strlen(const char*);
size_t strlen(const char*) { return 0; }
}