summaryrefslogtreecommitdiffstats
path: root/arch/blackfin/include/asm/sections.h
blob: ae4dae1e370b150a3df989bd2fd403a6e8e5ba24 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
#ifndef _BLACKFIN_SECTIONS_H
#define _BLACKFIN_SECTIONS_H

/* only used when MTD_UCLINUX */
extern unsigned long memory_mtd_start, memory_mtd_end, mtd_size;

extern unsigned long _ramstart, _ramend, _rambase;
extern unsigned long memory_start, memory_end, physical_mem_end;

extern char _stext_l1[], _etext_l1[], _sdata_l1[], _edata_l1[], _sbss_l1[],
	_ebss_l1[], _l1_lma_start[], _sdata_b_l1[], _sbss_b_l1[], _ebss_b_l1[],
	_stext_l2[], _etext_l2[], _sdata_l2[], _edata_l2[], _sbss_l2[],
	_ebss_l2[], _l2_lma_start[];

#include <asm/mem_map.h>

/* Blackfin systems have discontinuous memory map and no virtualized memory */
static inline int arch_is_kernel_text(unsigned long addr)
{
	return
		(L1_CODE_LENGTH &&
		 addr >= (unsigned long)_stext_l1 &&
		 addr <  (unsigned long)_etext_l1)
		||
		(L2_LENGTH &&
		 addr >= (unsigned long)_stext_l2 &&
		 addr <  (unsigned long)_etext_l2);
}
#define arch_is_kernel_text(addr) arch_is_kernel_text(addr)

static inline int arch_is_kernel_data(unsigned long addr)
{
	return
		(L1_DATA_A_LENGTH &&
		 addr >= (unsigned long)_sdata_l1 &&
		 addr <  (unsigned long)_ebss_l1)
		||
		(L1_DATA_B_LENGTH &&
		 addr >= (unsigned long)_sdata_b_l1 &&
		 addr <  (unsigned long)_ebss_b_l1)
		||
		(L2_LENGTH &&
		 addr >= (unsigned long)_sdata_l2 &&
		 addr <  (unsigned long)_ebss_l2);
}
#define arch_is_kernel_data(addr) arch_is_kernel_data(addr)

#include <asm-generic/sections.h>

#endif
OpenPOWER on IntegriCloud