root/arch/sparc/mm/loadmmu.c

/* [previous][next][first][last][top][bottom][index][help] */

DEFINITIONS

This source file includes following definitions.
  1. load_mmu

   1 /* loadmmu.c:  This code loads up all the mm function pointers once the
   2  *             machine type has been determined.  It also sets the static
   3  *             mmu values such as PAGE_NONE, etc.
   4  *
   5  * Copyright (C) 1995 David S. Miller (davem@caip.rutgers.edu)
   6  */
   7 
   8 #include <asm/system.h>
   9 #include <asm/page.h>
  10 #include <asm/pgtable.h>
  11 
  12 void (*invalidate)(void);
  13 void (*set_pte)(pte_t *ptep, pte_t entry);
  14 
  15 unsigned int pmd_shift, pmd_size, pmd_mask;
  16 unsigned int (*pmd_align)(unsigned int);
  17 unsigned int pgdir_shift, pgdir_size, pgdir_mask;
  18 unsigned int (*pgdir_align)(unsigned int);
  19 unsigned int ptrs_per_pte, ptrs_per_pmd, ptrs_per_pgd;
  20 
  21 pgprot_t page_none, page_shared, page_copy, page_readonly, page_kernel;
  22 pgprot_t page_invalid;
  23 
  24 /* Grrr... function pointers galore... */
  25 unsigned long (*pte_page)(pte_t);
  26 unsigned long (*pmd_page)(pmd_t);
  27 unsigned long (*pgd_page)(pgd_t);
  28 
  29 void (*sparc_update_rootmmu_dir)(struct task_struct *, pgd_t *pgdir);
  30 unsigned long (*(vmalloc_start))(void);
  31 void (*switch_to_context)(int);
  32 
  33 int (*pte_none)(pte_t);
  34 int (*pte_present)(pte_t);
  35 int (*pte_inuse)(pte_t *);
  36 void (*pte_clear)(pte_t *);
  37 void (*pte_reuse)(pte_t *);
  38 
  39 int (*pmd_none)(pmd_t);
  40 int (*pmd_bad)(pmd_t);
  41 int (*pmd_present)(pmd_t);
  42 int (*pmd_inuse)(pmd_t *);
  43 void (*pmd_clear)(pmd_t *);
  44 void (*pmd_reuse)(pmd_t *);
  45 
  46 int (*pgd_none)(pgd_t);
  47 int (*pgd_bad)(pgd_t);
  48 int (*pgd_present)(pgd_t);
  49 int (*pgd_inuse)(pgd_t *);
  50 void (*pgd_clear)(pgd_t *);
  51 void (*pgd_reuse)(pgd_t *);
  52 
  53 pte_t (*mk_pte)(unsigned long, pgprot_t);
  54 void (*pgd_set)(pgd_t *, pte_t *);
  55 pte_t (*pte_modify)(pte_t, pgprot_t);
  56 pgd_t * (*pgd_offset)(struct task_struct *, unsigned long);
  57 pmd_t * (*pmd_offset)(pgd_t *, unsigned long);
  58 pte_t * (*pte_offset)(pmd_t *, unsigned long);
  59 void (*pte_free_kernel)(pte_t *);
  60 pte_t * (*pte_alloc_kernel)(pmd_t *, unsigned long);
  61 
  62 void (*pmd_free_kernel)(pmd_t *);
  63 pmd_t * (*pmd_alloc_kernel)(pgd_t *, unsigned long);
  64 void (*pte_free)(pte_t *);
  65 pte_t * (*pte_alloc)(pmd_t *, unsigned long);
  66 
  67 void (*pmd_free)(pmd_t *);
  68 pmd_t * (*pmd_alloc)(pgd_t *, unsigned long);
  69 void (*pgd_free)(pgd_t *);
  70 
  71 pgd_t * (*pgd_alloc)(void);
  72 
  73 /*
  74  * The following only work if pte_present() is true.
  75  * Undefined behaviour if not..
  76  */
  77 int (*pte_read)(pte_t);
  78 int (*pte_write)(pte_t);
  79 int (*pte_exec)(pte_t);
  80 int (*pte_dirty)(pte_t);
  81 int (*pte_young)(pte_t);
  82 int (*pte_cow)(pte_t);
  83 
  84 pte_t (*pte_wrprotect)(pte_t);
  85 pte_t (*pte_rdprotect)(pte_t);
  86 pte_t (*pte_exprotect)(pte_t);
  87 pte_t (*pte_mkclean)(pte_t);
  88 pte_t (*pte_mkold)(pte_t);
  89 pte_t (*pte_uncow)(pte_t);
  90 pte_t (*pte_mkwrite)(pte_t);
  91 pte_t (*pte_mkread)(pte_t);
  92 pte_t (*pte_mkexec)(pte_t);
  93 pte_t (*pte_mkdirty)(pte_t);
  94 pte_t (*pte_mkyoung)(pte_t);
  95 pte_t (*pte_mkcow)(pte_t);
  96 
  97 extern void ld_mmu_sun4c(void);
  98 extern void ld_mmu_srmmu(void);
  99 
 100 void
 101 load_mmu(void)
     /* [previous][next][first][last][top][bottom][index][help] */
 102 {
 103         switch(sparc_cpu_model) {
 104         case sun4c:
 105                 ld_mmu_sun4c();
 106                 break;
 107         case sun4m:
 108         case sun4d:
 109         case sun4e:
 110                 ld_mmu_srmmu();
 111                 break;
 112         default:
 113                 printk("load_mmu:  MMU support not available for this architecture\n");
 114                 printk("load_mmu:  sparc_cpu_model = %d\n", (int) sparc_cpu_model);
 115                 printk("load_mmu:  Halting...\n");
 116                 halt();
 117         };
 118         return;
 119 }

/* [previous][next][first][last][top][bottom][index][help] */