• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright 2004-2009 Analog Devices Inc.
3  *
4  * Licensed under the GPL-2 or later.
5  */
6 
7 #ifndef _BLACKFIN_SECTIONS_H
8 #define _BLACKFIN_SECTIONS_H
9 
10 /* only used when MTD_UCLINUX */
11 extern unsigned long memory_mtd_start, memory_mtd_end, mtd_size;
12 
13 extern unsigned long _ramstart, _ramend, _rambase;
14 extern unsigned long memory_start, memory_end, physical_mem_end;
15 
16 /*
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  */
21 extern char _stext_l1[], _etext_l1[], _text_l1_lma[], __weak _text_l1_len[];
22 extern char _sdata_l1[], _edata_l1[], _sbss_l1[], _ebss_l1[],
23 	_data_l1_lma[], __weak _data_l1_len[];
24 #ifdef CONFIG_ROMKERNEL
25 extern char _data_lma[], _data_len[], _sinitdata[], _einitdata[], _init_data_lma[], _init_data_len[];
26 #endif
27 extern char _sdata_b_l1[], _edata_b_l1[], _sbss_b_l1[], _ebss_b_l1[],
28 	_data_b_l1_lma[], __weak _data_b_l1_len[];
29 extern char _stext_l2[], _etext_l2[], _sdata_l2[], _edata_l2[],
30 	_sbss_l2[], _ebss_l2[], _l2_lma[], __weak _l2_len[];
31 
32 #include <asm/mem_map.h>
33 
34 /* Blackfin systems have discontinuous memory map and no virtualized memory */
arch_is_kernel_text(unsigned long addr)35 static 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 
arch_is_kernel_data(unsigned long addr)48 static 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 
67 #endif
68