kernel: separate headers into kernel and user headers

all kernel headers have been moved from include/mango to include/kernel
and include definitions that are only relevant to kernel-space.

any definitions that are relevant to both kernel- and user-space
(i.e. type definitions, syscall IDs) have been moved to
include/mango within libmango.
This commit is contained in:
2026-02-19 18:54:48 +00:00
parent e3dd48a0fa
commit 6019c9307d
117 changed files with 1361 additions and 3845 deletions

View File

@@ -1,11 +1,11 @@
#include <limits.h>
#include <mango/machine/cpu.h>
#include <mango/memblock.h>
#include <mango/printk.h>
#include <kernel/machine/cpu.h>
#include <kernel/memblock.h>
#include <kernel/printk.h>
#include <mango/status.h>
#include <mango/vm-object.h>
#include <mango/vm-region.h>
#include <mango/vm.h>
#include <kernel/vm-object.h>
#include <kernel/vm-region.h>
#include <kernel/vm.h>
#include <stddef.h>
#include <stdint.h>

View File

@@ -1,8 +1,8 @@
#include <mango/queue.h>
#include <mango/compiler.h>
#include <mango/panic.h>
#include <mango/vm.h>
#include <mango/util.h>
#include <kernel/queue.h>
#include <kernel/compiler.h>
#include <kernel/panic.h>
#include <kernel/vm.h>
#include <kernel/util.h>
#include <stddef.h>
#define FREELIST_END ((unsigned int)-1)

View File

@@ -15,9 +15,9 @@
memory outstripts free memory), the sparse memory model may
be a better choice.
*/
#include <mango/vm.h>
#include <mango/memblock.h>
#include <mango/printk.h>
#include <kernel/vm.h>
#include <kernel/memblock.h>
#include <kernel/printk.h>
/* array of pages, one for each physical page frame present in RAM */
static struct vm_page *page_array = NULL;

View File

@@ -1,8 +1,8 @@
#include <mango/types.h>
#include <mango/memblock.h>
#include <mango/vm.h>
#include <mango/util.h>
#include <mango/libc/string.h>
#include <kernel/types.h>
#include <kernel/memblock.h>
#include <kernel/vm.h>
#include <kernel/util.h>
#include <kernel/libc/string.h>
#define SIZE_N_CACHE(s) \
{ .c_name = "size-" # s, .c_obj_size = s, .c_page_order = VM_PAGE_16K }

View File

@@ -20,9 +20,9 @@
software without specific prior written permission.
*/
#include <limits.h>
#include <mango/libc/string.h>
#include <mango/memblock.h>
#include <mango/types.h>
#include <kernel/libc/string.h>
#include <kernel/memblock.h>
#include <kernel/types.h>
#include <stdbool.h>
#define MIN(a, b) ((a) < (b) ? (a) : (b))

View File

@@ -1,4 +1,4 @@
#include <mango/vm.h>
#include <kernel/vm.h>
static enum vm_model model;

View File

@@ -1,8 +1,8 @@
#include <mango/libc/string.h>
#include <mango/memblock.h>
#include <mango/printk.h>
#include <mango/types.h>
#include <mango/vm.h>
#include <kernel/libc/string.h>
#include <kernel/memblock.h>
#include <kernel/printk.h>
#include <kernel/types.h>
#include <kernel/vm.h>
/* Pre-calculated page order -> size conversion table */
static size_t page_order_bytes[] = {

View File

@@ -22,14 +22,14 @@
of the sparse memory model may be outweighed by the extra
overhead, and the flat memory model may be a better choice.
*/
#include <mango/arg.h>
#include <mango/bsp.h>
#include <mango/machine/cpu.h>
#include <mango/memblock.h>
#include <mango/panic.h>
#include <mango/printk.h>
#include <mango/util.h>
#include <mango/vm.h>
#include <kernel/arg.h>
#include <kernel/bsp.h>
#include <kernel/machine/cpu.h>
#include <kernel/memblock.h>
#include <kernel/panic.h>
#include <kernel/printk.h>
#include <kernel/util.h>
#include <kernel/vm.h>
static struct vm_sector *sector_array = NULL;
static size_t sector_array_count = 0;

View File

@@ -1,5 +1,6 @@
#include <mango/printk.h>
#include <mango/vm-object.h>
#include <kernel/printk.h>
#include <kernel/util.h>
#include <kernel/vm-object.h>
#define VM_OBJECT_CAST(p) \
OBJECT_C_CAST(struct vm_object, vo_base, &vm_object_type, p)

View File

@@ -1,11 +1,12 @@
#include <mango/libc/stdio.h>
#include <mango/object.h>
#include <mango/panic.h>
#include <mango/printk.h>
#include <kernel/iovec.h>
#include <kernel/libc/stdio.h>
#include <kernel/object.h>
#include <kernel/panic.h>
#include <kernel/printk.h>
#include <kernel/util.h>
#include <kernel/vm-object.h>
#include <kernel/vm-region.h>
#include <mango/status.h>
#include <mango/util.h>
#include <mango/vm-object.h>
#include <mango/vm-region.h>
/*** STATIC DATA + MACROS *****************************************************/

View File

@@ -1,12 +1,12 @@
#include <mango/locks.h>
#include <mango/util.h>
#include <mango/queue.h>
#include <mango/memblock.h>
#include <mango/types.h>
#include <mango/vm.h>
#include <mango/printk.h>
#include <mango/libc/string.h>
#include <mango/machine/cpu.h>
#include <kernel/locks.h>
#include <kernel/util.h>
#include <kernel/queue.h>
#include <kernel/memblock.h>
#include <kernel/types.h>
#include <kernel/vm.h>
#include <kernel/printk.h>
#include <kernel/libc/string.h>
#include <kernel/machine/cpu.h>
static struct vm_page *group_pages_into_block(struct vm_zone *z, phys_addr_t base, phys_addr_t limit, int order)
{