~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

TOMOYO Linux Cross Reference
Linux/arch/m68k/mm/sun3mmu.c

Version: ~ [ linux-5.5 ] ~ [ linux-5.4.15 ] ~ [ linux-5.3.18 ] ~ [ linux-5.2.21 ] ~ [ linux-5.1.21 ] ~ [ linux-5.0.21 ] ~ [ linux-4.20.17 ] ~ [ linux-4.19.98 ] ~ [ linux-4.18.20 ] ~ [ linux-4.17.19 ] ~ [ linux-4.16.18 ] ~ [ linux-4.15.18 ] ~ [ linux-4.14.167 ] ~ [ linux-4.13.16 ] ~ [ linux-4.12.14 ] ~ [ linux-4.11.12 ] ~ [ linux-4.10.17 ] ~ [ linux-4.9.211 ] ~ [ linux-4.8.17 ] ~ [ linux-4.7.10 ] ~ [ linux-4.6.7 ] ~ [ linux-4.5.7 ] ~ [ linux-4.4.211 ] ~ [ linux-4.3.6 ] ~ [ linux-4.2.8 ] ~ [ linux-4.1.52 ] ~ [ linux-4.0.9 ] ~ [ linux-3.19.8 ] ~ [ linux-3.18.140 ] ~ [ linux-3.17.8 ] ~ [ linux-3.16.81 ] ~ [ linux-3.15.10 ] ~ [ linux-3.14.79 ] ~ [ linux-3.13.11 ] ~ [ linux-3.12.74 ] ~ [ linux-3.11.10 ] ~ [ linux-3.10.108 ] ~ [ linux-3.9.11 ] ~ [ linux-3.8.13 ] ~ [ linux-3.7.10 ] ~ [ linux-3.6.11 ] ~ [ linux-3.5.7 ] ~ [ linux-3.4.113 ] ~ [ linux-3.3.8 ] ~ [ linux-3.2.102 ] ~ [ linux-3.1.10 ] ~ [ linux-3.0.101 ] ~ [ linux-2.6.32.71 ] ~ [ linux-2.6.0 ] ~ [ linux-2.4.37.11 ] ~ [ unix-v6-master ] ~ [ ccs-tools-1.8.5 ] ~ [ policy-sample ] ~
Architecture: ~ [ i386 ] ~ [ alpha ] ~ [ m68k ] ~ [ mips ] ~ [ ppc ] ~ [ sparc ] ~ [ sparc64 ] ~

  1 /*
  2  * linux/arch/m68k/mm/sun3mmu.c
  3  *
  4  * Implementations of mm routines specific to the sun3 MMU.
  5  *
  6  * Moved here 8/20/1999 Sam Creasey
  7  *
  8  */
  9 
 10 #include <linux/signal.h>
 11 #include <linux/sched.h>
 12 #include <linux/mm.h>
 13 #include <linux/swap.h>
 14 #include <linux/kernel.h>
 15 #include <linux/string.h>
 16 #include <linux/types.h>
 17 #include <linux/init.h>
 18 #include <linux/bootmem.h>
 19 
 20 #include <asm/setup.h>
 21 #include <asm/uaccess.h>
 22 #include <asm/page.h>
 23 #include <asm/pgtable.h>
 24 #include <asm/machdep.h>
 25 #include <asm/io.h>
 26 
 27 extern void mmu_emu_init (unsigned long bootmem_end);
 28 
 29 const char bad_pmd_string[] = "Bad pmd in pte_alloc: %08lx\n";
 30 
 31 extern unsigned long num_pages;
 32 
 33 void free_initmem(void)
 34 {
 35 }
 36 
 37 /* For the sun3 we try to follow the i386 paging_init() more closely */
 38 /* start_mem and end_mem have PAGE_OFFSET added already */
 39 /* now sets up tables using sun3 PTEs rather than i386 as before. --m */
 40 void __init paging_init(void)
 41 {
 42         pgd_t * pg_dir;
 43         pte_t * pg_table;
 44         int i;
 45         unsigned long address;
 46         unsigned long next_pgtable;
 47         unsigned long bootmem_end;
 48         unsigned long zones_size[MAX_NR_ZONES] = { 0, };
 49         unsigned long size;
 50 
 51 #ifdef TEST_VERIFY_AREA
 52         wp_works_ok = 0;
 53 #endif
 54         empty_zero_page = alloc_bootmem_pages(PAGE_SIZE);
 55 
 56         address = PAGE_OFFSET;
 57         pg_dir = swapper_pg_dir;
 58         memset (swapper_pg_dir, 0, sizeof (swapper_pg_dir));
 59         memset (kernel_pg_dir,  0, sizeof (kernel_pg_dir));
 60 
 61         size = num_pages * sizeof(pte_t);
 62         size = (size + PAGE_SIZE) & ~(PAGE_SIZE-1);
 63 
 64         next_pgtable = (unsigned long)alloc_bootmem_pages(size);
 65         bootmem_end = (next_pgtable + size + PAGE_SIZE) & PAGE_MASK;
 66 
 67         /* Map whole memory from PAGE_OFFSET (0x0E000000) */
 68         pg_dir += PAGE_OFFSET >> PGDIR_SHIFT;
 69 
 70         while (address < (unsigned long)high_memory) {
 71                 pg_table = (pte_t *) __pa (next_pgtable);
 72                 next_pgtable += PTRS_PER_PTE * sizeof (pte_t);
 73                 pgd_val(*pg_dir) = (unsigned long) pg_table;
 74                 pg_dir++;
 75 
 76                 /* now change pg_table to kernel virtual addresses */
 77                 pg_table = (pte_t *) __va ((unsigned long) pg_table);
 78                 for (i=0; i<PTRS_PER_PTE; ++i, ++pg_table) {
 79                         pte_t pte = pfn_pte(virt_to_pfn(address), PAGE_INIT);
 80                         if (address >= (unsigned long)high_memory)
 81                                 pte_val (pte) = 0;
 82                         set_pte (pg_table, pte);
 83                         address += PAGE_SIZE;
 84                 }
 85         }
 86 
 87         mmu_emu_init(bootmem_end);
 88 
 89         current->mm = NULL;
 90 
 91         /* memory sizing is a hack stolen from motorola.c..  hope it works for us */
 92         zones_size[ZONE_DMA] = ((unsigned long)high_memory - PAGE_OFFSET) >> PAGE_SHIFT;
 93 
 94         /* I really wish I knew why the following change made things better...  -- Sam */
 95 /*      free_area_init(zones_size); */
 96         free_area_init_node(0, zones_size,
 97                             (__pa(PAGE_OFFSET) >> PAGE_SHIFT) + 1, NULL);
 98 
 99 
100 }
101 
102 
103 

~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

kernel.org | git.kernel.org | LWN.net | Project Home | Wiki (Japanese) | Wiki (English) | SVN repository | Mail admin

Linux® is a registered trademark of Linus Torvalds in the United States and other countries.
TOMOYO® is a registered trademark of NTT DATA CORPORATION.

osdn.jp