summaryrefslogtreecommitdiff
path: root/Kernel/Arch/aarch64/SafeMem.cpp
blob: 2ae30eb30f920da4ada32056b1b8aacc10e28aeb (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
/*
 * Copyright (c) 2022, Timon Kruiper <timonkruiper@gmail.com>
 *
 * SPDX-License-Identifier: BSD-2-Clause
 */

#include <Kernel/Arch/SafeMem.h>
#include <Kernel/StdLib.h>

namespace Kernel {

bool safe_memset(void*, int, size_t, void*&)
{
    TODO_AARCH64();
    return false;
}

ssize_t safe_strnlen(char const*, unsigned long, void*&)
{
    TODO_AARCH64();
    return 0;
}

bool safe_memcpy(void* dest_ptr, void const* src_ptr, unsigned long n, void*&)
{
    // FIXME: Actually implement a safe memcpy.
    memcpy(dest_ptr, src_ptr, n);
    return true;
}

Optional<bool> safe_atomic_compare_exchange_relaxed(u32 volatile*, u32&, u32)
{
    TODO_AARCH64();
    return {};
}

Optional<u32> safe_atomic_load_relaxed(u32 volatile*)
{
    TODO_AARCH64();
    return {};
}

Optional<u32> safe_atomic_fetch_add_relaxed(u32 volatile*, u32)
{
    TODO_AARCH64();
    return {};
}

Optional<u32> safe_atomic_exchange_relaxed(u32 volatile*, u32)
{
    TODO_AARCH64();
    return {};
}

bool safe_atomic_store_relaxed(u32 volatile*, u32)
{
    TODO_AARCH64();
    return {};
}

}