Allocate lwp0upa (PA of lwp0 uarea) right after kernel rather than

between other page tables to use different mappings for ste/pte pages
as well as amiga and atari.  Should resolve XXX comments in next68k and x68k.

Tested on hp300 and mac68k.
This commit is contained in:
tsutsui 2009-12-04 18:55:13 +00:00
parent 353cefd7f1
commit a45ee63e6e
8 changed files with 70 additions and 72 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: pmap_bootstrap.c,v 1.20 2009/12/04 18:32:31 tsutsui Exp $ */
/* $NetBSD: pmap_bootstrap.c,v 1.21 2009/12/04 18:55:13 tsutsui Exp $ */
/*
* Copyright (c) 1991, 1993
@ -36,7 +36,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: pmap_bootstrap.c,v 1.20 2009/12/04 18:32:31 tsutsui Exp $");
__KERNEL_RCSID(0, "$NetBSD: pmap_bootstrap.c,v 1.21 2009/12/04 18:55:13 tsutsui Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@ -91,9 +91,15 @@ pmap_bootstrap(vm_offset_t nextpa, vm_offset_t firstpa)
/*
* Calculate important physical addresses:
*
* lwp0upa lwp 0 u-area UPAGES pages
*
* kstpa kernel segment table 1 page (!040)
* N pages (040)
*
* kptmpa kernel PT map 1 page
*
* lkptpa last kernel PT page 1 page
*
* kptpa statically allocated
* kernel PT pages Sysptsize+ pages
*
@ -101,15 +107,11 @@ pmap_bootstrap(vm_offset_t nextpa, vm_offset_t firstpa)
* EIOMAPSIZE are the number of PTEs, hence we need to round
* the total to a page boundary with IO maps at the end. ]
*
* kptmpa kernel PT map 1 page
*
* lkptpa last kernel PT page 1 page
*
* lwp0upa lwp 0 u-area UPAGES pages
*
* The KVA corresponding to any of these PAs is:
* (PA - firstpa + KERNBASE).
*/
lwp0upa = nextpa;
nextpa += USPACE;
if (RELOC(mmutype, int) == MMU_68040)
kstsize = MAXKL2SIZE / (NPTEPG/SG4_LEV2SIZE);
else
@ -120,8 +122,6 @@ pmap_bootstrap(vm_offset_t nextpa, vm_offset_t firstpa)
nextpa += PAGE_SIZE;
lkptpa = nextpa;
nextpa += PAGE_SIZE;
lwp0upa = nextpa;
nextpa += USPACE;
kptpa = nextpa;
nptpages = RELOC(Sysptsize, int);
nextpa += nptpages * PAGE_SIZE;

View File

@ -1,4 +1,4 @@
/* $NetBSD: pmap_bootstrap.c,v 1.41 2009/12/04 18:32:31 tsutsui Exp $ */
/* $NetBSD: pmap_bootstrap.c,v 1.42 2009/12/04 18:55:14 tsutsui Exp $ */
/*
* Copyright (c) 1991, 1993
@ -36,7 +36,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: pmap_bootstrap.c,v 1.41 2009/12/04 18:32:31 tsutsui Exp $");
__KERNEL_RCSID(0, "$NetBSD: pmap_bootstrap.c,v 1.42 2009/12/04 18:55:14 tsutsui Exp $");
#include <sys/param.h>
@ -101,9 +101,15 @@ pmap_bootstrap(paddr_t nextpa, paddr_t firstpa)
/*
* Calculate important physical addresses:
*
* lwp0upa lwp 0 u-area UPAGES pages
*
* kstpa kernel segment table 1 page (!040)
* N pages (040)
*
* kptmpa kernel PT map 1 page
*
* lkptpa last kernel PT page 1 page
*
* kptpa statically allocated
* kernel PT pages Sysptsize+ pages
*
@ -111,15 +117,11 @@ pmap_bootstrap(paddr_t nextpa, paddr_t firstpa)
* EIOMAPSIZE are the number of PTEs, hence we need to round
* the total to a page boundary with IO maps at the end. ]
*
* kptmpa kernel PT map 1 page
*
* lkptpa last kernel PT page 1 page
*
* lwp0upa lwp 0 u-area UPAGES pages
*
* The KVA corresponding to any of these PAs is:
* (PA - firstpa + KERNBASE).
*/
lwp0upa = nextpa;
nextpa += USPACE;
if (RELOC(mmutype, int) == MMU_68040)
kstsize = MAXKL2SIZE / (NPTEPG/SG4_LEV2SIZE);
else
@ -130,8 +132,6 @@ pmap_bootstrap(paddr_t nextpa, paddr_t firstpa)
nextpa += PAGE_SIZE;
lkptpa = nextpa;
nextpa += PAGE_SIZE;
lwp0upa = nextpa;
nextpa += USPACE;
kptpa = nextpa;
nptpages = RELOC(Sysptsize, int) +
(IIOMAPSIZE + EIOMAPSIZE + NPTEPG - 1) / NPTEPG;

