Path: blob/master/arch/hexagon/include/asm/mem-layout.h
26481 views
/* SPDX-License-Identifier: GPL-2.0-only */1/*2* Memory layout definitions for the Hexagon architecture3*4* Copyright (c) 2010-2013, The Linux Foundation. All rights reserved.5*/67#ifndef _ASM_HEXAGON_MEM_LAYOUT_H8#define _ASM_HEXAGON_MEM_LAYOUT_H910#include <linux/const.h>1112/*13* Have to do this for ginormous numbers, else they get printed as14* negative numbers, which the linker no likey when you try to15* assign it to the location counter.16*/1718#define PAGE_OFFSET _AC(0xc0000000, UL)1920/*21* Compiling for a platform that needs a crazy physical offset22* (like if the memory starts at 1GB and up) means we need23* an actual PHYS_OFFSET. Should be set up in head.S.24*/2526#ifdef CONFIG_HEXAGON_PHYS_OFFSET27#ifndef __ASSEMBLY__28extern unsigned long __phys_offset;29#endif30#define PHYS_OFFSET __phys_offset31#endif3233#ifndef PHYS_OFFSET34#define PHYS_OFFSET 035#endif3637#define PHYS_PFN_OFFSET (PHYS_OFFSET >> PAGE_SHIFT)38#define ARCH_PFN_OFFSET PHYS_PFN_OFFSET3940#define TASK_SIZE (PAGE_OFFSET)4142/* not sure how these are used yet */43#define STACK_TOP TASK_SIZE44#define STACK_TOP_MAX TASK_SIZE4546#ifndef __ASSEMBLY__47enum fixed_addresses {48FIX_KMAP_BEGIN,49FIX_KMAP_END, /* check for per-cpuism */50__end_of_fixed_addresses51};5253#define MIN_KERNEL_SEG (PAGE_OFFSET >> PGDIR_SHIFT) /* L1 shift is 22 bits */54extern int max_kernel_seg;5556/*57* Start of vmalloc virtual address space for kernel;58* supposed to be based on the amount of physical memory available59*/6061#define VMALLOC_START ((unsigned long) __va(high_memory + VMALLOC_OFFSET))6263/* Gap between physical ram and vmalloc space for guard purposes. */64#define VMALLOC_OFFSET PAGE_SIZE6566/*67* Create the space between VMALLOC_START and FIXADDR_TOP backwards68* from the ... "top".69*70* Permanent IO mappings will live at 0xfexx_xxxx71* Hypervisor occupies the last 16MB page at 0xffxxxxxx72*/7374#define FIXADDR_TOP 0xfe00000075#define FIXADDR_SIZE (__end_of_fixed_addresses << PAGE_SHIFT)76#define FIXADDR_START (FIXADDR_TOP - FIXADDR_SIZE)7778/*79* "permanent kernel mappings", defined as long-lasting mappings of80* high-memory page frames into the kernel address space.81*/8283#define LAST_PKMAP PTRS_PER_PTE84#define LAST_PKMAP_MASK (LAST_PKMAP - 1)85#define PKMAP_NR(virt) ((virt - PKMAP_BASE) >> PAGE_SHIFT)86#define PKMAP_ADDR(nr) (PKMAP_BASE + ((nr) << PAGE_SHIFT))8788/*89* To the "left" of the fixed map space is the kmap space90*91* "Permanent Kernel Mappings"; fancy (or less fancy) PTE table92* that looks like it's actually walked.93* Need to check the alignment/shift usage; some archs use94* PMD_MASK on this value95*/96#define PKMAP_BASE (FIXADDR_START-PAGE_SIZE*LAST_PKMAP)9798/*99* 2 pages of guard gap between where vmalloc area ends100* and pkmap_base begins.101*/102#define VMALLOC_END (PKMAP_BASE-PAGE_SIZE*2)103#endif /* !__ASSEMBLY__ */104105106#endif /* _ASM_HEXAGON_MEM_LAYOUT_H */107108109