Author: nwhitehorn
Date: Sun Mar  1 21:23:23 2015
New Revision: 279498
URL: https://svnweb.freebsd.org/changeset/base/279498

Log:
  Initialize NX stack capabilities and direct map status in pmap like on AIM.

Modified:
  head/sys/powerpc/booke/machdep.c
  head/sys/powerpc/booke/pmap.c

Modified: head/sys/powerpc/booke/machdep.c
==============================================================================
--- head/sys/powerpc/booke/machdep.c    Sun Mar  1 21:22:34 2015        
(r279497)
+++ head/sys/powerpc/booke/machdep.c    Sun Mar  1 21:23:23 2015        
(r279498)
@@ -226,9 +226,6 @@ cpu_booke_startup(void *dummy)
        /* Set up buffers, so they can be used to read disk labels. */
        bufinit();
        vm_pager_bufferinit();
-
-       /* Cpu supports execution permissions on the pages. */
-       elf32_nxstack = 1;
 }
 
 static char *
@@ -454,7 +451,6 @@ booke_init(uint32_t arg1, uint32_t arg2)
        /* Initialise virtual memory. */
        pmap_mmu_install(MMU_TYPE_BOOKE, 0);
        pmap_bootstrap((uintptr_t)kernel_text, end);
-       pmap_bootstrapped = 1;
        debugf("MSR = 0x%08x\n", mfmsr());
 #if defined(BOOKE_E500)
        //tlb1_print_entries();

Modified: head/sys/powerpc/booke/pmap.c
==============================================================================
--- head/sys/powerpc/booke/pmap.c       Sun Mar  1 21:22:34 2015        
(r279497)
+++ head/sys/powerpc/booke/pmap.c       Sun Mar  1 21:23:23 2015        
(r279498)
@@ -1014,6 +1014,10 @@ mmu_booke_bootstrap(mmu_t mmu, vm_offset
 
        debugf("mmu_booke_bootstrap: entered\n");
 
+       /* Set interesting system properties */
+       hw_direct_map = 0;
+       elf32_nxstack = 1;
+
        /* Initialize invalidation mutex */
        mtx_init(&tlbivax_mutex, "tlbivax", NULL, MTX_SPIN);
 
@@ -1315,6 +1319,8 @@ mmu_booke_bootstrap(mmu_t mmu, vm_offset
                kstack0 += PAGE_SIZE;
                kstack0_phys += PAGE_SIZE;
        }
+
+       pmap_bootstrapped = 1;
        
        debugf("virtual_avail = %08x\n", virtual_avail);
        debugf("virtual_end   = %08x\n", virtual_end);
_______________________________________________
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"

Reply via email to