View File

@ -1,4 +1,4 @@
/* $NetBSD: pmap_bootstrap.c,v 1.21 2009/12/04 18:32:31 tsutsui Exp $ */
/* $NetBSD: pmap_bootstrap.c,v 1.22 2009/12/04 18:55:14 tsutsui Exp $ */
/*
* Copyright (c) 1991, 1993
@ -36,7 +36,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: pmap_bootstrap.c,v 1.21 2009/12/04 18:32:31 tsutsui Exp $");
__KERNEL_RCSID(0, "$NetBSD: pmap_bootstrap.c,v 1.22 2009/12/04 18:55:14 tsutsui Exp $");
#include <sys/param.h>
@ -92,9 +92,13 @@ pmap_bootstrap(paddr_t nextpa, paddr_t firstpa)
/*
* Calculate important physical addresses:
*
* lwp0upa lwp 0 u-area UPAGES pages
*
* kstpa kernel segment table 1 page (!040)
* N pages (040)
*
* kptmpa kernel PT map 1 page
*
* kptpa statically allocated
* kernel PT pages Sysptsize+ pages
*
@ -102,16 +106,14 @@ pmap_bootstrap(paddr_t nextpa, paddr_t firstpa)
* is the number of PTEs, hence we need to round
* the total to a page boundary with IO maps at the end. ]
*
* kptmpa kernel PT map 1 page
*
* lwp0upa lwp 0 u-area UPAGES pages
*
* The KVA corresponding to any of these PAs is:
* (PA - firstpa + KERNBASE).
*/
iiomapsize = m68k_btop(RELOC(intiotop_phys, u_int) -
RELOC(intiobase_phys, u_int));
lwp0upa = nextpa;
nextpa += USPACE;
if (RELOC(mmutype, int) == MMU_68040)
kstsize = MAXKL2SIZE / (NPTEPG/SG4_LEV2SIZE);
else
@ -120,8 +122,6 @@ pmap_bootstrap(paddr_t nextpa, paddr_t firstpa)
nextpa += kstsize * PAGE_SIZE;
kptmpa = nextpa;
nextpa += PAGE_SIZE;
lwp0upa = nextpa;
nextpa += USPACE;
kptpa = nextpa;
nptpages = RELOC(Sysptsize, int) +
(iiomapsize + NPTEPG - 1) / NPTEPG;

View File

