aboutsummaryrefslogtreecommitdiff
path: root/lib/mlibc/sysdeps/hyra/generic/hyra.cpp
blob: fb555b9fcdea486e088c019b404c8772e5d26506 (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
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
#include <stddef.h>
#include <sys/types.h>
#include <hyra/syscall.h>

namespace mlibc {
void sys_libc_log(const char *msg) {
    __syscall(0, (uintptr_t)msg);
}

int sys_anon_allocate(size_t size, void **pointer) {
    (void)size;
    (void)pointer;
    while (1);
}

void sys_libc_panic() {
    sys_libc_log("\n** MLIBC PANIC **\n");
    while (1);
}

int sys_tcb_set(void *pointer) {
    (void)pointer;

    while (1);
}

void sys_exit(int status) {
}

void sys_seek(int fd, off_t offset, int whence, off_t *new_offset) {
    (void)fd;
    (void)offset;
    (void)whence;
    (void)new_offset;

    while (1);
}

int sys_vm_map(void *hint, size_t size, int prot, int flags, int fd,
               off_t offset, void **window) {
    (void)hint;
    (void)size;
    (void)prot;
    (void)flags;
    (void)fd;
    (void)offset;
    (void)window;

    while (1);
}

int sys_vm_unmap(void *address, size_t size) {
    (void)address;
    (void)size;

    while (1);
}

int sys_anon_free(void *pointer, size_t size) {
    (void)pointer;
    (void)size;

    while (1);
}

int sys_clock_get(int clock, time_t *secs, long *nanos) {
    (void)clock;
    (void)secs;
    (void)nanos;

    while (1);
}

int sys_futex_wait(int *pointer, int expected, const struct timespec *time) {
    (void)pointer;
    (void)expected;
    (void)time;

    return 0;
}

int sys_futex_wake(int *pointer) {
    (void)pointer;

    return 0;
}

int sys_open(const char *filename, int flags, mode_t mode, int *fd) {
    (void)filename;
    (void)flags;
    (void)mode;
    (void)fd;

    while (1);
}

int sys_read(int fd, void *buf, size_t count, ssize_t *bytes_read) {
    (void)fd;
    (void)buf;
    (void)count;
    (void)bytes_read;

    while (1);
}

int sys_write(int fd, const void *buffer, size_t count, ssize_t *written) {
    (void)fd;
    (void)buffer;
    (void)count;
    (void)written;

    while (1);
}

int sys_close(int fd) {
    (void)fd;

    while (1);
}

}