sections.h 906 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. #ifndef _ASM_POWERPC_SECTIONS_H
  2. #define _ASM_POWERPC_SECTIONS_H
  3. #ifdef __KERNEL__
  4. #include <linux/elf.h>
  5. #include <linux/uaccess.h>
  6. #include <asm-generic/sections.h>
  7. #ifdef __powerpc64__
  8. extern char __end_interrupts[];
  9. extern char __prom_init_toc_start[];
  10. extern char __prom_init_toc_end[];
  11. static inline int in_kernel_text(unsigned long addr)
  12. {
  13. if (addr >= (unsigned long)_stext && addr < (unsigned long)__init_end)
  14. return 1;
  15. return 0;
  16. }
  17. static inline int overlaps_kernel_text(unsigned long start, unsigned long end)
  18. {
  19. return start < (unsigned long)__init_end &&
  20. (unsigned long)_stext < end;
  21. }
  22. #undef dereference_function_descriptor
  23. static inline void *dereference_function_descriptor(void *ptr)
  24. {
  25. struct ppc64_opd_entry *desc = ptr;
  26. void *p;
  27. if (!probe_kernel_address(&desc->funcaddr, p))
  28. ptr = p;
  29. return ptr;
  30. }
  31. #endif
  32. #endif /* __KERNEL__ */
  33. #endif /* _ASM_POWERPC_SECTIONS_H */