Robin Getz | 96f1050 | 2009-09-24 14:11:24 +0000 | [diff] [blame] | 1 | /* |
Mike Frysinger | 9695645 | 2011-06-17 17:54:40 -0400 | [diff] [blame] | 2 | * Copyright 2004-2009 Analog Devices Inc. |
| 3 | * |
| 4 | * Licensed under the GPL-2 or later. |
| 5 | */ |
Robin Getz | 96f1050 | 2009-09-24 14:11:24 +0000 | [diff] [blame] | 6 | |
Bryan Wu | 1394f03 | 2007-05-06 14:50:22 -0700 | [diff] [blame] | 7 | #ifndef _BLACKFIN_SECTIONS_H |
| 8 | #define _BLACKFIN_SECTIONS_H |
| 9 | |
Mike Frysinger | 5203fa8 | 2009-06-08 18:40:28 -0400 | [diff] [blame] | 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 | |
Mike Frysinger | 5cd82a6 | 2009-09-23 20:34:48 +0000 | [diff] [blame] | 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[]; |
Barry Song | d86bfb1 | 2010-01-07 04:11:17 +0000 | [diff] [blame] | 24 | #ifdef CONFIG_ROMKERNEL |
| 25 | extern char _data_lma[], _data_len[], _sinitdata[], _einitdata[], _init_data_lma[], _init_data_len[]; |
| 26 | #endif |
Mike Frysinger | 5cd82a6 | 2009-09-23 20:34:48 +0000 | [diff] [blame] | 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[]; |
Mike Frysinger | 5203fa8 | 2009-06-08 18:40:28 -0400 | [diff] [blame] | 31 | |
Mike Frysinger | e56770f | 2009-09-22 16:44:17 -0700 | [diff] [blame] | 32 | #include <asm/mem_map.h> |
| 33 | |
| 34 | /* Blackfin systems have discontinuous memory map and no virtualized memory */ |
| 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 | |
| 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 | |
Bryan Wu | 1394f03 | 2007-05-06 14:50:22 -0700 | [diff] [blame] | 67 | #endif |