Subversion Repositories HelenOS-historic

Compare Revisions

Ignore whitespace Rev 389 → Rev 391

/SPARTAN/trunk/src/proc/the.c
43,6 → 43,7
the->cpu = NULL;
the->thread = NULL;
the->task = NULL;
the->vm = NULL;
}
 
/** Copy THE structure
/SPARTAN/trunk/src/main/kinit.c
54,6 → 54,8
#include <test.h>
#endif /* __TEST__ */
 
#include <mm/frame.h>
 
void kinit(void *arg)
{
vm_t *m;
/SPARTAN/trunk/src/mm/vm.c
32,6 → 32,8
#include <mm/tlb.h>
#include <mm/heap.h>
#include <arch/mm/page.h>
#include <arch/mm/asid.h>
#include <arch/mm/vm.h>
#include <arch/types.h>
#include <typedefs.h>
#include <synch/spinlock.h>
56,6 → 58,8
spinlock_initialize(&m->lock);
list_initialize(&m->vm_area_head);
 
m->asid = asid_get();
 
/*
* Each vm_t is supposed to have its own page table.
* It is either passed one or it has to allocate and set one up.
199,4 → 203,8
tlb_shootdown_finalize();
 
cpu_priority_restore(pri);
 
vm_install_arch(m);
VM = m;
}
/SPARTAN/trunk/src/mm/page.c
34,7 → 34,6
#include <arch/asm.h>
#include <memstr.h>
 
 
void page_init(void)
{
page_arch_init();
109,3 → 108,36
SET_FRAME_ADDRESS(ptl3, PTL3_INDEX(page), frame);
SET_FRAME_FLAGS(ptl3, PTL3_INDEX(page), flags);
}
 
/** Find mapping for virtual page
*
* Find mapping for virtual page.
*
* @param page Virtual page.
* @param root PTL0 address if non-zero.
*
* @return NULL if there is no such mapping; entry from PTL3 describing the mapping otherwise.
*/
pte_t *find_mapping(__address page, __address root)
{
pte_t *ptl0, *ptl1, *ptl2, *ptl3;
 
ptl0 = (pte_t *) PA2KA(root ? root : (__address) GET_PTL0_ADDRESS());
 
if (GET_PTL1_FLAGS(ptl0, PTL0_INDEX(page)) & PAGE_NOT_PRESENT)
return NULL;
 
ptl1 = (pte_t *) PA2KA(GET_PTL1_ADDRESS(ptl0, PTL0_INDEX(page)));
 
if (GET_PTL2_FLAGS(ptl1, PTL1_INDEX(page)) & PAGE_NOT_PRESENT)
return NULL;
 
ptl2 = (pte_t *) PA2KA(GET_PTL2_ADDRESS(ptl1, PTL1_INDEX(page)));
 
if (GET_PTL3_FLAGS(ptl2, PTL2_INDEX(page)) & PAGE_NOT_PRESENT)
return NULL;
 
ptl3 = (pte_t *) PA2KA(GET_PTL3_ADDRESS(ptl2, PTL2_INDEX(page)));
 
return &ptl3[PTL3_INDEX(page)];
}
/SPARTAN/trunk/src/time/clock.c
39,6 → 39,7
#include <arch.h>
#include <list.h>
#include <arch/atomic.h>
#include <proc/thread.h>
 
/** Clock routine
*