root/fs/umsdos/check.c

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

DEFINITIONS

This source file includes following definitions.
  1. check_one_table
  2. check_page_tables

   1 /*
   2  * linux/fs/umsdos/check.c
   3  *
   4  *
   5  */
   6 
   7 #include <linux/signal.h>
   8 #include <linux/sched.h>
   9 #include <linux/head.h>
  10 #include <linux/kernel.h>
  11 #include <linux/errno.h>
  12 #include <linux/string.h>
  13 #include <linux/types.h>
  14 #include <linux/ptrace.h>
  15 #include <linux/mman.h>
  16 #include <linux/mm.h>
  17 
  18 #include <asm/system.h>
  19 
  20 static int check_one_table(struct pde * page_dir)
     /* [previous][next][first][last][top][bottom][index][help] */
  21 {
  22         if (pgd_none(*page_dir))
  23                 return 0;
  24         if (pgd_bad(*page_dir))
  25                 return 1;
  26         return 0;
  27 }
  28 
  29 /*
  30  * This function checks all page tables of "current"
  31  */
  32 void check_page_tables(void)
     /* [previous][next][first][last][top][bottom][index][help] */
  33 {
  34         struct pgd * pg_dir;
  35         static int err = 0;
  36 
  37         int stack_level = (long)(&pg_dir)-current->kernel_stack_page;
  38         if (stack_level < 1500) printk ("** %d ** ",stack_level);
  39         pg_dir = PAGE_DIR_OFFSET(current, 0);
  40         if (err == 0) {
  41                 int i;
  42                 for (i = 0 ; i < PTRS_PER_PAGE ; i++,page_dir++){
  43                         int notok = check_one_table(page_dir);
  44                         if (notok){
  45                                 err++;
  46                                 printk ("|%d:%08lx| ",i, page_dir->pgd);
  47                         }
  48                 }
  49                 if (err) printk ("\nErreur MM %d\n",err);
  50         }
  51 }

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