@ -1,4 +1,4 @@
/* $NetBSD: pmap_bootstrap.c,v 1.82 2009/12/04 18:32:31 tsutsui Exp $ */
/* $NetBSD: pmap_bootstrap.c,v 1.83 2009/12/04 18:55:14 tsutsui Exp $ */
/*
* Copyright (c) 1991, 1993
@ -36,7 +36,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: pmap_bootstrap.c,v 1.82 2009/12/04 18:32:31 tsutsui Exp $");
__KERNEL_RCSID(0, "$NetBSD: pmap_bootstrap.c,v 1.83 2009/12/04 18:55:14 tsutsui Exp $");
#include "opt_ddb.h"
#include "opt_kgdb.h"
@ -126,9 +126,13 @@ pmap_bootstrap(paddr_t nextpa, paddr_t firstpa)
/*
* Calculate important physical addresses:
*
* lwp0upa lwp 0 u-area UPAGES pages
*
* kstpa kernel segment table 1 page (!040)
* N pages (040)
*
* kptmpa kernel PT map 1 page
*
* kptpa statically allocated
* kernel PT pages Sysptsize+ pages
*
@ -136,11 +140,9 @@ pmap_bootstrap(paddr_t nextpa, paddr_t firstpa)
* NBMAPSIZE are the number of PTEs, hence we need to round
* the total to a page boundary with IO maps at the end. ]
*
* kptmpa kernel PT map 1 page
*
* lwp0upa lwp 0 u-area UPAGES pages
*
*/
lwp0upa = nextpa;
nextpa += USPACE;
if (mmutype == MMU_68040)
kstsize = MAXKL2SIZE / (NPTEPG/SG4_LEV2SIZE);
else
@ -149,8 +151,6 @@ pmap_bootstrap(paddr_t nextpa, paddr_t firstpa)
nextpa += kstsize * PAGE_SIZE;
kptmpa = nextpa;
nextpa += PAGE_SIZE;
lwp0upa = nextpa;
nextpa += USPACE;
kptpa = nextpa;
nptpages = Sysptsize +
(IIOMAPSIZE + ROMMAPSIZE + VIDMAPSIZE + NPTEPG - 1) / NPTEPG;

View File

@ -1,4 +1,4 @@
/* $NetBSD: pmap_bootstrap.c,v 1.35 2009/12/04 18:32:31 tsutsui Exp $ */
/* $NetBSD: pmap_bootstrap.c,v 1.36 2009/12/04 18:55:14 tsutsui Exp $ */
/*
* Copyright (c) 1991, 1993
@ -36,7 +36,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: pmap_bootstrap.c,v 1.35 2009/12/04 18:32:31 tsutsui Exp $");
__KERNEL_RCSID(0, "$NetBSD: pmap_bootstrap.c,v 1.36 2009/12/04 18:55:14 tsutsui Exp $");
#include <sys/param.h>
#include <sys/kcore.h>
@ -99,9 +99,15 @@ pmap_bootstrap(paddr_t nextpa, paddr_t firstpa)
/*
* Calculate important physical addresses:
*
* lwp0upa lwp0 0 u-area UPAGES pages
*
* kstpa kernel segment table 1 page (!040)
* N pages (040)
*
* kptmpa kernel PT map 1 page
*
* lkptpa last kernel PT page 1 page
*
* kptpa statically allocated
* kernel PT pages Sysptsize+ pages
*
@ -109,12 +115,6 @@ pmap_bootstrap(paddr_t nextpa, paddr_t firstpa)
* number of PTEs, hence we need to round the total to a page
* boundary with IO maps at the end. ]
*
* kptmpa kernel PT map 1 page
*
* lkptpa last kernel PT page 1 page
*
* lwp0upa lwp0 0 u-area UPAGES pages
*
* The KVA corresponding to any of these PAs is:
* (PA - firstpa + KERNBASE).
*/

View File

