forked from xamidev/pepperOS
34 lines
589 B
C
34 lines
589 B
C
/*
|
|
* @author xamidev <xamidev@riseup.net>
|
|
* @brief Virtual memory manager
|
|
* @license GPL-3.0-only
|
|
*/
|
|
|
|
#ifndef VMM_H
|
|
#define VMM_H
|
|
|
|
#include <stdint.h>
|
|
#include <stddef.h>
|
|
|
|
/*
|
|
This will be our linked list of virtual memory objects.
|
|
Flags here aren't x86 flags, they are platform-agnostic
|
|
kernel-defined flags.
|
|
*/
|
|
|
|
struct vm_object {
|
|
uintptr_t base;
|
|
size_t length;
|
|
size_t flags;
|
|
struct vm_object* next;
|
|
};
|
|
|
|
// Flags bitfield
|
|
#define VM_FLAG_NONE 0
|
|
#define VM_FLAG_WRITE (1 << 0)
|
|
#define VM_FLAG_EXEC (1 << 1)
|
|
#define VM_FLAG_USER (1 << 2)
|
|
|
|
void vmm_init(void);
|
|
|
|
#endif |