unsigned long pmeg_vaddr[PMEGS_NUM];
unsigned char pmeg_alloc[PMEGS_NUM];
unsigned char pmeg_ctx[PMEGS_NUM];
unsigned long pmeg_vaddr[PMEGS_NUM];
unsigned char pmeg_alloc[PMEGS_NUM];
unsigned char pmeg_ctx[PMEGS_NUM];
memset(rom_pages, 0, sizeof(rom_pages));
memset(pmeg_vaddr, 0, sizeof(pmeg_vaddr));
memset(pmeg_alloc, 0, sizeof(pmeg_alloc));
memset(pmeg_ctx, 0, sizeof(pmeg_ctx));
memset(rom_pages, 0, sizeof(rom_pages));
memset(pmeg_vaddr, 0, sizeof(pmeg_vaddr));
memset(pmeg_alloc, 0, sizeof(pmeg_alloc));
memset(pmeg_ctx, 0, sizeof(pmeg_ctx));
/* pmeg align the end of bootmem, adding another pmeg,
* later bootmem allocations will likely need it */
bootmem_end = (bootmem_end + (2 * SUN3_PMEG_SIZE)) & ~SUN3_PMEG_MASK;
/* pmeg align the end of bootmem, adding another pmeg,
* later bootmem allocations will likely need it */
bootmem_end = (bootmem_end + (2 * SUN3_PMEG_SIZE)) & ~SUN3_PMEG_MASK;
/* liberate all existing mappings in the rest of kernel space */
for(seg = bootmem_end; seg < 0x0f800000; seg += SUN3_PMEG_SIZE) {
i = sun3_get_segmap(seg);
/* liberate all existing mappings in the rest of kernel space */
for(seg = bootmem_end; seg < 0x0f800000; seg += SUN3_PMEG_SIZE) {
i = sun3_get_segmap(seg);
/* blank everything below the kernel, and we've got the base
mapping to start all the contexts off with... */
/* blank everything below the kernel, and we've got the base
mapping to start all the contexts off with... */
sure it could be much more intellegent... but it gets the job done
for now without much overhead in making it's decision. */
/* todo: come up with optimized scheme for flushing contexts */
sure it could be much more intellegent... but it gets the job done
for now without much overhead in making it's decision. */
/* todo: come up with optimized scheme for flushing contexts */
for(i = 0; i < CONTEXTS_NUM; i++) {
sun3_put_context(i);
sun3_put_segmap (vaddr, curr_pmeg);
for(i = 0; i < CONTEXTS_NUM; i++) {
sun3_put_context(i);
sun3_put_segmap (vaddr, curr_pmeg);
sun3_put_pte (vaddr + i, SUN3_PAGE_SYSTEM);
/* Consider a different one next time. */
sun3_put_pte (vaddr + i, SUN3_PAGE_SYSTEM);
/* Consider a different one next time. */
mmu_emu_map_pmeg (context, vaddr);
/* Write the pte value to hardware MMU */
mmu_emu_map_pmeg (context, vaddr);
/* Write the pte value to hardware MMU */