blob: fbd4084757259f7d868b35334c98edae83c2a599 [file] [log] [blame]
Robin Getz96f10502009-09-24 14:11:24 +00001/*
Mike Frysinger96956452011-06-17 17:54:40 -04002 * Copyright 2004-2009 Analog Devices Inc.
3 *
4 * Licensed under the GPL-2 or later.
5 */
Robin Getz96f10502009-09-24 14:11:24 +00006
Bryan Wu1394f032007-05-06 14:50:22 -07007#ifndef _BLACKFIN_SECTIONS_H
8#define _BLACKFIN_SECTIONS_H
9
Mike Frysinger5203fa82009-06-08 18:40:28 -040010/* only used when MTD_UCLINUX */
11extern unsigned long memory_mtd_start, memory_mtd_end, mtd_size;
12
13extern unsigned long _ramstart, _ramend, _rambase;
14extern unsigned long memory_start, memory_end, physical_mem_end;
15
Mike Frysinger5cd82a62009-09-23 20:34:48 +000016/*
17 * The weak markings on the lengths might seem weird, but this is required
18 * in order to make gcc accept the fact that these may actually have a value
19 * of 0 (since they aren't actually addresses, but sizes of sections).
20 */
21extern char _stext_l1[], _etext_l1[], _text_l1_lma[], __weak _text_l1_len[];
22extern char _sdata_l1[], _edata_l1[], _sbss_l1[], _ebss_l1[],
23 _data_l1_lma[], __weak _data_l1_len[];
Barry Songd86bfb12010-01-07 04:11:17 +000024#ifdef CONFIG_ROMKERNEL
25extern char _data_lma[], _data_len[], _sinitdata[], _einitdata[], _init_data_lma[], _init_data_len[];
26#endif
Mike Frysinger5cd82a62009-09-23 20:34:48 +000027extern char _sdata_b_l1[], _edata_b_l1[], _sbss_b_l1[], _ebss_b_l1[],
28 _data_b_l1_lma[], __weak _data_b_l1_len[];
29extern char _stext_l2[], _etext_l2[], _sdata_l2[], _edata_l2[],
30 _sbss_l2[], _ebss_l2[], _l2_lma[], __weak _l2_len[];
Mike Frysinger5203fa82009-06-08 18:40:28 -040031
Mike Frysingere56770f2009-09-22 16:44:17 -070032#include <asm/mem_map.h>
33
34/* Blackfin systems have discontinuous memory map and no virtualized memory */
35static inline int arch_is_kernel_text(unsigned long addr)
36{
37 return
38 (L1_CODE_LENGTH &&
39 addr >= (unsigned long)_stext_l1 &&
40 addr < (unsigned long)_etext_l1)
41 ||
42 (L2_LENGTH &&
43 addr >= (unsigned long)_stext_l2 &&
44 addr < (unsigned long)_etext_l2);
45}
46#define arch_is_kernel_text(addr) arch_is_kernel_text(addr)
47
48static inline int arch_is_kernel_data(unsigned long addr)
49{
50 return
51 (L1_DATA_A_LENGTH &&
52 addr >= (unsigned long)_sdata_l1 &&
53 addr < (unsigned long)_ebss_l1)
54 ||
55 (L1_DATA_B_LENGTH &&
56 addr >= (unsigned long)_sdata_b_l1 &&
57 addr < (unsigned long)_ebss_b_l1)
58 ||
59 (L2_LENGTH &&
60 addr >= (unsigned long)_sdata_l2 &&
61 addr < (unsigned long)_ebss_l2);
62}
63#define arch_is_kernel_data(addr) arch_is_kernel_data(addr)
64
65#include <asm-generic/sections.h>
66
Bryan Wu1394f032007-05-06 14:50:22 -070067#endif