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
|
diff --git i/src/drivers/sep/sep.c w/src/drivers/sep/sep.c
index 10d0a98..cc074b6 100644
--- i/src/drivers/sep/sep.c
+++ w/src/drivers/sep/sep.c
@@ -910,7 +910,8 @@ struct sep_command {
void (*cb)(const char* cmd, char* args);
};
-void sep_help();
+void sep_help(const char* cmd, char* args);
#define SEP_COMMAND(_name, _desc, _cb) {.name = _name, .desc = _desc, .cb = _cb}
void sep_pwned_peek(const char* cmd, char* args) {
if(!sep_is_pwned) {
diff --git i/src/kernel/mm.c w/src/kernel/mm.c
index 595ae64..108b885 100644
--- i/src/kernel/mm.c
+++ w/src/kernel/mm.c
@@ -375,13 +375,13 @@ err_t vm_allocate(struct vm_space* vmspace, uint64_t* addr, uint64_t size, vm_fl
uint32_t vm_scan_base = 0;
uint64_t vm_scan_size = (VM_SPACE_SIZE / PAGE_SIZE);
uint32_t found_pages = 0;
- uint32_t vm_index_start = 0;
if (flags & VM_FLAGS_FIXED) {
uint64_t vm_offset = *addr - vmspace->vm_space_base;
if (vm_offset > vmspace->vm_space_end) vm_scan_size = 0;
else {
- vm_index_start = vm_offset / PAGE_SIZE;
vm_scan_size = ((size + PAGE_MASK) & ~PAGE_MASK) / PAGE_SIZE;
}
} else {
@@ -935,20 +935,21 @@ void ttbpage_free_walk(uint64_t base, bool is_tt1) {
}
bool tte_walk_get(struct vm_space* vmspace, uint64_t va, uint64_t** tte_out) {
uint64_t bits = 64ULL;
- bool is_tt1 = false;
uint64_t* ttb = NULL;
if (va & 0x7000000000000000) {
bits -= t1sz;
va -= (0xffffffffffffffff - ((1ULL << (65 - t1sz)) - 1));
va &= (1ULL << bits) - 1;
- is_tt1 = true;
ttb = phystokv(vmspace->ttbr1);
} else {
bits -= t0sz;
va &= (1ULL << bits) - 1;
- is_tt1 = false;
ttb = phystokv(vmspace->ttbr0);
}
uint32_t levels = ((bits - (tt_bits + 3ULL)) / tt_bits);
union tte tte;
while (levels) {
diff --git i/src/kernel/task.c w/src/kernel/task.c
index 0e6fa22..b957e16 100644
--- i/src/kernel/task.c
+++ w/src/kernel/task.c
@@ -26,6 +26,7 @@
*/
#include <errno.h>
#include <stdlib.h>
+#include <stdarg.h>
#include <pongo.h>
extern void task_load(struct task* to_task);
|