xref: /kvm-unit-tests/lib/s390x/asm/page.h (revision 5b70cbdb7bc2ea65096b51565c75815cc95945b8)
1 /*
2  * Copyright (c) 2017 Red Hat Inc
3  *
4  * Authors:
5  *  Thomas Huth <thuth@redhat.com>
6  *  David Hildenbrand <david@redhat.com>
7  *
8  * This code is free software; you can redistribute it and/or modify it
9  * under the terms of the GNU Library General Public License version 2.
10  */
11 #ifndef _ASMS390X_PAGE_H_
12 #define _ASMS390X_PAGE_H_
13 
14 #include <asm-generic/page.h>
15 
16 typedef uint64_t pgdval_t;		/* Region-1 table entry */
17 typedef uint64_t p4dval_t;		/* Region-2 table entry*/
18 typedef uint64_t pudval_t;		/* Region-3 table entry */
19 typedef uint64_t pmdval_t;		/* Segment table entry */
20 typedef uint64_t pteval_t;		/* Page table entry */
21 
22 typedef struct { pgdval_t pgd; } pgd_t;
23 typedef struct { p4dval_t p4d; } p4d_t;
24 typedef struct { pudval_t pud; } pud_t;
25 typedef struct { pmdval_t pmd; } pmd_t;
26 typedef struct { pteval_t pte; } pte_t;
27 
28 #define pgd_val(x)	((x).pgd)
29 #define p4d_val(x)	((x).p4d)
30 #define pud_val(x)	((x).pud)
31 #define pmd_val(x)	((x).pmd)
32 #define pte_val(x)	((x).pte)
33 
34 #define __pgd(x)	((pgd_t) { (x) } )
35 #define __p4d(x)	((p4d_t) { (x) } )
36 #define __pud(x)	((pud_t) { (x) } )
37 #define __pmd(x)	((pmd_t) { (x) } )
38 #define __pte(x)	((pte_t) { (x) } )
39 
40 #endif
41