sections.h 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  1. /*
  2. * Copyright 2004-2009 Analog Devices Inc.
  3. *
  4. * Licensed under the GPL-2 or later.
  5. */
  6. #ifndef _BLACKFIN_SECTIONS_H
  7. #define _BLACKFIN_SECTIONS_H
  8. /* only used when MTD_UCLINUX */
  9. extern unsigned long memory_mtd_start, memory_mtd_end, mtd_size;
  10. extern unsigned long _ramstart, _ramend, _rambase;
  11. extern unsigned long memory_start, memory_end, physical_mem_end;
  12. /*
  13. * The weak markings on the lengths might seem weird, but this is required
  14. * in order to make gcc accept the fact that these may actually have a value
  15. * of 0 (since they aren't actually addresses, but sizes of sections).
  16. */
  17. extern char _stext_l1[], _etext_l1[], _text_l1_lma[], __weak _text_l1_len[];
  18. extern char _sdata_l1[], _edata_l1[], _sbss_l1[], _ebss_l1[],
  19. _data_l1_lma[], __weak _data_l1_len[];
  20. #ifdef CONFIG_ROMKERNEL
  21. extern char _data_lma[], _data_len[], _sinitdata[], _einitdata[], _init_data_lma[], _init_data_len[];
  22. #endif
  23. extern char _sdata_b_l1[], _edata_b_l1[], _sbss_b_l1[], _ebss_b_l1[],
  24. _data_b_l1_lma[], __weak _data_b_l1_len[];
  25. extern char _stext_l2[], _etext_l2[], _sdata_l2[], _edata_l2[],
  26. _sbss_l2[], _ebss_l2[], _l2_lma[], __weak _l2_len[];
  27. #include <asm/mem_map.h>
  28. /* Blackfin systems have discontinuous memory map and no virtualized memory */
  29. static inline int arch_is_kernel_text(unsigned long addr)
  30. {
  31. return
  32. (L1_CODE_LENGTH &&
  33. addr >= (unsigned long)_stext_l1 &&
  34. addr < (unsigned long)_etext_l1)
  35. ||
  36. (L2_LENGTH &&
  37. addr >= (unsigned long)_stext_l2 &&
  38. addr < (unsigned long)_etext_l2);
  39. }
  40. #define arch_is_kernel_text(addr) arch_is_kernel_text(addr)
  41. static inline int arch_is_kernel_data(unsigned long addr)
  42. {
  43. return
  44. (L1_DATA_A_LENGTH &&
  45. addr >= (unsigned long)_sdata_l1 &&
  46. addr < (unsigned long)_ebss_l1)
  47. ||
  48. (L1_DATA_B_LENGTH &&
  49. addr >= (unsigned long)_sdata_b_l1 &&
  50. addr < (unsigned long)_ebss_b_l1)
  51. ||
  52. (L2_LENGTH &&
  53. addr >= (unsigned long)_sdata_l2 &&
  54. addr < (unsigned long)_ebss_l2);
  55. }
  56. #define arch_is_kernel_data(addr) arch_is_kernel_data(addr)
  57. #include <asm-generic/sections.h>
  58. #endif