Xen Test Framework
page-pae.h
Go to the documentation of this file.
1
6#ifndef XTF_X86_PAGE_PAE_H
7#define XTF_X86_PAGE_PAE_H
8
9#include <xtf/types.h>
10
11#include <arch/page.h>
12
14#define PAE_PTE_SIZE 8
16#define PAE_PTE_ORDER 3
17
19#define PAE_PT_ORDER 9
20
23#define PAE_L1_PT_ENTRIES (PAGE_SIZE / PAE_PTE_SIZE)
24#define PAE_L2_PT_ENTRIES (PAGE_SIZE / PAE_PTE_SIZE)
25#define PAE_L3_PT_ENTRIES (PAGE_SIZE / PAE_PTE_SIZE)
26#define PAE_L4_PT_ENTRIES (PAGE_SIZE / PAE_PTE_SIZE)
27
28/* Other than PAE32_L3, which has 4 entries. */
29#define PAE32_L3_ENTRIES 4
32#define PAE_L1_PT_SHIFT 12
33#define PAE_L2_PT_SHIFT 21
34#define PAE_L3_PT_SHIFT 30
35#define PAE_L4_PT_SHIFT 39
36
37#ifndef __ASSEMBLY__
38
41#define PAE_PRIpte "016"PRIx64
42
43static inline unsigned int pae_l1_table_offset(unsigned long linear)
44{
45 return (linear >> PAE_L1_PT_SHIFT) & (PAE_L1_PT_ENTRIES - 1);
46}
47static inline unsigned int pae_l2_table_offset(unsigned long linear)
48{
49 return (linear >> PAE_L2_PT_SHIFT) & (PAE_L2_PT_ENTRIES - 1);
50}
51static inline unsigned int pae_l3_table_offset(unsigned long linear)
52{
53 return (linear >> PAE_L3_PT_SHIFT) & (PAE_L3_PT_ENTRIES - 1);
54}
55#ifdef __x86_64__
56static inline unsigned int pae_l4_table_offset(unsigned long linear)
57{
58 return (linear >> PAE_L4_PT_SHIFT) & (PAE_L4_PT_ENTRIES - 1);
59}
60#endif /* __x86_64__ */
61
62#endif /* __ASSEMBLY__ */
63#endif /* XTF_X86_PAGE_PAE_H */
64
65/*
66 * Local variables:
67 * mode: C
68 * c-file-style: "BSD"
69 * c-basic-offset: 4
70 * tab-width: 4
71 * indent-tabs-mode: nil
72 * End:
73 */
static unsigned int pae_l1_table_offset(unsigned long linear)
Definition: page-pae.h:43
#define PAE_L4_PT_ENTRIES
Definition: page-pae.h:26
#define PAE_L3_PT_SHIFT
Definition: page-pae.h:34
#define PAE_L1_PT_ENTRIES
All PAE pagetables contain 512 entries.
Definition: page-pae.h:23
static unsigned int pae_l3_table_offset(unsigned long linear)
Definition: page-pae.h:51
#define PAE_L1_PT_SHIFT
Definition: page-pae.h:32
#define PAE_L2_PT_ENTRIES
Definition: page-pae.h:24
#define PAE_L3_PT_ENTRIES
Definition: page-pae.h:25
#define PAE_L2_PT_SHIFT
Definition: page-pae.h:33
static unsigned int pae_l2_table_offset(unsigned long linear)
Definition: page-pae.h:47
#define PAE_L4_PT_SHIFT
Definition: page-pae.h:35
uint64_t pae_intpte_t
Integer representation of a PTE.
Definition: page-pae.h:40
__UINT64_TYPE__ uint64_t
Definition: stdint.h:17
Common declarations for all tests.