summaryrefslogtreecommitdiff
path: root/arch/x86/machine/pmem.h
blob: 98b448dd38cacb45eda264ca882d36e3177b1ee7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
/*
 * Copyright (c) 2017 Richard Braun.
 *
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
 *
 *
 * Physical memory layout.
 *
 * This file is a top header in the inclusion hierarchy, and shouldn't include
 * other headers that may cause circular dependencies.
 */

#ifndef X86_PMEM_H
#define X86_PMEM_H

#include <kern/macros.h>

/*
 * Zone boundaries.
 */

#define PMEM_DMA_LIMIT          DECL_CONST(0x1000000, UL)

#ifdef __LP64__
#define PMEM_MAX_ZONES          4
#define PMEM_DMA32_LIMIT        DECL_CONST(0x100000000, UL)
#define PMEM_DIRECTMAP_LIMIT    DECL_CONST(0x400000000000, UL)
#define PMEM_HIGHMEM_LIMIT      DECL_CONST(0x10000000000000, UL)
#else /* __LP64__ */
#define PMEM_DIRECTMAP_LIMIT    DECL_CONST(0x38000000, ULL)
#ifdef CONFIG_X86_PAE
#define PMEM_MAX_ZONES          3
#define PMEM_HIGHMEM_LIMIT      DECL_CONST(0x10000000000000, ULL)
#else /* CONFIG_X86_PAE */
#define PMEM_MAX_ZONES          3
#define PMEM_HIGHMEM_LIMIT      DECL_CONST(0xfffff000, UL)
#endif /* CONFIG_X86_PAE */
#endif /* __LP64__ */

/*
 * Zone vm_page indexes.
 */

#define PMEM_ZONE_DMA           0
#define PMEM_ZONE_DMA32         1

#ifdef __LP64__
#define PMEM_ZONE_DIRECTMAP     2
#define PMEM_ZONE_HIGHMEM       3
#else /* __LP64__ */
#define PMEM_ZONE_DMA32         1
#define PMEM_ZONE_DIRECTMAP     1   /* Alias for the DMA32 zone */
#define PMEM_ZONE_HIGHMEM       2
#endif /* __LP64__ */

#endif /* X86_PMEM_H */