Add a third argument to pmap_bootstrap() which platform-specific

initialization can use to specify additional segment registers to be set
up in the kernel pmap.
This commit is contained in:
kleink 2002-04-23 12:41:04 +00:00
parent 43688aeeca
commit 3a03930d13
9 changed files with 38 additions and 18 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: machdep.c,v 1.17 2001/12/04 18:54:11 is Exp $ */
/* $NetBSD: machdep.c,v 1.18 2002/04/23 12:41:04 kleink Exp $ */
/*
* Copyright (C) 1995, 1996 Wolfgang Solfrank.
@ -252,7 +252,7 @@ initppc(startkernel, endkernel)
/*
* Initialize pmap module
*/
pmap_bootstrap(startkernel, endkernel);
pmap_bootstrap(startkernel, endkernel, NULL);
}

View File

@ -1,4 +1,4 @@
/* $NetBSD: machdep.c,v 1.70 2002/02/26 23:56:52 kleink Exp $ */
/* $NetBSD: machdep.c,v 1.71 2002/04/23 12:41:04 kleink Exp $ */
/*
* Copyright (C) 1995, 1996 Wolfgang Solfrank.
@ -348,7 +348,7 @@ initppc(startkernel, endkernel, args, btinfo)
/*
* Initialize pmap module.
*/
pmap_bootstrap(startkernel, endkernel);
pmap_bootstrap(startkernel, endkernel, NULL);
#ifdef DDB
ddb_init((int)((u_int)endsym - (u_int)startsym), startsym, endsym);

View File

@ -1,4 +1,4 @@
/* $NetBSD: machdep.c,v 1.110 2002/03/02 00:44:08 matt Exp $ */
/* $NetBSD: machdep.c,v 1.111 2002/04/23 12:41:05 kleink Exp $ */
/*
* Copyright (C) 1995, 1996 Wolfgang Solfrank.
@ -391,7 +391,7 @@ initppc(startkernel, endkernel, args)
/*
* Initialize pmap module.
*/
pmap_bootstrap(startkernel, endkernel);
pmap_bootstrap(startkernel, endkernel, NULL);
restore_ofmap(ofmap, ofmaplen);
}

View File

@ -1,4 +1,4 @@
/* $NetBSD: machdep.c,v 1.2 2002/03/02 11:01:50 scw Exp $ */
/* $NetBSD: machdep.c,v 1.3 2002/04/23 12:41:06 kleink Exp $ */
/*
* Copyright (C) 1995, 1996 Wolfgang Solfrank.
@ -336,7 +336,7 @@ initppc(startkernel, endkernel, btinfo)
/*
* Initialize pmap module.
*/
pmap_bootstrap(startkernel, endkernel);
pmap_bootstrap(startkernel, endkernel, NULL);
#ifdef DDB
ddb_init((int)((u_long)endsym - (u_long)startsym), startsym, endsym);

View File

@ -1,4 +1,4 @@
/* $NetBSD: machdep.c,v 1.73 2001/10/29 19:04:26 thorpej Exp $ */
/* $NetBSD: machdep.c,v 1.74 2002/04/23 12:41:07 kleink Exp $ */
/*
* Copyright (C) 1995, 1996 Wolfgang Solfrank.
@ -266,7 +266,7 @@ initppc(startkernel, endkernel, args)
/*
* Initialize pmap module.
*/
pmap_bootstrap(startkernel, endkernel);
pmap_bootstrap(startkernel, endkernel, NULL);
#ifdef DDB
ddb_init((int)((u_int)endsym - (u_int)startsym), startsym, endsym);

View File

