From 06e4ef146124925fe83eaa4ffdd54b0b0d7b5214 Mon Sep 17 00:00:00 2001
From: Dmitrij Tejblum
Date: Tue, 11 May 1999 18:55:18 +0000
Subject: [PATCH] Initialize bootifo.envp, so that the kernel environment can
be used.
Set kernelname. Get it as getenv("kernelname"), bootinfo.booted_kernel does
not contain path to the directory.
---
sys/alpha/alpha/db_interface.c | 2 --
sys/alpha/alpha/machdep.c | 7 ++++++-
sys/alpha/alpha/pmap.c | 13 ++++++++++---
3 files changed, 16 insertions(+), 6 deletions(-)
diff --git a/sys/alpha/alpha/db_interface.c b/sys/alpha/alpha/db_interface.c
index 99bae72405a3..ffd82c14c398 100644
--- a/sys/alpha/alpha/db_interface.c
+++ b/sys/alpha/alpha/db_interface.c
@@ -79,8 +79,6 @@ extern jmp_buf db_jmpbuf;
extern void gdb_handle_exception __P((db_regs_t *, int, int));
-extern label_t *db_recover;
-
#if 0
extern char *trap_type[];
extern int trap_types;
diff --git a/sys/alpha/alpha/machdep.c b/sys/alpha/alpha/machdep.c
index a4d8c7d6e628..dcb2d76421eb 100644
--- a/sys/alpha/alpha/machdep.c
+++ b/sys/alpha/alpha/machdep.c
@@ -23,7 +23,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: machdep.c,v 1.39 1999/04/23 19:53:37 dt Exp $
+ * $Id: machdep.c,v 1.40 1999/04/26 08:57:51 peter Exp $
*/
/*-
* Copyright (c) 1998 The NetBSD Foundation, Inc.
@@ -629,6 +629,7 @@ alpha_init(pfn, ptb, bim, bip, biv)
bootinfo.esym = v1p->esym;
bootinfo.kernend = v1p->kernend;
bootinfo.modptr = v1p->modptr;
+ bootinfo.envp = v1p->envp;
/* hwrpb may not be provided by boot block in v1 */
if (v1p->hwrpb != NULL) {
bootinfo.hwrpb_phys =
@@ -788,6 +789,10 @@ alpha_init(pfn, ptb, bim, bip, biv)
preload_metadata = (caddr_t)bootinfo.modptr;
kern_envp = bootinfo.envp;
+ p = getenv("kernelname");
+ if (p)
+ strncpy(kernelname, p, sizeof(kernelname) - 1);
+
kernstartpfn = atop(ALPHA_K0SEG_TO_PHYS(kernstart));
kernendpfn = atop(ALPHA_K0SEG_TO_PHYS(kernend));
#ifdef SIMOS
diff --git a/sys/alpha/alpha/pmap.c b/sys/alpha/alpha/pmap.c
index 08f98836c07e..40289a976c29 100644
--- a/sys/alpha/alpha/pmap.c
+++ b/sys/alpha/alpha/pmap.c
@@ -43,7 +43,7 @@
* from: @(#)pmap.c 7.7 (Berkeley) 5/12/91
* from: i386 Id: pmap.c,v 1.193 1998/04/19 15:22:48 bde Exp
* with some ideas from NetBSD's alpha pmap
- * $Id: pmap.c,v 1.20 1999/04/23 20:29:58 dt Exp $
+ * $Id: pmap.c,v 1.21 1999/04/28 15:52:09 dt Exp $
*/
/*
@@ -2169,6 +2169,8 @@ pmap_enter(pmap_t pmap, vm_offset_t va, vm_offset_t pa, vm_prot_t prot,
*pte = newpte;
if (origpte)
pmap_invalidate_page(pmap, va);
+ if (prot & VM_PROT_EXECUTE)
+ alpha_pal_imb();
}
}
@@ -2187,7 +2189,8 @@ static vm_page_t
pmap_enter_quick(pmap_t pmap, vm_offset_t va, vm_offset_t pa, vm_page_t mpte)
{
register pt_entry_t *pte;
-
+ pt_entry_t npte;
+ pv_table_t* ppv;
/*
* In the case that a page table page is not
@@ -2259,10 +2262,14 @@ pmap_enter_quick(pmap_t pmap, vm_offset_t va, vm_offset_t pa, vm_page_t mpte)
*/
pmap->pm_stats.resident_count++;
+ ppv = pa_to_pvh(pa);
+
/*
* Now validate mapping with RO protection
*/
- *pte = pmap_phys_to_pte(pa) | PG_V | PG_KRE | PG_URE | PG_MANAGED;
+ *pte = pmap_phys_to_pte(pa) | PG_V | PG_KRE | PG_URE | PG_MANAGED |
+ (!(ppv->pv_flags & PV_TABLE_REF) ? (PG_FOR | PG_FOW | PG_FOE) : 0);
+ pmap_invalidate_page(pmap, va);
return mpte;
}