version 1.154, 2004/02/12 03:25:48 |
version 1.155, 2004/03/14 18:18:56 |
|
|
avail->start += PAGE_SIZE; |
avail->start += PAGE_SIZE; |
avail->size -= PAGE_SIZE; |
avail->size -= PAGE_SIZE; |
} |
} |
|
|
/* |
/* |
* Now we need to remove the area we valloc'ed from the available |
* Now we need to remove the area we valloc'ed from the available |
* memory lists. (NB: we may have already alloc'ed the entire space). |
* memory lists. (NB: we may have already alloc'ed the entire space). |
|
|
#ifdef DIAGNOSTIC |
#ifdef DIAGNOSTIC |
vmmap += PAGE_SIZE; /* redzone -- XXXX do we need one? */ |
vmmap += PAGE_SIZE; /* redzone -- XXXX do we need one? */ |
#endif |
#endif |
if ((vmmap ^ INTSTACK) & VA_ALIAS_MASK) |
if ((vmmap ^ INTSTACK) & VA_ALIAS_MASK) |
vmmap += PAGE_SIZE; /* Matchup virtual color for D$ */ |
vmmap += PAGE_SIZE; /* Matchup virtual color for D$ */ |
intstk = vmmap; |
intstk = vmmap; |
cpus = (struct cpu_info *)(intstk+CPUINFO_VA-INTSTACK); |
cpus = (struct cpu_info *)(intstk + CPUINFO_VA - INTSTACK); |
|
|
BDPRINTF(PDB_BOOT1, |
BDPRINTF(PDB_BOOT1, |
("Inserting cpu_info into pmap_kernel() at %p\r\n", |
("Inserting cpu_info into pmap_kernel() at %p\r\n", |
|
|
/* Now map in all 8 pages of cpu_info */ |
/* Now map in all 8 pages of cpu_info */ |
pa = cpu0paddr; |
pa = cpu0paddr; |
prom_map_phys(pa, 64*KB, vmmap, -1); |
prom_map_phys(pa, 64*KB, vmmap, -1); |
|
|
/* |
/* |
* Also map it in as the interrupt stack. |
* Also map it in as the interrupt stack. |
* This lets the PROM see this if needed. |
* This lets the PROM see this if needed. |
|
|
* before installing the locked TTE. |
* before installing the locked TTE. |
*/ |
*/ |
prom_map_phys(pa, 64*KB, CPUINFO_VA, -1); |
prom_map_phys(pa, 64*KB, CPUINFO_VA, -1); |
for (i=0; i<8; i++) { |
for (i = 0; i < 8; i++) { |
int64_t data; |
int64_t data; |
|
|
data = TSB_DATA(0 /* global */, |
data = TSB_DATA(0 /* global */, |
|
|
BDPRINTF(PDB_BOOT1, ("Initializing cpu_info\r\n")); |
BDPRINTF(PDB_BOOT1, ("Initializing cpu_info\r\n")); |
|
|
/* Initialize our cpu_info structure */ |
/* Initialize our cpu_info structure */ |
memset((void*)intstk, 0, 8*PAGE_SIZE); |
memset((void *)intstk, 0, 8 * PAGE_SIZE); |
|
cpus->ci_self = cpus; |
cpus->ci_next = NULL; |
cpus->ci_next = NULL; |
cpus->ci_curlwp = &lwp0; |
cpus->ci_curlwp = &lwp0; |
cpus->ci_cpcb = (struct pcb *)u0[0]; /* Need better source */ |
cpus->ci_cpcb = (struct pcb *)u0[0]; /* Need better source */ |
|
|
cpus->ci_eintstack = (void *)EINTSTACK; |
cpus->ci_eintstack = (void *)EINTSTACK; |
cpus->ci_idle_u = (struct pcb *)(CPUINFO_VA + 2 * PAGE_SIZE); |
cpus->ci_idle_u = (struct pcb *)(CPUINFO_VA + 2 * PAGE_SIZE); |
|
|
cpu0paddr += 64*KB; |
cpu0paddr += 64 * KB; |
|
|
|
CPUSET_CLEAR(cpus_active); |
|
CPUSET_ADD(cpus_active, 0); |
|
|
/* The rest will be done at CPU attach time. */ |
/* The rest will be done at CPU attach time. */ |
BDPRINTF(PDB_BOOT1, |
BDPRINTF(PDB_BOOT1, |
|
|
} |
} |
|
|
vmmap = (vaddr_t)reserve_dumppages((caddr_t)(u_long)vmmap); |
vmmap = (vaddr_t)reserve_dumppages((caddr_t)(u_long)vmmap); |
|
|
/* |
/* |
* Set up bounds of allocatable memory for vmstat et al. |
* Set up bounds of allocatable memory for vmstat et al. |
*/ |
*/ |
|
|
pmap_free_page(pa); |
pmap_free_page(pa); |
} |
} |
#endif |
#endif |
|
|
|
void |
|
pmap_update(struct pmap *pmap) |
|
{ |
|
|
|
#ifdef MULTIPROCESSOR |
|
smp_tlb_flush_all(); |
|
#endif |
|
|
|
if (pmap->pm_refs > 0) { |
|
return; |
|
} |
|
pmap->pm_refs = 1; |
|
pmap_activate_pmap(pmap); |
|
} |