@ -1,4 +1,4 @@
/* $NetBSD: pmap_bootstrap.c,v 1.25 2009/12/04 18:32:31 tsutsui Exp $ */
/* $NetBSD: pmap_bootstrap.c,v 1.26 2009/12/04 18:55:14 tsutsui Exp $ */
/*
* Copyright (c) 1991, 1993
@ -39,7 +39,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: pmap_bootstrap.c,v 1.25 2009/12/04 18:32:31 tsutsui Exp $");
__KERNEL_RCSID(0, "$NetBSD: pmap_bootstrap.c,v 1.26 2009/12/04 18:55:14 tsutsui Exp $");
#include <sys/param.h>
@ -98,9 +98,13 @@ pmap_bootstrap(paddr_t nextpa, paddr_t firstpa)
/*
* Calculate important physical addresses:
*
* lwp0upa lwp 0 u-area UPAGES pages
*
* kstpa kernel segment table 1 page (!040)
* N pages (040)
*
* kptmpa kernel PT map 1 page
*
* kptpa statically allocated
* kernel PT pages Sysptsize+ pages
*
@ -108,10 +112,6 @@ pmap_bootstrap(paddr_t nextpa, paddr_t firstpa)
* EIOMAPSIZE are the number of PTEs, hence we need to round
* the total to a page boundary with IO maps at the end. ]
*
* kptmpa kernel PT map 1 page
*
* lwp0upa lwp 0 u-area UPAGES pages
*
* The KVA corresponding to any of these PAs is:
* (PA - firstpa + KERNBASE).
*/
@ -124,6 +124,8 @@ pmap_bootstrap(paddr_t nextpa, paddr_t firstpa)
eiomapsize = m68k_btop(RELOC(extiotop_phys, u_int) -
RELOC(extiobase_phys, u_int));
lwp0upa = nextpa;
nextpa += USPACE;
#ifdef M68040
if (RELOC(mmutype, int) == MMU_68040)
kstsize = MAXKL2SIZE / (NPTEPG/SG4_LEV2SIZE);
@ -136,8 +138,6 @@ pmap_bootstrap(paddr_t nextpa, paddr_t firstpa)
nextpa += kstsize * PAGE_SIZE;
kptmpa = nextpa;
nextpa += PAGE_SIZE;
lwp0upa = nextpa;
nextpa += USPACE;
kptpa = nextpa;
nptpages = RELOC(Sysptsize, int) +
(iiomapsize + eiomapsize + NPTEPG - 1) / NPTEPG;

View File

@ -1,4 +1,4 @@
/* $NetBSD: pmap_bootstrap.c,v 1.30 2009/12/04 18:32:31 tsutsui Exp $ */
/* $NetBSD: pmap_bootstrap.c,v 1.31 2009/12/04 18:55:14 tsutsui Exp $ */
/*
* This file was taken from mvme68k/mvme68k/pmap_bootstrap.c
@ -45,7 +45,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: pmap_bootstrap.c,v 1.30 2009/12/04 18:32:31 tsutsui Exp $");
__KERNEL_RCSID(0, "$NetBSD: pmap_bootstrap.c,v 1.31 2009/12/04 18:55:14 tsutsui Exp $");
#include <sys/param.h>
#include <sys/kcore.h>
@ -111,9 +111,15 @@ pmap_bootstrap(paddr_t nextpa, paddr_t firstpa)
/*
* Calculate important physical addresses:
*
* lwp0upa lwp 0 u-area UPAGES pages
*
* kstpa kernel segment table 1 page (!040)
* N pages (040)
*
* kptmpa kernel PT map 1 page
*
* lkptpa last kernel PT page 1 page
*
* kptpa statically allocated
* kernel PT pages Sysptsize+ pages
*
@ -121,15 +127,11 @@ pmap_bootstrap(paddr_t nextpa, paddr_t firstpa)
* is the number of PTEs, hence we need to round
* the total to a page boundary with IO maps at the end. ]
*
* kptmpa kernel PT map 1 page
*
* lkptpa last kernel PT page 1 page
*
* lwp0upa lwp 0 u-area UPAGES pages
*
* The KVA corresponding to any of these PAs is:
* (PA - firstpa + KERNBASE).
*/
lwp0upa = nextpa;
nextpa += USPACE;
#if defined(M68040) || defined(M68060)
if (RELOC(mmutype, int) == MMU_68040)
kstsize = MAXKL2SIZE / (NPTEPG/SG4_LEV2SIZE);
@ -142,8 +144,6 @@ pmap_bootstrap(paddr_t nextpa, paddr_t firstpa)
nextpa += PAGE_SIZE;
lkptpa = nextpa;
nextpa += PAGE_SIZE;
lwp0upa = nextpa;
nextpa += USPACE;
kptpa = nextpa;
nptpages = RELOC(Sysptsize, int) +
(IIOMAPSIZE + MONOMAPSIZE + COLORMAPSIZE + NPTEPG - 1) / NPTEPG;
@ -364,7 +364,6 @@ pmap_bootstrap(paddr_t nextpa, paddr_t firstpa)
* map the kernel segment table cache invalidated for
* these machines (for the 68040 not strictly necessary, but
* recommended by Motorola; for the 68060 mandatory)
* XXX this includes lwp0upa. why?
*/
epte = &((u_int *)kptpa)[m68k_btop(nextpa - firstpa)];
protopte = (protopte & ~PG_PROT) | PG_RW;

