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

Subversion Repositories openrisc

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

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 688 jeremybenn
typedef struct
2
{
3
  unsigned long long pte;
4
} pte_t;
5
pte_t mk_swap_pte (unsigned long offset)
6
{
7
  pte_t pte;
8
  pte.pte = (offset << 40);
9
  return pte;
10
}
11
int pte_file (pte_t pte)
12
{
13
  return pte.pte & (1 << 4);
14
}
15
typedef struct
16
{
17
  unsigned long val;
18
} swp_entry_t;
19
pte_t swp_entry_to_pte (swp_entry_t entry)
20
{
21
  swp_entry_t arch_entry;
22
  arch_entry = (swp_entry_t){mk_swap_pte (swp_offset (entry)).pte};
23
  __BUG_ON ((unsigned long) pte_file ((pte_t) {arch_entry.val}));
24
  return (pte_t) {arch_entry.val};
25
}

powered by: WebSVN 2.1.0

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