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

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