@ -1,4 +1,4 @@
/* $NetBSD: pmap.h,v 1.3 2001/06/28 20:31:37 matt Exp $ */
/* $NetBSD: pmap.h,v 1.4 2002/04/23 12:41:07 kleink Exp $ */
/*-
* Copyright (C) 1995, 1996 Wolfgang Solfrank.
@ -73,7 +73,16 @@ extern struct pmap kernel_pmap_;
#define pmap_resident_count(pmap) ((pmap)->pm_stats.resident_count)
#define pmap_wired_count(pmap) ((pmap)->pm_stats.wired_count)
void pmap_bootstrap (vaddr_t kernelstart, vaddr_t kernelend);
/*
* pmap_bootstrap interface
*/
struct segtab {
sr_t st_sr[16]; /* SR contents */
int st_mask; /* st_sr allocation bitmask */
};
void pmap_bootstrap (vaddr_t kernelstart, vaddr_t kernelend,
const struct segtab *);
boolean_t pmap_extract (struct pmap *, vaddr_t, paddr_t *);
boolean_t pmap_query_bit (struct vm_page *, int);
boolean_t pmap_clear_bit (struct vm_page *, int);

View File

@ -1,4 +1,4 @@
/* $NetBSD: pmap.c,v 1.41 2002/04/19 20:56:56 kleink Exp $ */
/* $NetBSD: pmap.c,v 1.42 2002/04/23 12:41:07 kleink Exp $ */
/*-
* Copyright (c) 2001 The NetBSD Foundation, Inc.
* All rights reserved.
@ -2635,7 +2635,8 @@ pmap_boot_find_memory(psize_t size, psize_t alignment, int at_end)
* is really initialized.
*/
void
pmap_bootstrap(paddr_t kernelstart, paddr_t kernelend)
pmap_bootstrap(paddr_t kernelstart, paddr_t kernelend,
const struct segtab *kernsegs)
{
struct mem_region *mp, tmp;
paddr_t s, e;
@ -2903,6 +2904,16 @@ pmap_bootstrap(paddr_t kernelstart, paddr_t kernelend)
__asm __volatile ("mtsr %0,%1"
:: "n"(KERNEL2_SR), "r"(KERNEL2_SEGMENT));
#endif
if (kernsegs != NULL) {
for (i = 0; i < 16; i++) {
if (kernsegs->st_mask & (1 << i)) {
pmap_kernel()->pm_sr[i] = kernsegs->st_sr[i];
__asm __volatile ("mtsrin %0,%1"
:: "r"(i << ADDR_SR_SHFT),
"r"(kernsegs->st_sr[i]));
}
}
}
__asm __volatile ("sync; mtsdr1 %0; isync"
:: "r"((u_int)pmap_pteg_table | (pmap_pteg_mask >> 10)));
tlbia();

View File

@ -1,4 +1,4 @@
/* $NetBSD: machdep.c,v 1.36 2002/03/02 14:25:02 kleink Exp $ */
/* $NetBSD: machdep.c,v 1.37 2002/04/23 12:41:08 kleink Exp $ */
/*
* Copyright (C) 1995, 1996 Wolfgang Solfrank.
@ -371,7 +371,7 @@ initppc(startkernel, endkernel, args, btinfo)
/*
* Initialize pmap module.
*/
pmap_bootstrap(startkernel, endkernel);
pmap_bootstrap(startkernel, endkernel, NULL);
#ifdef DDB
ddb_init((int)((u_long)endsym - (u_long)startsym), startsym, endsym);

View File

@ -1,4 +1,4 @@
/* $NetBSD: machdep.c,v 1.17 2002/03/05 19:06:38 briggs Exp $ */
/* $NetBSD: machdep.c,v 1.18 2002/04/23 12:41:08 kleink Exp $ */
/*
* Copyright (C) 1995, 1996 Wolfgang Solfrank.
@ -356,7 +356,7 @@ printf("availmemr[0].size %x\n", (unsigned) availmemr[0].size);
/*
* Initialize pmap module.
*/
pmap_bootstrap(startkernel, endkernel);
pmap_bootstrap(startkernel, endkernel, NULL);
#ifdef DDB
ddb_init((int)((u_int)endsym - (u_int)startsym), startsym, endsym);