Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/kaber/nf-next-2.6
[linux-2.6.git] / arch / blackfin / include / asm / sections.h
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 extern char _stext_l1[], _etext_l1[], _sdata_l1[], _edata_l1[], _sbss_l1[],
17         _ebss_l1[], _l1_lma_start[], _sdata_b_l1[], _sbss_b_l1[], _ebss_b_l1[],
18         _stext_l2[], _etext_l2[], _sdata_l2[], _edata_l2[], _sbss_l2[],
19         _ebss_l2[], _l2_lma_start[];
20
21 #include <asm/mem_map.h>
22
23 /* Blackfin systems have discontinuous memory map and no virtualized memory */
24 static inline int arch_is_kernel_text(unsigned long addr)
25 {
26         return
27                 (L1_CODE_LENGTH &&
28                  addr >= (unsigned long)_stext_l1 &&
29                  addr <  (unsigned long)_etext_l1)
30                 ||
31                 (L2_LENGTH &&
32                  addr >= (unsigned long)_stext_l2 &&
33                  addr <  (unsigned long)_etext_l2);
34 }
35 #define arch_is_kernel_text(addr) arch_is_kernel_text(addr)
36
37 static inline int arch_is_kernel_data(unsigned long addr)
38 {
39         return
40                 (L1_DATA_A_LENGTH &&
41                  addr >= (unsigned long)_sdata_l1 &&
42                  addr <  (unsigned long)_ebss_l1)
43                 ||
44                 (L1_DATA_B_LENGTH &&
45                  addr >= (unsigned long)_sdata_b_l1 &&
46                  addr <  (unsigned long)_ebss_b_l1)
47                 ||
48                 (L2_LENGTH &&
49                  addr >= (unsigned long)_sdata_l2 &&
50                  addr <  (unsigned long)_ebss_l2);
51 }
52 #define arch_is_kernel_data(addr) arch_is_kernel_data(addr)
53
54 #include <asm-generic/sections.h>
55
56 #endif