#include #include #include #define PG_ALIGN __attribute((aligned(PGSIZE))) static void* (*pgalloc_usr)(size_t) = NULL; static void (*pgfree_usr)(void*) = NULL; static int vme_enable = 0; int _vme_init(void* (*pgalloc_f)(size_t), void (*pgfree_f)(void*)) { pgalloc_usr = pgalloc_f; pgfree_usr = pgfree_f; vme_enable = 1; return 0; } int _protect(_AddressSpace *as) { as->ptr = (PDE*)(pgalloc_usr(1)); return 0; } void _unprotect(_AddressSpace *as) { } static _AddressSpace *cur_as = NULL; void __am_get_cur_as(_Context *c) { c->as = cur_as; } void __am_switch(_Context *c) { if (vme_enable) { cur_as = c->as; } } int _map(_AddressSpace *as, void *va, void *pa, int prot) { return 0; } _Context *_ucontext(_AddressSpace *as, _Area ustack, _Area kstack, void *entry, void *args) { return NULL; }