Merge tag 'v3.3.7' into 3.3/master
[zen-stable.git] / arch / hexagon / include / asm / mem-layout.h
blob72e5dcda79f5078ad227445eaa0ce480d3efa4f4
1 /*
2 * Memory layout definitions for the Hexagon architecture
4 * Copyright (c) 2010-2011, Code Aurora Forum. All rights reserved.
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License version 2 and
8 * only version 2 as published by the Free Software Foundation.
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
15 * You should have received a copy of the GNU General Public License
16 * along with this program; if not, write to the Free Software
17 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
18 * 02110-1301, USA.
21 #ifndef _ASM_HEXAGON_MEM_LAYOUT_H
22 #define _ASM_HEXAGON_MEM_LAYOUT_H
24 #include <linux/const.h>
27 * Have to do this for ginormous numbers, else they get printed as
28 * negative numbers, which the linker no likey when you try to
29 * assign it to the location counter.
32 #define PAGE_OFFSET _AC(0xc0000000, UL)
35 * LOAD_ADDRESS is the physical/linear address of where in memory
36 * the kernel gets loaded. The 12 least significant bits must be zero (0)
37 * due to limitations on setting the EVB
41 #ifndef LOAD_ADDRESS
42 #define LOAD_ADDRESS 0x00000000
43 #endif
45 #define TASK_SIZE (PAGE_OFFSET)
47 /* not sure how these are used yet */
48 #define STACK_TOP TASK_SIZE
49 #define STACK_TOP_MAX TASK_SIZE
51 #ifndef __ASSEMBLY__
52 enum fixed_addresses {
53 FIX_KMAP_BEGIN,
54 FIX_KMAP_END, /* check for per-cpuism */
55 __end_of_fixed_addresses
58 #define MIN_KERNEL_SEG 0x300 /* From 0xc0000000 */
59 extern int max_kernel_seg;
62 * Start of vmalloc virtual address space for kernel;
63 * supposed to be based on the amount of physical memory available
66 #define VMALLOC_START (PAGE_OFFSET + VMALLOC_OFFSET + \
67 (unsigned long)high_memory)
69 /* Gap between physical ram and vmalloc space for guard purposes. */
70 #define VMALLOC_OFFSET PAGE_SIZE
73 * Create the space between VMALLOC_START and FIXADDR_TOP backwards
74 * from the ... "top".
76 * Permanent IO mappings will live at 0xfexx_xxxx
77 * Hypervisor occupies the last 16MB page at 0xffxxxxxx
80 #define FIXADDR_TOP 0xfe000000
81 #define FIXADDR_SIZE (__end_of_fixed_addresses << PAGE_SHIFT)
82 #define FIXADDR_START (FIXADDR_TOP - FIXADDR_SIZE)
85 * "permanent kernel mappings", defined as long-lasting mappings of
86 * high-memory page frames into the kernel address space.
89 #define LAST_PKMAP PTRS_PER_PTE
90 #define LAST_PKMAP_MASK (LAST_PKMAP - 1)
91 #define PKMAP_NR(virt) ((virt - PKMAP_BASE) >> PAGE_SHIFT)
92 #define PKMAP_ADDR(nr) (PKMAP_BASE + ((nr) << PAGE_SHIFT))
95 * To the "left" of the fixed map space is the kmap space
97 * "Permanent Kernel Mappings"; fancy (or less fancy) PTE table
98 * that looks like it's actually walked.
99 * Need to check the alignment/shift usage; some archs use
100 * PMD_MASK on this value
102 #define PKMAP_BASE (FIXADDR_START-PAGE_SIZE*LAST_PKMAP)
105 * 2 pages of guard gap between where vmalloc area ends
106 * and pkmap_base begins.
108 #define VMALLOC_END (PKMAP_BASE-PAGE_SIZE*2)
109 #endif /* !__ASSEMBLY__ */
112 #endif /* _ASM_HEXAGON_MEM_LAYOUT_H */