src/kernel/mm/vmm/vmm.c
/**
 * @note when a new user vmm pool
 *       is created, use this function
 *       to copy kernel space to the
 *       new pool.
 * @param vmm_pool
 */
@note when a new user vmm pool
is created, use this function
to copy kernel space to the
new pool.
@note when a new user vmm pool is created use this function to copy kernel space to the new pool .
void vmm_copy_kern_space(vmm_t * vmm_pool){
    size_t index = _get_pte_index(CONFIG_KERN_ADDR_START,2);
    void * dest = &vmm_pool->pagetable[index];
    void * src = &kernel_pool.pagetable[index];
    size_t  len = ((addr_t)kernel_pool.pagetable)+PAGE_SIZE-(addr_t)src;
    memcpy(dest,src,len);
}
void vmm_copy_kern_space ( vmm_t * vmm_pool ) { size_t index = _get_pte_index ( CONFIG_KERN_ADDR_START , 2 ) ; void * dest = & vmm_pool -> pagetable [ index ] ; void * src = & kernel_pool . pagetable [ index ] ; size_t len = ( ( addr_t ) kernel_pool . pagetable ) + PAGE_SIZE - ( addr_t ) src ; memcpy ( dest , src , len ) ; }
@note when a new user vmm pool
       is created, use this function
       to copy kernel space to the
       new pool.
@note when a new user vmm pool is created use this function to copy kernel space to the new pool .