View File

@ -1,4 +1,4 @@
/* $NetBSD: pmap_bootstrap.c,v 1.44 2009/12/04 18:32:31 tsutsui Exp $ */
/* $NetBSD: pmap_bootstrap.c,v 1.45 2009/12/04 18:55:14 tsutsui Exp $ */
/*
* Copyright (c) 1991, 1993
@ -36,7 +36,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: pmap_bootstrap.c,v 1.44 2009/12/04 18:32:31 tsutsui Exp $");
__KERNEL_RCSID(0, "$NetBSD: pmap_bootstrap.c,v 1.45 2009/12/04 18:55:14 tsutsui Exp $");
#include "opt_m680x0.h"
@ -92,9 +92,13 @@ pmap_bootstrap(paddr_t nextpa, paddr_t firstpa)
/*
* Calculate important physical addresses:
*
* lwp0upa lwp 0 u-area UPAGES pages
*
* kstpa kernel segment table 1 page (!040)
* N pages (040)
*
* kptmpa kernel PT map 1 page
*
* kptpa statically allocated
* kernel PT pages Sysptsize+ pages
*
@ -102,13 +106,11 @@ pmap_bootstrap(paddr_t nextpa, paddr_t firstpa)
* is the number of PTEs, hence we need to round
* the total to a page boundary with IO maps at the end. ]
*
* kptmpa kernel PT map 1 page
*
* lwp0upa lwp 0 u-area UPAGES pages
*
* The KVA corresponding to any of these PAs is:
* (PA - firstpa + KERNBASE).
*/
lwp0upa = nextpa;
nextpa += USPACE;
if (RELOC(mmutype, int) == MMU_68040)
kstsize = MAXKL2SIZE / (NPTEPG/SG4_LEV2SIZE);
else
@ -117,8 +119,6 @@ pmap_bootstrap(paddr_t nextpa, paddr_t firstpa)
nextpa += kstsize * PAGE_SIZE;
kptmpa = nextpa;
nextpa += PAGE_SIZE;
lwp0upa = nextpa;
nextpa += USPACE;
kptpa = nextpa;
nptpages = RELOC(Sysptsize, int) +
(IIOMAPSIZE + NPTEPG - 1) / NPTEPG;
@ -300,7 +300,6 @@ pmap_bootstrap(paddr_t nextpa, paddr_t firstpa)
* map the kernel segment table cache invalidated for
* these machines (for the 68040 not strictly necessary, but
* recommended by Motorola; for the 68060 mandatory)
* XXX this includes lwp0upa. why?
*/
epte = &((u_int *)kptpa)[m68k_btop(nextpa - firstpa)];
protopte = (protopte & ~PG_PROT) | PG_RW;