OpenCores
URL https://opencores.org/ocsvn/openrisc/openrisc/trunk

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [gcc/] [testsuite/] [gcc.c-torture/] [compile/] [pr45535.c] - Blame information for rev 688

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 688 jeremybenn
typedef struct {
2
    unsigned long pmd0;
3
    unsigned long pmd1;
4
} pmd_t;
5
typedef unsigned int pgd_t;
6
struct mm_struct {
7
    pgd_t * pgd;
8
};
9
extern inline int pmd_bad(pmd_t pmd)
10
{
11
}
12
extern inline void pmd_clear(pmd_t * pmdp)
13
{
14
  ((*pmdp).pmd0) = 0x20 | 0x00;
15
  ((*pmdp).pmd1) = 0x20 | 0x00;
16
}
17
static inline void free_one_pmd(pmd_t * dir)
18
{
19
  if (pmd_bad(*dir)) {
20
      pmd_clear(dir);
21
  }
22
}
23
static inline void free_one_pgd(pgd_t * dir)
24
{
25
  int j;
26
  pmd_t * pmd;
27
  pmd = ((pmd_t *) ((unsigned long) (void *)(__pgd_val(dir) & (~((1UL << 12)-1)))) + (((0) >> 21) & (512 - 1)));
28
  for (j = 0; j < 512 ; j++) {
29
      free_one_pmd(pmd+j);
30
  }
31
}
32
void clear_page_tables(struct mm_struct *mm, unsigned long first, int nr)
33
{
34
  pgd_t * page_dir = mm->pgd;
35
  do {
36
      free_one_pgd(page_dir);
37
  } while (--nr);
38
}

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.