kernel: port sandbox components

This commit is contained in:
2023-02-03 20:51:23 +00:00
parent 40f83922da
commit 247bb2b530
14 changed files with 16 additions and 85 deletions

View File

@@ -19,12 +19,10 @@
contributors may be used to endorse or promote products derived from this
software without specific prior written permission.
*/
#include "socks/types.h"
#include <stdio.h>
#include <stdbool.h>
#include <limits.h>
#include <stdlib.h>
#include <string.h>
#include <socks/types.h>
#include <socks/libc/string.h>
#include <socks/memblock.h>
#define MIN(a, b) ((a) < (b) ? (a) : (b))
@@ -252,8 +250,7 @@ static phys_addr_t do_alloc(size_t size)
}
if (allocated_base == ADDR_MAX) {
fprintf(stderr, "memblock: cannot allocate %zu byte buffer!\n", size);
abort();
return 0;
}
int status = memblock_add_range(&memblock.reserved, allocated_base, size, MEMBLOCK_ALLOC);