BarryServer : Git

All the code for all my projects
// BarryServer : Git / Nucleus / blob / 99d3ce8c89383289c5183f690345c2621e7bbd48 / memory / namespace.h

// Related

Nucleus

Barry Improved page fault handling and mmap system call 665af0a (3 years, 2 months ago)
#ifndef MEMORY_NAMESPACE_H
#define MEMORY_NAMESPACE_H

#include <nucleus/object.h>
#include <nucleus/vfs.h>

/* Structure for a Page in a Cache */
struct Page {
	Object obj;
	off_t offset;
	page_t frame;
};

/* Virtual Memory namespace */
struct VirtualMemory {
	Object obj;
	ObjectList *regions;
};

/* Structure for a Virtual Memory Region object */
struct VMRegion {
	Object obj;
	uintptr_t start, end;
	int prot;
	int flags;
	off_t offset;
	File *front, *back;
};

VMRegion *vm_create_region(void *addr, size_t len, int prot, int flags,
                           off_t offset, File *back);

#endif