sections.h 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. #ifndef _ASM_GENERIC_SECTIONS_H_
  2. #define _ASM_GENERIC_SECTIONS_H_
  3. /* References to section boundaries */
  4. /*
  5. * Usage guidelines:
  6. * _text, _data: architecture specific, don't use them in arch-independent code
  7. * [_stext, _etext]: contains .text.* sections, may also contain .rodata.*
  8. * and/or .init.* sections
  9. * [_sdata, _edata]: contains .data.* sections, may also contain .rodata.*
  10. * and/or .init.* sections.
  11. * [__start_rodata, __end_rodata]: contains .rodata.* sections
  12. * [__init_begin, __init_end]: contains .init.* sections, but .init.text.*
  13. * may be out of this range on some architectures.
  14. * [_sinittext, _einittext]: contains .init.text.* sections
  15. * [__bss_start, __bss_stop]: contains BSS sections
  16. *
  17. * Following global variables are optional and may be unavailable on some
  18. * architectures and/or kernel configurations.
  19. * _text, _data
  20. * __kprobes_text_start, __kprobes_text_end
  21. * __entry_text_start, __entry_text_end
  22. * __ctors_start, __ctors_end
  23. */
  24. extern char _text[], _stext[], _etext[];
  25. extern char _data[], _sdata[], _edata[];
  26. extern char __bss_start[], __bss_stop[];
  27. extern char __init_begin[], __init_end[];
  28. extern char _sinittext[], _einittext[];
  29. extern char _end[];
  30. extern char __per_cpu_load[], __per_cpu_start[], __per_cpu_end[];
  31. extern char __kprobes_text_start[], __kprobes_text_end[];
  32. extern char __entry_text_start[], __entry_text_end[];
  33. extern char __start_rodata[], __end_rodata[];
  34. /* Start and end of .ctors section - used for constructor calls. */
  35. extern char __ctors_start[], __ctors_end[];
  36. /* function descriptor handling (if any). Override
  37. * in asm/sections.h */
  38. #ifndef dereference_function_descriptor
  39. #define dereference_function_descriptor(p) (p)
  40. #endif
  41. /* random extra sections (if any). Override
  42. * in asm/sections.h */
  43. #ifndef arch_is_kernel_text
  44. static inline int arch_is_kernel_text(unsigned long addr)
  45. {
  46. return 0;
  47. }
  48. #endif
  49. #ifndef arch_is_kernel_data
  50. static inline int arch_is_kernel_data(unsigned long addr)
  51. {
  52. return 0;
  53. }
  54. #endif
  55. #endif /* _ASM_GENERIC_SECTIONS_H_ */